Re: Finding hardlinks

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Miklos Szeredi
Date: Monday, January 8, 2007 - 1:49 am

> >> No one guarantees you sane result of tar or cp -a while changing the tree.

  - /a/p/x and /a/q/x are links to the same file

  - /b/y and /a/q/y are links to the same file

  - tar is running on /a

  - meanwhile the following commands are executed:

     mv /a/p/x /b/x
     mv /b/y /a/p/x

With st_ino checking you'll get a perfectly consistent archive,
regardless of the timing.  With samefile() you could get an archive
where the data in /a/q/y is not stored, instead it will contain the
data of /a/q/x.

Note, this is far nastier than the "normal" corruption you usually get
with changing the tree under tar, the file is not just duplicated or
missing, it becomes a completely different file, even though it hasn't
been touched at all during the archiving.

The basic problem with samefile() is that it can only compare files at
a single snapshot in time, and cannot take into account any changes in
the tree (unless keeping files open, which is impractical).

There's really no point trying to push for such an inferior interface
when the problems which samefile is trying to address are purely
theoretical.

Currently linux is living with 32bit st_ino because of legacy apps,
and people are not constantly agonizing about it.  Fixing the
EOVERFLOW problem will enable filesystems to slowly move towards 64bit
st_ino, which should be more than enough.

Miklos
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Finding hardlinks, Pavel Machek, (Tue Jan 2, 12:15 pm)
Re: Finding hardlinks, Miklos Szeredi, (Tue Jan 2, 1:41 pm)
Re: Finding hardlinks, Mikulas Patocka, (Tue Jan 2, 1:50 pm)
Re: Finding hardlinks, Miklos Szeredi, (Tue Jan 2, 2:10 pm)
Re: Finding hardlinks, Mikulas Patocka, (Tue Jan 2, 2:37 pm)
Re: Finding hardlinks, Pavel Machek, (Wed Jan 3, 4:56 am)
Re: Finding hardlinks, Miklos Szeredi, (Wed Jan 3, 5:33 am)
Re: Finding hardlinks, Pavel Machek, (Wed Jan 3, 5:42 am)
Re: Finding hardlinks, Martin Mares, (Wed Jan 3, 5:45 am)
Re: Finding hardlinks, Matthew Wilcox, (Wed Jan 3, 6:54 am)
Re: Finding hardlinks, Miklos Szeredi, (Wed Jan 3, 8:51 am)
Re: Finding hardlinks, Mikulas Patocka, (Wed Jan 3, 12:04 pm)
Re: Finding hardlinks, Pavel Machek, (Thu Jan 4, 3:59 pm)
Re: Finding hardlinks, Miklos Szeredi, (Fri Jan 5, 1:43 am)
Re: Finding hardlinks, Pavel Machek, (Fri Jan 5, 6:12 am)
Re: Finding hardlinks, Miklos Szeredi, (Fri Jan 5, 6:55 am)
Re: Finding hardlinks, Mikulas Patocka, (Fri Jan 5, 7:08 am)
Re: Finding hardlinks, Miklos Szeredi, (Fri Jan 5, 8:09 am)
Re: Finding hardlinks, Miklos Szeredi, (Fri Jan 5, 8:15 am)
Re: Finding hardlinks, Frank van Maarseveen, (Fri Jan 5, 10:30 am)
Re: Finding hardlinks, Mikulas Patocka, (Sun Jan 7, 10:57 pm)
Re: Finding hardlinks, Miklos Szeredi, (Mon Jan 8, 1:49 am)
Re: Finding hardlinks, Pavel Machek, (Mon Jan 8, 4:27 am)
Re: Finding hardlinks, Pavel Machek, (Mon Jan 8, 4:29 am)
Re: Finding hardlinks, Miklos Szeredi, (Mon Jan 8, 5:00 am)
Re: Finding hardlinks, Martin Mares, (Mon Jan 8, 6:26 am)
Re: Finding hardlinks, Miklos Szeredi, (Mon Jan 8, 6:39 am)
Re: Finding hardlinks, Steven Rostedt, (Tue Jan 9, 9:26 am)
Re: Finding hardlinks, Frank van Maarseveen, (Tue Jan 9, 12:53 pm)
Re: Finding hardlinks, Steven Rostedt, (Tue Jan 9, 1:11 pm)
Re: Finding hardlinks, Pádraig Brady, (Thu Jan 11, 3:07 am)
Re: Finding hardlinks, Denis Vlasenko, (Thu Jan 11, 4:43 pm)