We should return -EINVAL in this case, but instead return 0.
Also, remove a duplicate code block, while we're here.

Signed-off-by: Vladimir Davydov <[email protected]>
---
 fs/block_dev.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 325ee7161fbf..0310d6402cf5 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -274,14 +274,11 @@ int thaw_bdev(struct block_device *bdev, struct 
super_block *sb)
                goto out;
 
        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);
 
-- 
2.1.4

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to