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 the ->mark_dead holder operation for log and RT devices

Implement a set of holder_ops that shut down the file system when the
block device used as log or RT device is removed undeneath the file
system.

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-14-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
8067ca1d e7caa877

+12 -1
+12 -1
fs/xfs/xfs_super.c
··· 377 377 return 0; 378 378 } 379 379 380 + static void 381 + xfs_bdev_mark_dead( 382 + struct block_device *bdev) 383 + { 384 + xfs_force_shutdown(bdev->bd_holder, SHUTDOWN_DEVICE_REMOVED); 385 + } 386 + 387 + static const struct blk_holder_ops xfs_holder_ops = { 388 + .mark_dead = xfs_bdev_mark_dead, 389 + }; 390 + 380 391 STATIC int 381 392 xfs_blkdev_get( 382 393 xfs_mount_t *mp, ··· 397 386 int error = 0; 398 387 399 388 *bdevp = blkdev_get_by_path(name, FMODE_READ|FMODE_WRITE|FMODE_EXCL, 400 - mp, NULL); 389 + mp, &xfs_holder_ops); 401 390 if (IS_ERR(*bdevp)) { 402 391 error = PTR_ERR(*bdevp); 403 392 xfs_warn(mp, "Invalid device [%s], error=%d", name, error);