projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f3c1c42
)
ext4: fix to check return value of freeze_bdev() in ext4_shutdown()
author
Chao Yu
<chao@kernel.org>
Tue, 6 Jun 2023 07:32:03 +0000
(15:32 +0800)
committer
Theodore Ts'o
<tytso@mit.edu>
Mon, 26 Jun 2023 23:36:44 +0000
(19:36 -0400)
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>
fs/ext4/ioctl.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/ext4/ioctl.c
b/fs/ext4/ioctl.c
index f9a430152063238a8b18d24651a28556192f6ed7..55be1b8a63608ebb23510a8c66001ba13ab03307 100644
(file)
--- a/
fs/ext4/ioctl.c
+++ b/
fs/ext4/ioctl.c
@@
-797,6
+797,7
@@
static int ext4_shutdown(struct super_block *sb, unsigned long arg)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
__u32 flags;
+ int ret;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
@@
-815,7
+816,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 (ret)
+ return ret;
set_bit(EXT4_FLAGS_SHUTDOWN, &sbi->s_ext4_flags);
thaw_bdev(sb->s_bdev);
break;