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.

ext4: wire up the ->mark_dead holder operation for log devices

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

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

authored by

Christoph Hellwig and committed by
Jens Axboe
dd2e31af f5db130d

+10 -1
+10 -1
fs/ext4/super.c
··· 1096 1096 */ 1097 1097 } 1098 1098 1099 + static void ext4_bdev_mark_dead(struct block_device *bdev) 1100 + { 1101 + ext4_force_shutdown(bdev->bd_holder, EXT4_GOING_FLAGS_NOLOGFLUSH); 1102 + } 1103 + 1104 + static const struct blk_holder_ops ext4_holder_ops = { 1105 + .mark_dead = ext4_bdev_mark_dead, 1106 + }; 1107 + 1099 1108 /* 1100 1109 * Open the external journal device 1101 1110 */ ··· 1113 1104 struct block_device *bdev; 1114 1105 1115 1106 bdev = blkdev_get_by_dev(dev, FMODE_READ|FMODE_WRITE|FMODE_EXCL, sb, 1116 - NULL); 1107 + &ext4_holder_ops); 1117 1108 if (IS_ERR(bdev)) 1118 1109 goto fail; 1119 1110 return bdev;