bug when moving directories containing hardlinks

I have discovered bug when moving large directory tree containing hardlinks
(well, entire debian installation) from one partition to another. All
files were moved, but some were left behind undeleted (the hardlinks)

How to reproduce:
Assume you have two ext2 partitions mounted on:

And directory /mount2/test does not exist

Now do:
mkdir -p /mount1/test
cd /mount1/test
echo test >test
ln test test2

(ls -li : both files have same inode)

now get in first panel /mount1, in second /mount2
move cursor to "test" directory on first panel and press F6 (and confirm)
the test directory should be moved, but it is only copied and not deleted. The files are copied correctly (in target directory they have same inode, so the hardlink is restored), but the are not deleted in the original directory.

If I press F6 for second time (now destination files exist) and press "yes" on
 overwrite prompt twice, after second prompt I see error message
 "Cannot make the hardlink" (but the files are now moved correctly, target
 correctly overwritten and original deleted)

If the directory contain also normal nonhardlinked files, they seem to be moved correctly (so only the hardlinked files remained when I moved entire installation)
This bug doesn't seem to cause any data loss, but it is somewhat annoying.

The bug was reproduced in current version from CVS from 2:30 20.6.2005

Martin Petricek

Note: no need to CC me, I'm on list

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