Skip to content

Commit

Permalink
fs/block_dev.c: return the right error in thaw_bdev()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pierre Morel authored and axboe committed Oct 5, 2016
1 parent 1a6fe74 commit 997198b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 997198b

Please sign in to comment.