[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH] dm: fix freeze_bdev() return value check



freeze_bdev() does not return errno as pointer on failure.
This patch fixes the return value check.

Signed-off-by: Akinobu Mita <akinobu mita gmail com>

---
 drivers/md/dm.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Index: 2.6-git/drivers/md/dm.c
===================================================================
--- 2.6-git.orig/drivers/md/dm.c
+++ 2.6-git/drivers/md/dm.c
@@ -1290,16 +1290,11 @@ out:
  */
 static int lock_fs(struct mapped_device *md)
 {
-	int r;
-
 	WARN_ON(md->frozen_sb);
 
 	md->frozen_sb = freeze_bdev(md->suspended_bdev);
-	if (IS_ERR(md->frozen_sb)) {
-		r = PTR_ERR(md->frozen_sb);
-		md->frozen_sb = NULL;
-		return r;
-	}
+	if (!md->frozen_sb)
+		return -ENODEV;
 
 	set_bit(DMF_FROZEN, &md->flags);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]