]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Fri, 28 Jul 2023 18:15:05 +0000 (14:15 -0400)
committerSasha Levin <sashal@kernel.org>
Fri, 28 Jul 2023 18:15:05 +0000 (14:15 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.10/ext4-fix-to-check-return-value-of-freeze_bdev-in-ext.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/ext4-fix-to-check-return-value-of-freeze_bdev-in-ext.patch b/queue-5.10/ext4-fix-to-check-return-value-of-freeze_bdev-in-ext.patch
new file mode 100644 (file)
index 0000000..9be917e
--- /dev/null
@@ -0,0 +1,48 @@
+From 8b36d501a9d0e80b8f132d8c1c5457ea672a6931 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 6 Jun 2023 15:32:03 +0800
+Subject: ext4: fix to check return value of freeze_bdev() in ext4_shutdown()
+
+From: Chao Yu <chao@kernel.org>
+
+[ 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@kernel.org
+Signed-off-by: Chao Yu <chao@kernel.org>
+Link: https://lore.kernel.org/r/20230606073203.1310389-1-chao@kernel.org
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/ext4/ioctl.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
+index 1171618f6549a..56829507e68c8 100644
+--- a/fs/ext4/ioctl.c
++++ b/fs/ext4/ioctl.c
+@@ -612,6 +612,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;
+@@ -630,7 +631,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;
+-- 
+2.39.2
+
index 093b464233c5d7912976c257972a9172f2efbe8a..8f57e14721ae51068d07e3efffead1e2e0e21d7f 100644 (file)
@@ -19,3 +19,4 @@ drm-ttm-never-consider-pinned-bos-for-eviction-swap.patch
 tracing-show-real-address-for-trace-event-arguments.patch
 pwm-meson-simplify-duplicated-per-channel-tracking.patch
 pwm-meson-fix-handling-of-period-duty-if-greater-tha.patch
+ext4-fix-to-check-return-value-of-freeze_bdev-in-ext.patch