Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Christoph Hellwig and committed by
Jens Axboe
e7caa877 87efb390

+14 -1
+3
fs/xfs/xfs_fsops.c
··· 534 534 } else if (flags & SHUTDOWN_CORRUPT_ONDISK) { 535 535 tag = XFS_PTAG_SHUTDOWN_CORRUPT; 536 536 why = "Corruption of on-disk metadata"; 537 + } else if (flags & SHUTDOWN_DEVICE_REMOVED) { 538 + tag = XFS_PTAG_SHUTDOWN_IOERROR; 539 + why = "Block device removal"; 537 540 } else { 538 541 tag = XFS_PTAG_SHUTDOWN_IOERROR; 539 542 why = "Metadata I/O Error";
+3 -1
fs/xfs/xfs_mount.h
··· 457 457 #define SHUTDOWN_FORCE_UMOUNT (1u << 2) /* shutdown from a forced unmount */ 458 458 #define SHUTDOWN_CORRUPT_INCORE (1u << 3) /* corrupt in-memory structures */ 459 459 #define SHUTDOWN_CORRUPT_ONDISK (1u << 4) /* corrupt metadata on device */ 460 + #define SHUTDOWN_DEVICE_REMOVED (1u << 5) /* device removed underneath us */ 460 461 461 462 #define XFS_SHUTDOWN_STRINGS \ 462 463 { SHUTDOWN_META_IO_ERROR, "metadata_io" }, \ 463 464 { SHUTDOWN_LOG_IO_ERROR, "log_io" }, \ 464 465 { SHUTDOWN_FORCE_UMOUNT, "force_umount" }, \ 465 - { SHUTDOWN_CORRUPT_INCORE, "corruption" } 466 + { SHUTDOWN_CORRUPT_INCORE, "corruption" }, \ 467 + { SHUTDOWN_DEVICE_REMOVED, "device_removed" } 466 468 467 469 /* 468 470 * Flags for xfs_mountfs
+8
fs/xfs/xfs_super.c
··· 1159 1159 return xfs_reclaim_inodes_nr(XFS_M(sb), sc->nr_to_scan); 1160 1160 } 1161 1161 1162 + static void 1163 + xfs_fs_shutdown( 1164 + struct super_block *sb) 1165 + { 1166 + xfs_force_shutdown(XFS_M(sb), SHUTDOWN_DEVICE_REMOVED); 1167 + } 1168 + 1162 1169 static const struct super_operations xfs_super_operations = { 1163 1170 .alloc_inode = xfs_fs_alloc_inode, 1164 1171 .destroy_inode = xfs_fs_destroy_inode, ··· 1179 1172 .show_options = xfs_fs_show_options, 1180 1173 .nr_cached_objects = xfs_fs_nr_cached_objects, 1181 1174 .free_cached_objects = xfs_fs_free_cached_objects, 1175 + .shutdown = xfs_fs_shutdown, 1182 1176 }; 1183 1177 1184 1178 static int