mirror of https://lore.kernel.org/lkml/
 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: Thu, 8 Jan 2026 20:32:27 +0800	[thread overview]
Message-ID: <21190994-916e-4f6e-8a57-8f90e27e3227@linux.alibaba.com> (raw)
In-Reply-To: <bb8e14f4-dbab-4974-a180-b436a00625d1@huawei.com>



On 2026/1/8 20:20, Hongbo Li wrote:
> 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).

No, I'd like to disallow these two types of I/Os
first and consider adding it later for simplicity.

> 
> Thanks,
> Hongbo
> 
>>> +    file_accessed(iocb->ki_filp);
>>
>> I don't think it's useful in practice.
>>
> 
> Just keep in consistent with filemap_read?

Just remove it since EROFS is an immutable fs so
there is nonsense to update atime.

Thanks,
Gao Xiang

  reply	other threads:[~2026-01-08 12:32 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
2026-01-08 12:32       ` Gao Xiang [this message]
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=21190994-916e-4f6e-8a57-8f90e27e3227@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

all inboxes | Powered by JetHome®