public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Hongbo Li <lihongbo22@huawei.com>
Cc: djwong@kernel.org, amir73il@gmail.com, hch@lst.de,
	linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, Chao Yu <chao@kernel.org>,
	brauner@kernel.org
Subject: Re: [PATCH v12 07/10] erofs: introduce the page cache share feature
Date: Wed, 7 Jan 2026 15:53:28 +0800	[thread overview]
Message-ID: <d82c60eb-a170-48fe-9e50-e64c80681cb6@linux.alibaba.com> (raw)
In-Reply-To: <48755c73-323d-469e-9125-07051daf7c19@huawei.com>



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.

Thanks,
Gao Xiang

  reply	other threads:[~2026-01-07  7:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-31  9:01 [PATCH v12 00/10] erofs: Introduce page cache sharing feature Hongbo Li
2025-12-31  9:01 ` [PATCH v12 01/10] iomap: stash iomap read ctx in the private field of iomap_iter Hongbo Li
2025-12-31  9:01 ` [PATCH v12 02/10] erofs: hold read context in iomap_iter if needed Hongbo Li
2025-12-31  9:01 ` [PATCH v12 03/10] fs: Export alloc_empty_backing_file Hongbo Li
2025-12-31  9:01 ` [PATCH v12 04/10] erofs: decouple `struct erofs_anon_fs_type` Hongbo Li
2025-12-31  9:01 ` [PATCH v12 05/10] erofs: support user-defined fingerprint name Hongbo Li
2026-01-07  5:51   ` Gao Xiang
2025-12-31  9:01 ` [PATCH v12 06/10] erofs: support domain-specific page cache share Hongbo Li
2025-12-31  9:01 ` [PATCH v12 07/10] erofs: introduce the page cache share feature Hongbo Li
2026-01-07  6:08   ` Gao Xiang
2026-01-07  6:48     ` Hongbo Li
2026-01-07  6:56       ` Gao Xiang
2026-01-07  7:17         ` Hongbo Li
2026-01-07  7:27           ` Gao Xiang
2026-01-07  7:32             ` Hongbo Li
2026-01-07  7:53               ` Gao Xiang [this message]
2026-01-07  8:51                 ` Hongbo Li
2026-01-08 12:20     ` Hongbo Li
2026-01-08 12:32       ` Gao Xiang
2025-12-31  9:01 ` [PATCH v12 08/10] erofs: support unencoded inodes for page cache share Hongbo Li
2026-01-07  6:12   ` Gao Xiang
2026-01-07  6:50     ` Hongbo Li
2025-12-31  9:01 ` [PATCH v12 09/10] erofs: support compressed " Hongbo Li
2026-01-07  6:15   ` Gao Xiang
2025-12-31  9:01 ` [PATCH v12 10/10] erofs: implement .fadvise " Hongbo Li

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=d82c60eb-a170-48fe-9e50-e64c80681cb6@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=chao@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=lihongbo22@huawei.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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