Patch "gfs2: report "already frozen/thawed" errors" has been added to the 5.11-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: report "already frozen/thawed" errors

to the 5.11-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-report-already-frozen-thawed-errors.patch
and it can be found in the queue-5.11 subdirectory.

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



commit 2232a665e455e0479b7adb8616ccb6d94a3ac273
Author: Bob Peterson <rpeterso@xxxxxxxxxx>
Date:   Thu Mar 25 08:51:13 2021 -0400

    gfs2: report "already frozen/thawed" errors
    
    [ Upstream commit ff132c5f93c06bd4432bbab5c369e468653bdec4 ]
    
    Before this patch, gfs2's freeze function failed to report an error
    when the target file system was already frozen as it should (and as
    generic vfs function freeze_super does. Similarly, gfs2's thaw function
    failed to report an error when trying to thaw a file system that is not
    frozen, as vfs function thaw_super does. The errors were checked, but
    it always returned a 0 return code.
    
    This patch adds the missing error return codes to gfs2 freeze and thaw.
    
    Signed-off-by: Bob Peterson <rpeterso@xxxxxxxxxx>
    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 34ca312457a6..223ebd6b1b8d 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -767,11 +767,13 @@ void gfs2_freeze_func(struct work_struct *work)
 static int gfs2_freeze(struct super_block *sb)
 {
 	struct gfs2_sbd *sdp = sb->s_fs_info;
-	int error = 0;
+	int error;
 
 	mutex_lock(&sdp->sd_freeze_mutex);
-	if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN)
+	if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN) {
+		error = -EBUSY;
 		goto out;
+	}
 
 	for (;;) {
 		if (gfs2_withdrawn(sdp)) {
@@ -812,10 +814,10 @@ static int gfs2_unfreeze(struct super_block *sb)
 	struct gfs2_sbd *sdp = sb->s_fs_info;
 
 	mutex_lock(&sdp->sd_freeze_mutex);
-        if (atomic_read(&sdp->sd_freeze_state) != SFS_FROZEN ||
+	if (atomic_read(&sdp->sd_freeze_state) != SFS_FROZEN ||
 	    !gfs2_holder_initialized(&sdp->sd_freeze_gh)) {
 		mutex_unlock(&sdp->sd_freeze_mutex);
-                return 0;
+		return -EINVAL;
 	}
 
 	gfs2_freeze_unlock(&sdp->sd_freeze_gh);



[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