[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eeb5efea-aa9c-449b-b2f8-157130b02aed@huawei.com>
Date: Wed, 7 Jan 2026 16:51:47 +0800
From: Hongbo Li <lihongbo22@...wei.com>
To: Gao Xiang <hsiangkao@...ux.alibaba.com>
CC: <djwong@...nel.org>, <amir73il@...il.com>, <hch@....de>,
<linux-fsdevel@...r.kernel.org>, <linux-erofs@...ts.ozlabs.org>,
<linux-kernel@...r.kernel.org>, Chao Yu <chao@...nel.org>,
<brauner@...nel.org>
Subject: Re: [PATCH v12 07/10] erofs: introduce the page cache share feature
On 2026/1/7 15:53, Gao Xiang wrote:
>
>
> On 2026/1/7 15:32, Hongbo Li wrote:
>>
>>
>> On 2026/1/7 15:27, Gao Xiang wrote:
>>>
>>>
>>> On 2026/1/7 15:17, Hongbo Li wrote:
>>>> Hi, Xiang
>>>>
>>>
>>> ...
>>>
>>>>>>>> +
>>>>>>>> +bool erofs_ishare_fill_inode(struct inode *inode)
>>>>>>>> +{
>>>>>>>> + struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb);
>>>>>>>> + struct erofs_inode *vi = EROFS_I(inode);
>>>>>>>> + struct erofs_inode_fingerprint fp;
>>>>>>>> + struct inode *sharedinode;
>>>>>>>> + unsigned long hash;
>>>>>>>> +
>>>>>>>> + if (!test_opt(&sbi->opt, INODE_SHARE))
>>>>>>>> + return false;
>>>>>>>> + (void)erofs_xattr_fill_ishare_fp(&fp, inode, sbi->domain_id);
>>>>>>>> + if (!fp.size)
>>>>>>>> + return false;
>>>>>>>
>>>>>>> Why not just:
>>>>>>>
>>>>>>> if (erofs_xattr_fill_ishare_fp(&fp, inode, sbi->domain_id))
>>>>>>> return false;
>>>>>>>
>>>>>>
>>>>>> When erofs_sb_has_ishare_xattrs returns false,
>>>>>> erofs_xattr_fill_ishare_fp also considers success.
>>>>>
>>>>> Then why !test_opt(&sbi->opt, INODE_SHARE) didn't return?
>>>>>
>>>>
>>>> The MOUNT_INODE_SHARE flag is passed from user's mount option. And
>>>> it is controllered by CONFIG_EROFS_FS_PAGE_CACHE_SHARE. I doesn't do
>>>> the check when the superblock without ishare_xattrs. (It seems the
>>>> mount options is static, although it is useless for mounting with
>>>> inode_share on one EROFS image without ishare_xattrs).
>>>> So should we check that if the superblock has not ishare_xattrs
>>>> feature, and we return -ENOSUPP?
>>>
>>> I think you should just mask off the INODE_SHARE if the on-disk
>>> compat feature is unavailable, and print a warning just like
>>> FSDAX fallback.
>>>
>>
>> Ok, it seems reasonable, and also can remove the check logic in
>> erofs_xattr_fill_ishare_fp. I will change in next version.
>
> I think you should move
>
> if (!test_opt(&sbi->opt, INODE_SHARE))
> return -EOPNOTSUPP;
>
> into erofs_xattr_fill_inode_fingerprint() directly.
>
Ok.
Thanks,
Hongbo
> Thanks,
> Gao Xiang
Powered by blists - more mailing lists