lkml.org 
[lkml]   [2007]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Finding hardlinks
Hi!

> > > > Some of us have machines designed to cope with cosmic rays, and would be
> > > > unimpressed with a decrease in reliability.
> > >
> > > With the suggested samefile() interface you'd get a failure with just
> > > about 100% reliability for any application which needs to compare a
> > > more than a few files. The fact is open files are _very_ expensive,
> > > no wonder they are limited in various ways.
> > >
> > > What should 'tar' do when it runs out of open files, while searching
> > > for hardlinks? Should it just give up? Then the samefile() interface
> > > would be _less_ reliable than the st_ino one by a significant margin.
> >
> > You need at most two simultenaously open files for examining any
> > number of hardlinks. So yes, you can make it reliable.
>
> Well, sort of. Samefile without keeping fds open doesn't have any
> protection against the tree changing underneath between first
> registering a file and later opening it. The inode number is more

You only need to keep one-file-per-hardlink-group open during final
verification, checking that inode hashing produced reasonable results.

Pavel
--
Thanks for all the (sleeping) penguins.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-01-05 14:15    [W:0.105 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site