Patch "gfs2: Improve gfs2_make_fs_rw error handling" has been added to the 5.10-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    gfs2: Improve gfs2_make_fs_rw error handling

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gfs2-improve-gfs2_make_fs_rw-error-handling.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a44007ffed3e76c6629d206b17920017accb1a9a
Author: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Date:   Tue Jan 31 15:06:53 2023 +0100

    gfs2: Improve gfs2_make_fs_rw error handling
    
    [ Upstream commit b66f723bb552ad59c2acb5d45ea45c890f84498b ]
    
    In gfs2_make_fs_rw(), make sure to call gfs2_consist() to report an
    inconsistency and mark the filesystem as withdrawn when
    gfs2_find_jhead() fails.
    
    At the end of gfs2_make_fs_rw(), when we discover that the filesystem
    has been withdrawn, make sure we report an error.  This also replaces
    the gfs2_withdrawn() check after gfs2_find_jhead().
    
    Reported-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
    Cc: syzbot+f51cb4b9afbd87ec06f2@xxxxxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index d14b98aa1c3eb..5cb7e771b57ab 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -145,8 +145,10 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp)
 		return -EIO;
 
 	error = gfs2_find_jhead(sdp->sd_jdesc, &head, false);
-	if (error || gfs2_withdrawn(sdp))
+	if (error) {
+		gfs2_consist(sdp);
 		return error;
+	}
 
 	if (!(head.lh_flags & GFS2_LOG_HEAD_UNMOUNT)) {
 		gfs2_consist(sdp);
@@ -158,7 +160,9 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp)
 	gfs2_log_pointers_init(sdp, head.lh_blkno);
 
 	error = gfs2_quota_init(sdp);
-	if (!error && !gfs2_withdrawn(sdp))
+	if (!error && gfs2_withdrawn(sdp))
+		error = -EIO;
+	if (!error)
 		set_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
 	return error;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux