summaryrefslogtreecommitdiff
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-06-01 12:44:58 +0300
committerJens Axboe <axboe@kernel.dk>2023-06-05 19:53:04 +0300
commitf5db130d4443ddf63b49e195782038ebaab0bec9 (patch)
tree755835f972c1a69530ad91ae905072c0b45ce91a /fs/ext4/super.c
parent97524b454bc562f4052751f0e635a61dad78f1b2 (diff)
downloadlinux-f5db130d4443ddf63b49e195782038ebaab0bec9.tar.xz
ext4: wire up sops->shutdown
Wire up the shutdown method to shut down the file system when the underlying block device is marked dead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Acked-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Link: https://lore.kernel.org/r/20230601094459.1350643-16-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 865625089ecc..a177a16c4d2f 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1450,6 +1450,11 @@ static void ext4_destroy_inode(struct inode *inode)
EXT4_I(inode)->i_reserved_data_blocks);
}
+static void ext4_shutdown(struct super_block *sb)
+{
+ ext4_force_shutdown(sb, EXT4_GOING_FLAGS_NOLOGFLUSH);
+}
+
static void init_once(void *foo)
{
struct ext4_inode_info *ei = foo;
@@ -1610,6 +1615,7 @@ static const struct super_operations ext4_sops = {
.unfreeze_fs = ext4_unfreeze,
.statfs = ext4_statfs,
.show_options = ext4_show_options,
+ .shutdown = ext4_shutdown,
#ifdef CONFIG_QUOTA
.quota_read = ext4_quota_read,
.quota_write = ext4_quota_write,