diff options
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 | ||