mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hongbo Li <lihongbo22@huawei.com>
To: Gao Xiang <hsiangkao@linux.alibaba.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: Thu, 8 Jan 2026 20:20:08 +0800	[thread overview]
Message-ID: <bb8e14f4-dbab-4974-a180-b436a00625d1@huawei.com> (raw)
In-Reply-To: <99a517aa-744b-487b-bce8-294b69a0cd50@linux.alibaba.com>

Hi, Xiang

On 2026/1/7 14:08, Gao Xiang wrote:
> 
> 
> On 2025/12/31 17:01, Hongbo Li wrote:

...

>> +
>> +static int erofs_ishare_file_release(struct inode *inode, struct file 
>> *file)
>> +{
>> +    struct file *realfile = file->private_data;
>> +
>> +    iput(realfile->f_inode);
>> +    fput(realfile);
>> +    file->private_data = NULL;
>> +    return 0;
>> +}
>> +
>> +static ssize_t erofs_ishare_file_read_iter(struct kiocb *iocb,
>> +                       struct iov_iter *to)
>> +{
>> +    struct file *realfile = iocb->ki_filp->private_data;
>> +    struct kiocb dedup_iocb;
>> +    ssize_t nread;
>> +
>> +    if (!iov_iter_count(to))
>> +        return 0;
>> +
>> +    /* fallback to the original file in DIRECT mode */
>> +    if (iocb->ki_flags & IOCB_DIRECT)
>> +        realfile = iocb->ki_filp;
>> +
>> +    kiocb_clone(&dedup_iocb, iocb, realfile);
>> +    nread = filemap_read(&dedup_iocb, to, 0);
>> +    iocb->ki_pos = dedup_iocb.ki_pos;
> 
> I think it will not work for the AIO cases.
> 
> In order to make it simplified, how about just
> allowing sync and non-direct I/O first, and
> defering DIO/AIO support later?
> 

Ok, but what about doing the fallback logic:

1. For direct io: fallback to the original file.
2. For AIO: initialize the sync io by init_sync_kiocb (May be we can 
just replace kiocb_clone with init_sync_kiocb).

Thanks,
Hongbo

>> +    file_accessed(iocb->ki_filp);
> 
> I don't think it's useful in practice.
> 

Just keep in consistent with filemap_read?

> 
>> +    return nread;
>> +}
>> +
>> +static int erofs_ishare_mmap(struct file *file, struct vm_area_struct 
>> *vma)
>> +{
>> +    struct file *realfile = file->private_data;
>> +
>> +    vma_set_file(vma, realfile);
>> +    return generic_file_readonly_mmap(file, vma);
>> +}
>> +

...

>> @@ -649,6 +659,16 @@ static int erofs_fc_fill_super(struct super_block 
>> *sb, struct fs_context *fc)
>>       sb->s_maxbytes = MAX_LFS_FILESIZE;
>>       sb->s_op = &erofs_sops;
>> +    if (sbi->domain_id &&
>> +        (!sbi->fsid && !test_opt(&sbi->opt, INODE_SHARE))) {
>> +        errorfc(fc, "domain_id should be with fsid or inode_share 
>> option");
>> +        return -EINVAL;
>> +    }
> 
> Is that really needed?
> 

Ok, I will remove it in next version.

Thanks,
Hongbo

> 
> 
>> +    if (test_opt(&sbi->opt, DAX_ALWAYS) && test_opt(&sbi->opt, 
>> INODE_SHARE)) {
>> +        errorfc(fc, "dax is not allowed when inode_share is on");
> 
>          errorfc(fc, "FSDAX is not allowed when inode_share is on");
> 
> Thanks,
> Gao Xiang

  parent reply	other threads:[~2026-01-08 12:20 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
2026-01-07  8:51                 ` Hongbo Li
2026-01-08 12:20     ` Hongbo Li [this message]
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=bb8e14f4-dbab-4974-a180-b436a00625d1@huawei.com \
    --to=lihongbo22@huawei.com \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=chao@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=hsiangkao@linux.alibaba.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

all inboxes | Powered by JetHome®