diff options
author | Christoph Hellwig <hch@lst.de> | 2009-08-03 17:28:06 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-09-24 07:47:39 -0400 |
commit | 4fadd7bb20a1e7c774ed88dc703d8fbcd00ff917 (patch) | |
tree | a6f3df6f19d27e81f35a93f8858b73bd4273f420 /fs/super.c | |
parent | 1ba50bbe93ebb98e83b174a85eff76af430c4e5b (diff) |
freeze_bdev: kill bd_mount_sem
Now that we have the freeze count there is not much reason for bd_mount_sem
anymore. The actual freeze/thaw operations are serialized using the
bd_fsfreeze_mutex, and the only other place we take bd_mount_sem is
get_sb_bdev which tries to prevent mounting a filesystem while the block
device is frozen. Instead of add a check for bd_fsfreeze_count and
return -EBUSY if a filesystem is frozen. While that is a change in user
visible behaviour a failing mount is much better for this case rather
than having the mount process stuck uninterruptible for a long time.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/super.c')
-rw-r--r-- | fs/super.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/super.c b/fs/super.c index 4906e2d8f400..1cb26a3e3df0 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -743,9 +743,14 @@ int get_sb_bdev(struct file_system_type *fs_type, | |||
743 | * will protect the lockfs code from trying to start a snapshot | 743 | * will protect the lockfs code from trying to start a snapshot |
744 | * while we are mounting | 744 | * while we are mounting |
745 | */ | 745 | */ |
746 | down(&bdev->bd_mount_sem); | 746 | mutex_lock(&bdev->bd_fsfreeze_mutex); |
747 | if (bdev->bd_fsfreeze_count > 0) { | ||
748 | mutex_unlock(&bdev->bd_fsfreeze_mutex); | ||
749 | error = -EBUSY; | ||
750 | goto error_bdev; | ||
751 | } | ||
747 | s = sget(fs_type, test_bdev_super, set_bdev_super, bdev); | 752 | s = sget(fs_type, test_bdev_super, set_bdev_super, bdev); |
748 | up(&bdev->bd_mount_sem); | 753 | mutex_unlock(&bdev->bd_fsfreeze_mutex); |
749 | if (IS_ERR(s)) | 754 | if (IS_ERR(s)) |
750 | goto error_s; | 755 | goto error_s; |
751 | 756 | ||