diff options
-rw-r--r-- | fs/block_dev.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 73d6a735b8f3..d11d0289f3d2 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -246,7 +246,8 @@ struct super_block *freeze_bdev(struct block_device *bdev) | |||
246 | if (!sb) | 246 | if (!sb) |
247 | goto out; | 247 | goto out; |
248 | if (sb->s_flags & MS_RDONLY) { | 248 | if (sb->s_flags & MS_RDONLY) { |
249 | deactivate_locked_super(sb); | 249 | sb->s_frozen = SB_FREEZE_TRANS; |
250 | up_write(&sb->s_umount); | ||
250 | mutex_unlock(&bdev->bd_fsfreeze_mutex); | 251 | mutex_unlock(&bdev->bd_fsfreeze_mutex); |
251 | return sb; | 252 | return sb; |
252 | } | 253 | } |
@@ -307,7 +308,7 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb) | |||
307 | BUG_ON(sb->s_bdev != bdev); | 308 | BUG_ON(sb->s_bdev != bdev); |
308 | down_write(&sb->s_umount); | 309 | down_write(&sb->s_umount); |
309 | if (sb->s_flags & MS_RDONLY) | 310 | if (sb->s_flags & MS_RDONLY) |
310 | goto out_deactivate; | 311 | goto out_unfrozen; |
311 | 312 | ||
312 | if (sb->s_op->unfreeze_fs) { | 313 | if (sb->s_op->unfreeze_fs) { |
313 | error = sb->s_op->unfreeze_fs(sb); | 314 | error = sb->s_op->unfreeze_fs(sb); |
@@ -321,11 +322,11 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb) | |||
321 | } | 322 | } |
322 | } | 323 | } |
323 | 324 | ||
325 | out_unfrozen: | ||
324 | sb->s_frozen = SB_UNFROZEN; | 326 | sb->s_frozen = SB_UNFROZEN; |
325 | smp_wmb(); | 327 | smp_wmb(); |
326 | wake_up(&sb->s_wait_unfrozen); | 328 | wake_up(&sb->s_wait_unfrozen); |
327 | 329 | ||
328 | out_deactivate: | ||
329 | if (sb) | 330 | if (sb) |
330 | deactivate_locked_super(sb); | 331 | deactivate_locked_super(sb); |
331 | out_unlock: | 332 | out_unlock: |