[Devel] [PATCH rh7 2/4] fs: fix thaw_bdev return value in case bdev is not frozen

Vladimir Davydov vdavydov at virtuozzo.com
Tue Jul 12 03:04:37 PDT 2016


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 <vdavydov at virtuozzo.com>
---
 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



More information about the Devel mailing list