DragonFly kernel List (threaded) for 2008-04
Re: Need ideas on how to solve an st_ino/st_dev test issue for HAMMER.
Matthew Dillon <firstname.lastname@example.org> 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
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.)
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