DragonFly kernel List (threaded) for 2008-04
DragonFly BSD
DragonFly kernel List (threaded) for 2008-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Need ideas on how to solve an st_ino/st_dev test issue for HAMMER.


From: Oliver Fromme <check+jyne0x00rsc0xqiq@xxxxxxxxxx>
Date: 01 Apr 2008 13:57:18 GMT

Matthew Dillon <dillon@apollo.backplane.com> wrote:
 >    Here's the problem, given historical access softlinks as shown below:
 > 
 > test30# ls -lda cra*
 > drwxr-xr-x  1 root  wheel  Mar 29 13:04 crater
 > lrwxr-xr-x  1 root  wheel  Mar 29 18:57 crater.20080329 -> crater@@0x47eef383
 > lrwxr-xr-x  1 root  wheel  Mar 30 01:24 crater.20080330 -> crater@@0x47ef4e29
 > -rw-r--r--  2 root  wheel  Mar 30 01:24 crater.log
 > 
 >    The problem is that if I do this:
 > 
 >    diff -r crater.20080329/var/log crater.20080330/var/log
 > 
 >    Diff just returns without actually diffing anything.  The reason is
 >    because diff checks st_ino and st_dev and believes the directories/files
 >    to be identical because they match.

That's not a HAMMER-specific problem.  There's exactly the
same problem with snapshots on NetApp filers:  If you diff
a file with an older version of the same file within a
snapshot, diff returns immediately without diffing anything.
Even cp(1) does nothing:

# cp .snapshot/weekly.2/motd .
cp: ./motd and .snapshot/weekly.2/motd are identical (not copied).

Even "cp -f" doesn't do it.  You have to remove the file
first, or do something like "cat .snapshot/xxx/foo > foo".

 > [...]
 >    If anyone has any bright ideas, including 'leave it alone', I'm all
 >    ears.

I'm afraid I don't have a bright idea, but I would certainly
vote for doing something instead of leaving it alone,
because it's really a PITA each time it bites me.

I guess there are more programs that check st_ino and st_dev
and break in such situations.  But diff(1) and cp(1) are the
ones that pain me the most, so the st_gen solution would be
fine with me (even though it would solve the problem only
for HAMMER, not for other file systems.)

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]