Miao Xie
2012-Dec-21 09:19 UTC
[PATCH 1/3] Btrfs: fix missing write access release in btrfs_ioctl_resize()
We forget to give up the write access after we find some device operation
is going on. Fix it.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
fs/btrfs/ioctl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 7624212..679b82c 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1338,7 +1338,9 @@ static noinline int btrfs_ioctl_resize(struct file *file,
if
(atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
1)) {
- pr_info("btrfs: dev add/delete/balance/replace/resize operation in
progress\n");
+ pr_info("btrfs: dev add/delete/balance/replace/resize operation"
+ " in progress\n");
+ mnt_drop_write_file(file);
return -EINPROGRESS;
}
--
1.7.11.7
--
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
Stefan Behrens
2012-Dec-21 10:22 UTC
Re: [PATCH 1/3] Btrfs: fix missing write access release in btrfs_ioctl_resize()
On Fri, 21 Dec 2012 17:19:20 +0800, Miao Xie wrote:> - pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n"); > + pr_info("btrfs: dev add/delete/balance/replace/resize operation" > + " in progress\n"); > + mnt_drop_write_file(file);grep and vi cannot do searches spanning multiple lines. That''s why I created this pr_info() line with more than 80 columns (in accordance with Documentation/CodingStyle BTW ("never break user-visible strings")). -- 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
Miao Xie
2012-Dec-21 10:35 UTC
Re: [PATCH 1/3] Btrfs: fix missing write access release in btrfs_ioctl_resize()
On Fri, 21 Dec 2012 11:22:52 +0100, Stefan Behrens wrote:> On Fri, 21 Dec 2012 17:19:20 +0800, Miao Xie wrote: >> - pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n"); >> + pr_info("btrfs: dev add/delete/balance/replace/resize operation" >> + " in progress\n"); >> + mnt_drop_write_file(file); > > grep and vi cannot do searches spanning multiple lines. That''s why I > created this pr_info() line with more than 80 columns (in accordance > with Documentation/CodingStyle BTW ("never break user-visible strings")). >You are right. I will update the patch soon. Thanks Miao -- 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
Miao Xie
2012-Dec-21 10:38 UTC
[PATCH V2 1/3] Btrfs: fix missing write access release in btrfs_ioctl_resize()
We forget to give up the write access after we find some device operation
is going on. Fix it.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
Changelog v1 -> v2:
- don''t break the string
---
fs/btrfs/ioctl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 7624212..d6f43fa 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1339,6 +1339,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
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 -EINPROGRESS;
}
--
1.7.11.7
--
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