mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
vfs: add missing blkdev_put() in get_tree_bdev()
Is there are a couple of missing blkdev_put() in get_tree_bdev()? Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
33f37c6488
commit
6fcf0c72e4
@ -1296,6 +1296,7 @@ int get_tree_bdev(struct fs_context *fc,
|
||||
mutex_lock(&bdev->bd_fsfreeze_mutex);
|
||||
if (bdev->bd_fsfreeze_count > 0) {
|
||||
mutex_unlock(&bdev->bd_fsfreeze_mutex);
|
||||
blkdev_put(bdev, mode);
|
||||
warnf(fc, "%pg: Can't mount, blockdev is frozen", bdev);
|
||||
return -EBUSY;
|
||||
}
|
||||
@ -1304,8 +1305,10 @@ int get_tree_bdev(struct fs_context *fc,
|
||||
fc->sget_key = bdev;
|
||||
s = sget_fc(fc, test_bdev_super_fc, set_bdev_super_fc);
|
||||
mutex_unlock(&bdev->bd_fsfreeze_mutex);
|
||||
if (IS_ERR(s))
|
||||
if (IS_ERR(s)) {
|
||||
blkdev_put(bdev, mode);
|
||||
return PTR_ERR(s);
|
||||
}
|
||||
|
||||
if (s->s_root) {
|
||||
/* Don't summarily change the RO/RW state. */
|
||||
|
Loading…
Reference in New Issue
Block a user