bugrdiff-backup - Bugs: bug #13476, hardlink problem when devloc...

 
 

bug #13476: hardlink problem when devloc changes but inode doesn't

Submitter:  dean gaudet <dgaudet>
Submitted:  Mon 20 Jun 2005 01:25:57 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  dgaudet
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 20 Jun 2005 01:25:57 AM UTC, original submission:  

this problem occurs when you have a pair of hardlinked files, which have been backed up at least once.  then you modify the file and change the devloc without changing the inode.

this sort of thing can happen when you move the disk to another controller -- in my case it was happenning regularly because i was using LVM snapshot volumes and the snapshot device number is not fixed from one backup to the next.

here is a script which demonstrates the problem on linux using an ext2 image file, sudo, and two different loopback devices.

mkdir src || exit 1
dd if=/dev/zero of=src.img bs=1M count=2 || exit 1
mke2fs -qF -m 0 src.img || exit 1
sudo mount -o loop=/dev/loop3 src.img src || exit 1
echo hi >src/a || exit 1
ln src/a src/b || exit 1
rdiff-backup src dst || exit 1
sudo umount src
sudo mount -o loop=/dev/loop4 src.img src || exit 1
mv src/b src/c || exit 1
sleep 1; rdiff-backup src dst || exit 1
sleep 1; rdiff-backup src dst || exit 1
sudo umount src || exit 1

the second invocation of rdiff-backup produces a broken metadata file with two different DeviceLoc for the hardlinked files.  the third (and any subsequent invocations) produce a bogus warning, but the problem is never resolved:

Warning: Attempt to rename over same inode: dst/rdiff-backup.tmp.1 to dst/c

i believe the fix is to treat devloc similar to inode in RORPath.__eq__ ... we're ignoring devloc currently, and that is broken... you can't compare inodes without comparing devices.  the attached patch implements this idea.

-dean

dean gaudet <dgaudet>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #3108:  hardlink2.patch added by dgaudet (1KiB - text/x-patch - proposed fix)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-06-28 dgaudet Assigned toNone dgaudet
    Open/ClosedOpen Closed
2005-06-28 dgaudet StatusNone Fixed
2005-06-20 dgaudet Attached File- Added hardlink2.patch, #2616

Back to the top

Powered by Savane 3.13-bb6a.
Corresponding source code