Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1495300

[PATCH] fs/block_dev.c: return the right error in thaw_bdev()

From Pierre Morel <pmorel@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH] fs/block_dev.c: return the right error in thaw_bdev()
Date 2016-10-04 11:00 +0200
Message-ID <sotJT-lb-9@gated-at.bofh.it> (permalink)
References <sotJT-lb-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 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 08ae993..0e7a8f4 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -302,14 +302,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);
 
-- 
2.5.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] return the right error in thaw_bdev() Pierre Morel <pmorel@linux.vnet.ibm.com> - 2016-10-04 11:00 +0200
  [PATCH] fs/block_dev.c: return the right error in thaw_bdev() Pierre Morel <pmorel@linux.vnet.ibm.com> - 2016-10-04 11:00 +0200
    Re: [PATCH] fs/block_dev.c: return the right error in thaw_bdev() Jan Kara <jack@suse.cz> - 2016-10-04 11:10 +0200
      Re: [PATCH] fs/block_dev.c: return the right error in thaw_bdev() Mateusz Guzik <mguzik@redhat.com> - 2016-10-05 08:50 +0200
        Re: [PATCH] fs/block_dev.c: return the right error in thaw_bdev() Jan Kara <jack@suse.cz> - 2016-10-05 12:00 +0200
          Re: [PATCH] fs/block_dev.c: return the right error in thaw_bdev() Dave Chinner <david@fromorbit.com> - 2016-10-05 22:30 +0200

csiph-web