Btrfs: fix wrong send_in_progress accounting
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Tue, 7 Jan 2014 09:25:18 +0000 (17:25 +0800)
committerChris Mason <clm@fb.com>
Tue, 28 Jan 2014 21:20:21 +0000 (13:20 -0800)
commit896c14f97f700aec6565154f2451605d7c5ce3ed
treee06e881dda7ae4ec1329f0ddd4e9be1c201f0bbc
parenta88998f291fc707f18ee42ae45220a3a3e384c27
Btrfs: fix wrong send_in_progress accounting

Steps to reproduce:
 # mkfs.btrfs -f /dev/sda8
 # mount /dev/sda8 /mnt
 # btrfs sub snapshot -r /mnt /mnt/snap1
 # btrfs sub snapshot -r /mnt /mnt/snap2
 # btrfs send /mnt/snap1 -p /mnt/snap2 -f /mnt/1
 # dmesg

The problem is that we will sort clone roots(include @send_root), it
might push @send_root before thus @send_root's @send_in_progress will
be decreased twice.

Cc: David Sterba <dsterba@suse.cz>
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/send.c