btrfs-progs: subvol: fix subvol del --commit-after
authorMisono, Tomohiro <misono.tomohiro@jp.fujitsu.com>
Wed, 27 Sep 2017 02:03:48 +0000 (11:03 +0900)
committerDavid Sterba <dsterba@suse.com>
Fri, 6 Oct 2017 11:23:31 +0000 (13:23 +0200)
commit8d93d71f6aa521e0a3e078d2c4ab2c406ebd884c
treef20a40e8bd130e4daeeb33b2d790381ff06f607e
parent26908f61461c1897198b457a76856c78e849153f
btrfs-progs: subvol: fix subvol del --commit-after

Fix 'subvolume delete --commit-after' to work properly:
- SYNC ioctl will be issued even when last delete fails
- SYNC ioctl will be issued on each file system only once in the end

To achieve this, get_fsid() and add_seen_fsid() are called after each
delete to keep only one fd for each fs.

In the end, seen_fsid_hash will be traversed and SYNC is issued on each
fs.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-subvolume.c