[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3bec1e49-e833-4e51-8bf5-3fa7f3defa86@huawei.com>
Date: Sat, 19 Jul 2025 12:46:32 +0800
From: Zizhi Wo <wozizhi@...wei.com>
To: Al Viro <viro@...iv.linux.org.uk>
CC: <jack@...e.com>, <brauner@...nel.org>, <axboe@...nel.dk>, <hch@....de>,
<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/19 12:17, Al Viro 写道:
> On Sat, Jul 19, 2025 at 10:44:03AM +0800, Zizhi Wo wrote:
>
>> mkfs.ext4 -F /dev/sdb
>> mount /dev/sdb /mnt
>> mknod /dev/test b 8 16 # [sdb 8:16]
>> echo 1 > /sys/block/sdb/device/delete
>> mount /dev/test /mnt1 # -> mount success
>>
>> Therefore, it is necessary to add an extra check. Solve this problem by
>> checking disk_live() in super_s_dev_test().
>
> That smells like a wrong approach... You are counting upon the failure
> of setup_bdev_super() after the thing is forced on the "no reuse" path,
> and that's too convoluted and brittle...
>
Since this problem can only occur in the superblock reuse scenario, and
the .test function used in sget_fc() for bdev filesystems is
super_s_dev_test(), I considered adding an additional condition check
within that function.
I'm wondering if there's a better way to handle this...
Thanks,
Zizhi Wo
Powered by blists - more mailing lists