[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <21190994-916e-4f6e-8a57-8f90e27e3227@linux.alibaba.com>
Date: Thu, 8 Jan 2026 20:32:27 +0800
From: Gao Xiang <hsiangkao@...ux.alibaba.com>
To: Hongbo Li <lihongbo22@...wei.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/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
Powered by blists - more mailing lists