From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: "Yuezhang.Mo@sony.com" <Yuezhang.Mo@sony.com>,
"linux-erofs@lists.ozlabs.org" <linux-erofs@lists.ozlabs.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"syzbot+31b8fb02cb8a25bd5e78@syzkaller.appspotmail.com"
<syzbot+31b8fb02cb8a25bd5e78@syzkaller.appspotmail.com>
Subject: Re: [PATCH] erofs: correct FSDAX detection
Date: Fri, 21 Nov 2025 12:29:42 +0800 [thread overview]
Message-ID: <86b0ce55-60f5-4bf4-84a8-6d612478baa3@linux.alibaba.com> (raw)
In-Reply-To: <PUZPR04MB6316EBBEFB9F1878D1691E2481D5A@PUZPR04MB6316.apcprd04.prod.outlook.com>
On 2025/11/21 12:12, Yuezhang.Mo@sony.com wrote:
> On November 17, 2025 19:57 Gao Xiang wrote:
>> The detection of the primary device is skipped incorrectly
>> if the multiple or flattened feature is enabled.
>>
>> It also fixes the FSDAX misdetection for non-block extra blobs.
>>
>> Fixes: c6993c4cb918 ("erofs: Fallback to normal access if DAX is not supported on extra device")
>> Reported-by: syzbot+31b8fb02cb8a25bd5e78@syzkaller.appspotmail.com
>> Closes: https://lore.kernel.org/r/691af9f6.a70a0220.3124cb.0097.GAE@google.com
>> Cc: Yuezhang Mo <Yuezhang.Mo@sony.com>
>> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
>> ---
>> fs/erofs/super.c | 22 +++++++++++-----------
>> 1 file changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/fs/erofs/super.c b/fs/erofs/super.c
>> index f3f8d8c066e4..cd8ff98c2938 100644
>> --- a/fs/erofs/super.c
>> +++ b/fs/erofs/super.c
>> @@ -174,15 +174,15 @@ static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,
>> if (!erofs_is_fileio_mode(sbi)) {
>> dif->dax_dev = fs_dax_get_by_bdev(file_bdev(file),
>> &dif->dax_part_off, NULL, NULL);
>> - if (!dif->dax_dev && test_opt(&sbi->opt, DAX_ALWAYS)) {
>> - erofs_info(sb, "DAX unsupported by %s. Turning off DAX.",
>> - dif->path);
>> - clear_opt(&sbi->opt, DAX_ALWAYS);
>> - }
>> } else if (!S_ISREG(file_inode(file)->i_mode)) {
>> fput(file);
>> return -EINVAL;
>> }
>> + if (!dif->dax_dev && test_opt(&sbi->opt, DAX_ALWAYS)) {
>> + erofs_info(sb, "DAX unsupported by %s. Turning off DAX.",
>> + dif->path);
>> + clear_opt(&sbi->opt, DAX_ALWAYS);
>> + }
>> dif->file = file;
>> }
>>
>> @@ -215,13 +215,13 @@ static int erofs_scan_devices(struct super_block *sb,
>> ondisk_extradevs, sbi->devs->extra_devices);
>> return -EINVAL;
>> }
>> - if (!ondisk_extradevs) {
>> - if (test_opt(&sbi->opt, DAX_ALWAYS) && !sbi->dif0.dax_dev) {
>> - erofs_info(sb, "DAX unsupported by block device. Turning off DAX.");
>> - clear_opt(&sbi->opt, DAX_ALWAYS);
>> - }
>> - return 0;
>> +
>> + if (test_opt(&sbi->opt, DAX_ALWAYS) && !sbi->dif0.dax_dev) {
>> + erofs_info(sb, "DAX unsupported by block device. Turning off DAX.");
>> + clear_opt(&sbi->opt, DAX_ALWAYS);
>> }
>> + if (!ondisk_extradevs)
>> + return 0;
>
> Hi Gao Xiang,
>
> If using multiple devices, is there still file data on the primary device?
> If the primary device only contains metadata, the primary device does not need
> to support DAX.
Hi Yuezhang,
Currently we don't have a per-device/file fsdax selection
design/implementation.
If fsdax is on, for example, directory data arranged in the primary
device will go through fsdax path (but your case above is that the
primary device does not need to support fsdax.)
Anyway, in principle, we could make them work, but per-device FSDAX
needs a detailed design, I think we should restrict them on the
per-filesystem basis now.
Thanks,
Gao Xiang
>
>>
>> if (!sbi->devs->extra_devices && !erofs_is_fscache_mode(sb))
>> sbi->devs->flatdev = true;
>> --
>> 2.43.5
next prev parent reply other threads:[~2025-11-21 4:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 10:33 [syzbot] [erofs?] WARNING in get_next_unlocked_entry syzbot
2025-11-17 11:57 ` [PATCH] erofs: correct FSDAX detection Gao Xiang
2025-11-21 4:12 ` Yuezhang.Mo
2025-11-21 4:29 ` Gao Xiang [this message]
2025-11-24 0:44 ` Chao Yu
2025-11-21 1:44 ` [syzbot] [erofs?] WARNING in get_next_unlocked_entry Gao Xiang
2025-11-21 2:06 ` syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86b0ce55-60f5-4bf4-84a8-6d612478baa3@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=Yuezhang.Mo@sony.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+31b8fb02cb8a25bd5e78@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®