Patch "ext4: fix to check return value of freeze_bdev() in ext4_shutdown()" has been added to the 5.4-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

    ext4: fix to check return value of freeze_bdev() in ext4_shutdown()

to the 5.4-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:
     ext4-fix-to-check-return-value-of-freeze_bdev-in-ext.patch
and it can be found in the queue-5.4 subdirectory.

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



commit f57a8f631e8d1f9c711b2f421293506c2500f1a6
Author: Chao Yu <chao@xxxxxxxxxx>
Date:   Tue Jun 6 15:32:03 2023 +0800

    ext4: fix to check return value of freeze_bdev() in ext4_shutdown()
    
    [ Upstream commit c4d13222afd8a64bf11bc7ec68645496ee8b54b9 ]
    
    freeze_bdev() can fail due to a lot of reasons, it needs to check its
    reason before later process.
    
    Fixes: 783d94854499 ("ext4: add EXT4_IOC_GOINGDOWN ioctl")
    Cc: stable@xxxxxxxxxx
    Signed-off-by: Chao Yu <chao@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230606073203.1310389-1-chao@xxxxxxxxxx
    Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 306ad7d0003bb..ae47505964c4b 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -573,6 +573,7 @@ static int ext4_shutdown(struct super_block *sb, unsigned long arg)
 {
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
 	__u32 flags;
+	struct super_block *ret;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
@@ -591,7 +592,9 @@ static int ext4_shutdown(struct super_block *sb, unsigned long arg)
 
 	switch (flags) {
 	case EXT4_GOING_FLAGS_DEFAULT:
-		freeze_bdev(sb->s_bdev);
+		ret = freeze_bdev(sb->s_bdev);
+		if (IS_ERR(ret))
+			return PTR_ERR(ret);
 		set_bit(EXT4_FLAGS_SHUTDOWN, &sbi->s_ext4_flags);
 		thaw_bdev(sb->s_bdev, sb);
 		break;



[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