Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-12-12 Thread David Sterba
On Tue, Dec 10, 2013 at 01:24:13PM -0500, Chris Mason wrote: > > It is there, 'btrfs subvol list -d /path', but I'd rather not let > > everybody parse output the output for a simple check. > > Aha ;) Yeah, that's what I was thinking. It's possible to find but hard > enough that nobody would be ha

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-12-10 Thread Chris Mason
Quoting David Sterba (2013-12-10 12:36:28) > On Tue, Dec 10, 2013 at 08:17:07AM -0500, Chris Mason wrote: > > Quoting David Sterba (2013-12-09 18:32:45) > > > On Mon, Dec 02, 2013 at 05:02:49PM +0800, Wang Shilong wrote: > > > > >So an enahced interface could look like this: > > > > > > > > > >subv

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-12-10 Thread David Sterba
On Tue, Dec 10, 2013 at 08:17:07AM -0500, Chris Mason wrote: > Quoting David Sterba (2013-12-09 18:32:45) > > On Mon, Dec 02, 2013 at 05:02:49PM +0800, Wang Shilong wrote: > > > >So an enahced interface could look like this: > > > > > > > >subvol delete: > > > >--commit-each - run the ioc sync/wait

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-12-10 Thread Chris Mason
Quoting David Sterba (2013-12-09 18:32:45) > On Mon, Dec 02, 2013 at 05:02:49PM +0800, Wang Shilong wrote: > > >So an enahced interface could look like this: > > > > > >subvol delete: > > >--commit-each - run the ioc sync/wait ioctl after each delete ioctl > > >--commit-after - dtto but sync/wait a

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-12-09 Thread David Sterba
On Mon, Dec 02, 2013 at 05:02:49PM +0800, Wang Shilong wrote: > >So an enahced interface could look like this: > > > >subvol delete: > >--commit-each - run the ioc sync/wait ioctl after each delete ioctl > >--commit-after - dtto but sync/wait after all are deleted > >--wait-for-cleanup - wait until

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-12-02 Thread Wang Shilong
Hi Dave, On 11/30/2013 01:37 AM, David Sterba wrote: On Fri, Nov 29, 2013 at 10:04:35AM +0800, Wang Shilong wrote: Subvolume deletion does not do a full transaction commit. This can lead to an unexpected result when the system crashes between deletion and commit, the subvolume directory will ap

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-11-29 Thread David Sterba
On Fri, Nov 29, 2013 at 10:04:35AM +0800, Wang Shilong wrote: > >>Subvolume deletion does not do a full transaction commit. This can lead > >>to an unexpected result when the system crashes between deletion and > >>commit, the subvolume directory will appear again. Add options to request > >>filesy

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-11-29 Thread David Sterba
On Fri, Nov 29, 2013 at 01:13:43PM +0800, Miao Xie wrote: > > static int cmd_subvol_delete(int argc, char **argv) > > { > > - int res, fd, len, e, cnt = 1, ret = 0; > > + int res, len, e, ret = 0; > > + int cnt; > > + int fd = -1; > > struct btrfs_ioctl_vol_args args; > >

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-11-29 Thread Anand Jain
If the command with sync option finishes succesfully, the subvolume(s) deletion status is safely stored on the media. + if (sync_mode == 1) { + res = ioctl(fd, BTRFS_IOC_SYNC); + if (res < 0) { + fprintf(stderr, +

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-11-28 Thread Miao Xie
On thu, 28 Nov 2013 17:59:07 +0100, David Sterba wrote: > Subvolume deletion does not do a full transaction commit. This can lead > to an unexpected result when the system crashes between deletion and > commit, the subvolume directory will appear again. Add options to request > filesystem sync

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-11-28 Thread Wang Shilong
On 11/29/2013 03:36 AM, Roman Mamedov wrote: On Thu, 28 Nov 2013 17:59:07 +0100 David Sterba wrote: Subvolume deletion does not do a full transaction commit. This can lead to an unexpected result when the system crashes between deletion and commit, the subvolume directory will appear again. Ad

Re: [PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-11-28 Thread Roman Mamedov
On Thu, 28 Nov 2013 17:59:07 +0100 David Sterba wrote: > Subvolume deletion does not do a full transaction commit. This can lead > to an unexpected result when the system crashes between deletion and > commit, the subvolume directory will appear again. Add options to request > filesystem sync aft

[PATCH] btrfs-progs: add options to sync filesystem after subvol delete

2013-11-28 Thread David Sterba
Subvolume deletion does not do a full transaction commit. This can lead to an unexpected result when the system crashes between deletion and commit, the subvolume directory will appear again. Add options to request filesystem sync after each deleted subvolume or after the last one. If the command