* [PATCH] Btrfs: allow running defrag in parallel to administrative tasks
@ 2013-03-04 17:28 Stefan Behrens
2013-03-05 2:51 ` Liu Bo
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Behrens @ 2013-03-04 17:28 UTC (permalink / raw)
To: linux-btrfs
Commit 5ac00add added a testnset mutex and code that disallows
running administrative tasks in parallel. It is prevented that
the device add/delete/balance/replace/resize operations are
started in parallel. By mistake, the defragmentation operation
was included in the check for mutually exclusiveness as well.
This is fixed with this commit.
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
---
fs/btrfs/ioctl.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index b908960..40631cf 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2245,13 +2245,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
if (ret)
return ret;
- if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
- 1)) {
- pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n");
- mnt_drop_write_file(file);
- return -EINVAL;
- }
-
if (btrfs_root_readonly(root)) {
ret = -EROFS;
goto out;
@@ -2306,7 +2299,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
ret = -EINVAL;
}
out:
- atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0);
mnt_drop_write_file(file);
return ret;
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Btrfs: allow running defrag in parallel to administrative tasks
2013-03-04 17:28 [PATCH] Btrfs: allow running defrag in parallel to administrative tasks Stefan Behrens
@ 2013-03-05 2:51 ` Liu Bo
0 siblings, 0 replies; 2+ messages in thread
From: Liu Bo @ 2013-03-05 2:51 UTC (permalink / raw)
To: Stefan Behrens; +Cc: linux-btrfs
On Mon, Mar 04, 2013 at 06:28:38PM +0100, Stefan Behrens wrote:
> Commit 5ac00add added a testnset mutex and code that disallows
> running administrative tasks in parallel. It is prevented that
> the device add/delete/balance/replace/resize operations are
> started in parallel. By mistake, the defragmentation operation
> was included in the check for mutually exclusiveness as well.
> This is fixed with this commit.
>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
> Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
> ---
> fs/btrfs/ioctl.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index b908960..40631cf 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -2245,13 +2245,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
> if (ret)
> return ret;
>
> - if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
> - 1)) {
> - pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n");
> - mnt_drop_write_file(file);
> - return -EINVAL;
> - }
> -
> if (btrfs_root_readonly(root)) {
> ret = -EROFS;
> goto out;
> @@ -2306,7 +2299,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
> ret = -EINVAL;
> }
> out:
> - atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0);
> mnt_drop_write_file(file);
> return ret;
> }
> --
> 1.8.1.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-05 2:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-04 17:28 [PATCH] Btrfs: allow running defrag in parallel to administrative tasks Stefan Behrens
2013-03-05 2:51 ` Liu Bo
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).