diff options
author | Christoph Hellwig <hch@lst.de> | 2023-06-01 11:44:55 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-06-05 10:53:04 -0600 |
commit | e7caa877e5ddac63886f4a8376cb3ffbd4dfe569 (patch) | |
tree | 2dcfa2de61d0904192dee348bd1a351ca88ba17b /fs/xfs/xfs_super.c | |
parent | 87efb39075be6a288cd7f23858f15bd01c83028a (diff) | |
download | lwn-e7caa877e5ddac63886f4a8376cb3ffbd4dfe569.tar.gz lwn-e7caa877e5ddac63886f4a8376cb3ffbd4dfe569.zip |
xfs: wire up sops->shutdown
Wire up the shutdown method to shut down the file system when the
underlying block device is marked dead. Add a new message to
clearly distinguish this shutdown reason from other shutdowns.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Link: https://lore.kernel.org/r/20230601094459.1350643-13-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r-- | fs/xfs/xfs_super.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 5684c538eb76..eb469b8f9a04 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1159,6 +1159,13 @@ xfs_fs_free_cached_objects( return xfs_reclaim_inodes_nr(XFS_M(sb), sc->nr_to_scan); } +static void +xfs_fs_shutdown( + struct super_block *sb) +{ + xfs_force_shutdown(XFS_M(sb), SHUTDOWN_DEVICE_REMOVED); +} + static const struct super_operations xfs_super_operations = { .alloc_inode = xfs_fs_alloc_inode, .destroy_inode = xfs_fs_destroy_inode, @@ -1172,6 +1179,7 @@ static const struct super_operations xfs_super_operations = { .show_options = xfs_fs_show_options, .nr_cached_objects = xfs_fs_nr_cached_objects, .free_cached_objects = xfs_fs_free_cached_objects, + .shutdown = xfs_fs_shutdown, }; static int |