Btrfs-progs: mkfs: make sure we can deal with hard links with -r option
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Tue, 11 Mar 2014 10:29:09 +0000 (18:29 +0800)
committerChris Mason <clm@fb.com>
Fri, 21 Mar 2014 16:51:31 +0000 (09:51 -0700)
commita2524a784dbf0ad270169292a7a3f181d3884f61
treec23b84129baf38a36d5864e66d58b4f43b1b0ee7
parent3bb703dcaec52b187526e5a0a5faf145ab18a716
Btrfs-progs: mkfs: make sure we can deal with hard links with -r option

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-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
mkfs.c