diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2013-12-06 06:52:34 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-09 15:24:24 -0500 |
commit | 21b6291b88c534d8c6018ad483e232abab63f644 (patch) | |
tree | 6cf128a2222ee6b9899634948ad0a5ad43e7f9af | |
parent | 2d8ccbd72d8e44d40daa7500a5a78cc8ccad02f1 (diff) |
GFS2: don't hold s_umount over blkdev_put
commit dfe5b9ad83a63180f358b27d1018649a27b394a9 upstream.
This is a GFS2 version of Tejun's patch:
4f331f01b9c43bf001d3ffee578a97a1e0633eac
vfs: don't hold s_umount over close_bdev_exclusive() call
In this case its blkdev_put itself that is the issue and this
patch uses the same solution of dropping and retaking s_umount.
Reported-by: Tejun Heo <tj@kernel.org>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/gfs2/ops_fstype.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 60ede2a0f43f..f7dd3b4f8ab0 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -1317,8 +1317,18 @@ static struct dentry *gfs2_mount(struct file_system_type *fs_type, int flags, | |||
1317 | if (IS_ERR(s)) | 1317 | if (IS_ERR(s)) |
1318 | goto error_bdev; | 1318 | goto error_bdev; |
1319 | 1319 | ||
1320 | if (s->s_root) | 1320 | if (s->s_root) { |
1321 | /* | ||
1322 | * s_umount nests inside bd_mutex during | ||
1323 | * __invalidate_device(). blkdev_put() acquires | ||
1324 | * bd_mutex and can't be called under s_umount. Drop | ||
1325 | * s_umount temporarily. This is safe as we're | ||
1326 | * holding an active reference. | ||
1327 | */ | ||
1328 | up_write(&s->s_umount); | ||
1321 | blkdev_put(bdev, mode); | 1329 | blkdev_put(bdev, mode); |
1330 | down_write(&s->s_umount); | ||
1331 | } | ||
1322 | 1332 | ||
1323 | memset(&args, 0, sizeof(args)); | 1333 | memset(&args, 0, sizeof(args)); |
1324 | args.ar_quota = GFS2_QUOTA_DEFAULT; | 1334 | args.ar_quota = GFS2_QUOTA_DEFAULT; |