linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] btrfs-progs: subvol: fix del --commit-after
@ 2017-09-27  2:00 Misono, Tomohiro
  2017-09-27  2:01 ` [PATCH v2 1/5] btrfs-progs: subvol: exchange subvol del --commit-after and --commit-each Misono, Tomohiro
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Misono, Tomohiro @ 2017-09-27  2:00 UTC (permalink / raw)
  To: linux-btrfs

Fix subvol del --commit-after to work properly:
 - SYNC ioctl will be issued even when last delete is failed
 - SYNC ioctl will be issued on each file system only once in the end

To achieve this, each deleted subvol's (parent's) fsid is checked each
time. If the fsid is seen for the first time, its fd will be kept in order
to issue SYNC ioctl in the end.

There already exists get_fsid() in cmds-property.c and seen_fsid which
keeps fsid in hush function in cmds-filesystem.c. This patch utilizes
them.

First patch is the independent but critical. Current code is reversed in
--commit-after and --commit-each operation. i.e. --commit-after means
--commit-each actually. The patch fix this.

2rd to 4th patches make functions stated above to common and last one is
the main part.

Thanks Qu for reviewing whole patches.

change to v2:
	split the cleanup part of 4th patch and make it the independent patch
	(1st patch in new series).

Tomohiro Misono (5):
  btrfs-progs: subvol: exchange subvol del --commit-after and --commit-each
  btrfs-progs: move get_fsid() to util.c
  btrfs-progs: move seen_fsid to util.c
  btrfs-progs: change seen_fsid to hold fd and DIR*
  btrfs-progs: subvol: fix subvol del --commit-after

 cmds-filesystem.c |  88 +++------------------------------------------
 cmds-property.c   |  30 ----------------
 cmds-subvolume.c  |  72 +++++++++++++++++++++++++++----------
 utils.c           | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 utils.h           |  15 ++++++++
 5 files changed, 179 insertions(+), 131 deletions(-)

-- 
2.9.5


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-09-27 15:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-27  2:00 [PATCH v2 0/5] btrfs-progs: subvol: fix del --commit-after Misono, Tomohiro
2017-09-27  2:01 ` [PATCH v2 1/5] btrfs-progs: subvol: exchange subvol del --commit-after and --commit-each Misono, Tomohiro
2017-09-27  2:01 ` [PATCH v2 2/5] btrfs-progs: move get_fsid() to util.c Misono, Tomohiro
2017-09-27  2:02 ` [PATCH v2 3/5] btrfs-progs: move seen_fsid " Misono, Tomohiro
2017-09-27  2:02 ` [PATCH v2 4/5] btrfs-progs: change seen_fsid to hold fd and DIR* Misono, Tomohiro
2017-09-27  2:03 ` [PATCH v2 5/5] btrfs-progs: subvol: fix subvol del --commit-after Misono, Tomohiro
2017-09-27 15:03   ` David Sterba
2017-09-27 15:08 ` [PATCH v2 0/5] btrfs-progs: subvol: fix " David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).