On 2025/7/28 10:15, Gao Xiang wrote: > On 2025/7/28 09:49, Yuezhang Mo wrote: > > If using multiple devices, we should check if the extra device support > > DAX instead of checking the primary device when deciding if to use DAX > > to access a file. > > > > If an extra device does not support DAX we should fallback to normal > > access otherwise the data on that device will be inaccessible. > > > > Signed-off-by: Yuezhang Mo <yuezhang...@sony.com> > > Reviewed-by: Friendy Su <friendy...@sony.com> > > Reviewed-by: Jacky Cao <jacky....@sony.com> > > Reviewed-by: Daniel Palmer <daniel.pal...@sony.com> > > --- > > fs/erofs/super.c | 23 ++++++++++++++--------- > > 1 file changed, 14 insertions(+), 9 deletions(-) > > > > diff --git a/fs/erofs/super.c b/fs/erofs/super.c > > index e1020aa60771..ad1578bb0f7b 100644 > > --- a/fs/erofs/super.c > > +++ b/fs/erofs/super.c > > @@ -174,6 +174,11 @@ 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); > > The patch itself looks good to me, yes, I don't think out > a reasonable way to enable partial DAX for multiple devices. > > So it'd better to just disable such case. > > Just a nitpick, it would be better to align `dif->path` to the > following char of `(` in the line above. > > Also if it's possible, please remove the unnecessary comment > ("/* handle multiple devices */") above erofs_scan_devices() > together since: > > - it was obvious and it might be not inaccurrate; > - it now handles some primary device stuff too.
Thanks for your comments. I fixed the indentation alignment of `dif->path` and removed the unnecessary comment in the v2 patch.