Skip to content

Commit 997198b

Browse files
Pierre Morelaxboe
Pierre Morel
authored andcommitted
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 <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Signed-off-by: Pierre Morel <[email protected]> Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 1a6fe74 commit 997198b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/block_dev.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,11 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb)
299299
error = sb->s_op->thaw_super(sb);
300300
else
301301
error = thaw_super(sb);
302-
if (error) {
302+
if (error)
303303
bdev->bd_fsfreeze_count++;
304-
mutex_unlock(&bdev->bd_fsfreeze_mutex);
305-
return error;
306-
}
307304
out:
308305
mutex_unlock(&bdev->bd_fsfreeze_mutex);
309-
return 0;
306+
return error;
310307
}
311308
EXPORT_SYMBOL(thaw_bdev);
312309

0 commit comments

Comments
 (0)