[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <076aefb1-ec3a-471b-b299-5fa9a2a9495d@huawei.com>
Date: Mon, 21 Jul 2025 15:05:28 +0800
From: Zizhi Wo <wozizhi@...wei.com>
To: Christoph Hellwig <hch@....de>, Zizhi Wo <wozizhi@...weicloud.com>
CC: kernel test robot <lkp@...el.com>, <viro@...iv.linux.org.uk>,
<jack@...e.com>, <brauner@...nel.org>, <axboe@...nel.dk>,
<llvm@...ts.linux.dev>, <oe-kbuild-all@...ts.linux.dev>,
<linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<yukuai3@...wei.com>, <yangerkun@...wei.com>
Subject: Re: [PATCH] fs: Add additional checks for block devices during mount
在 2025/7/21 14:47, Christoph Hellwig 写道:
> 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.
Yes, adding this judgment directly is also fine.
>
>
> 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.
>
>
Do you mean performing the check outside of sget_dev()? That is, after
we obtain an existing superblock, we then check whether the block device
exists, and if it doesn't, we report the error in the outer layer (e.g.,
in get_tree_bdev_flags(), this function seems to be targeted at bdev
rather than just dev)?
Thanks,
Zizhi Wo
Powered by blists - more mailing lists