aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2013-12-06 06:52:34 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2013-12-13 16:42:03 -0500
commitdfe5b9ad83a63180f358b27d1018649a27b394a9 (patch)
tree0e5f24e72dc8eb3a32de6cedf081ef5e6ae670e7
parent7e3528c3660a2e8602abc7858b0994d611f74bc3 (diff)
GFS2: don't hold s_umount over blkdev_put
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>
-rw-r--r--fs/gfs2/ops_fstype.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 82303b474958..52fa88314f5c 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -1366,8 +1366,18 @@ static struct dentry *gfs2_mount(struct file_system_type *fs_type, int flags,
1366 if (IS_ERR(s)) 1366 if (IS_ERR(s))
1367 goto error_bdev; 1367 goto error_bdev;
1368 1368
1369 if (s->s_root) 1369 if (s->s_root) {
1370 /*
1371 * s_umount nests inside bd_mutex during
1372 * __invalidate_device(). blkdev_put() acquires
1373 * bd_mutex and can't be called under s_umount. Drop
1374 * s_umount temporarily. This is safe as we're
1375 * holding an active reference.
1376 */
1377 up_write(&s->s_umount);
1370 blkdev_put(bdev, mode); 1378 blkdev_put(bdev, mode);
1379 down_write(&s->s_umount);
1380 }
1371 1381
1372 memset(&args, 0, sizeof(args)); 1382 memset(&args, 0, sizeof(args));
1373 args.ar_quota = GFS2_QUOTA_DEFAULT; 1383 args.ar_quota = GFS2_QUOTA_DEFAULT;