Re: [PATCH] fs: Add additional checks for block devices during mount

From: Christoph Hellwig
Date: Mon Jul 21 2025 - 02:47:36 EST


On Mon, Jul 21, 2025 at 09:20:27AM +0800, Zizhi Wo wrote:
> Sorry, disk_live() is only declared but not defined when CONFIG_BLOCK is
> not set...

You can just add a if (IS_ENABLED(CONFIG_BLOCK)) check around it.


But the layering here feels wrong. sget_dev and it's helper operate
purely on the dev_t. Anything actually dealing with a block device /
gendisk should be in the helpers that otherwise use it.