summaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorPierre Morel <pmorel@linux.vnet.ibm.com>2016-10-04 10:53:40 +0200
committerJens Axboe <axboe@fb.com>2016-10-05 14:35:13 -0600
commit997198ba1ed691c09457120576c27dbd953d0557 (patch)
tree142a251ae87c22234e8180f597e08dcb58d51ea3 /fs/block_dev.c
parent1a6fe74dfd1bb10afb41cbbbdc14890604be42a6 (diff)
downloadlinux-997198ba1ed691c09457120576c27dbd953d0557.tar.bz2
fs/block_dev.c: return the right error in thaw_bdev()
When triggering thaw-filesystems via magic sysrq, the system enters a loop in do_thaw_one(), as thaw_bdev() still returns success if bd_fsfreeze_count == 0. To fix this, let thaw_bdev() always return error (and simplify the code a bit at the same time). Reviewed-by: Eric Farman <farman@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index a516568f63b6..376e4e426324 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -299,14 +299,11 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb)
error = sb->s_op->thaw_super(sb);
else
error = thaw_super(sb);
- if (error) {
+ if (error)
bdev->bd_fsfreeze_count++;
- mutex_unlock(&bdev->bd_fsfreeze_mutex);
- return error;
- }
out:
mutex_unlock(&bdev->bd_fsfreeze_mutex);
- return 0;
+ return error;
}
EXPORT_SYMBOL(thaw_bdev);