Re: [PATCH 2/2] Btrfs-progs: mkfs: make sure we can deal with hard links with -r option

2014-03-13 Thread Wang Shilong
Hi Dave, On 03/13/2014 12:21 AM, David Sterba wrote: On Tue, Mar 11, 2014 at 06:29:09PM +0800, Wang Shilong wrote: @@ -840,6 +833,10 @@ static int traverse_directory(struct btrfs_trans_handle *trans, cur_file->d_name, cur_inum,

Re: [PATCH 2/2] Btrfs-progs: mkfs: make sure we can deal with hard links with -r option

2014-03-12 Thread David Sterba
On Tue, Mar 11, 2014 at 06:29:09PM +0800, Wang Shilong wrote: > @@ -840,6 +833,10 @@ static int traverse_directory(struct btrfs_trans_handle > *trans, > cur_file->d_name, cur_inum, > parent_inum, dir_index_cnt,

[PATCH 2/2] Btrfs-progs: mkfs: make sure we can deal with hard links with -r option

2014-03-11 Thread Wang Shilong
Steps to reproduce: # mkdir -p /tmp/test # touch /tmp/test/file # ln /tmp/test/file /tmp/test/hardlinks # mkfs.btrfs -f /dev/sda13 -r /tmp/test # btrfs check /dev/sda13 To deal with hard link, we must deal with inode with same inode id rather than increase inode id by ourselves. Signed-off-b