From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21418280A5A for ; Thu, 20 Aug 2026 13:49:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787233767; cv=none; b=jjaKV8s6dhzmEYcScjJX1yyNIsFqBZcD7AAYwO4Mrawq1/tHmtEoEoPQCbS0OexwgE93CKw293jJorf6qbl1ZWSXxBQdPdqlUJ+LZSalUj5zUJJ+rum9nqDldJY3XDOtb0y5X/0X+I8f5yK5DydoMx0dXbjYc31oYeF+73w+93U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787233767; c=relaxed/simple; bh=vWZwZNf+mxd6xw9ADclwJQr8y7rv3gxHh7V4nDhsI2k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e/HgUOXUq1XfVK2Zn6AxKydbqwKvJVC6kKC2OTWzrilXHOBw4wKtuYz+se/ih+8RXQQRcxy6KXKpNW/t1jHod0ektb7Oo1k3OOSR6GTXDaQhY74XnQ0awHeZYZKzrJM3RBZtTjP2FHdtyuOM8U30mbmEZexfm3N1E0ZRwTYaGVk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UrpNRP/0; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UrpNRP/0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88A5A1F00A3A; Thu, 20 Aug 2026 13:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787233765; bh=Vq46ijBOgQpZhUqPzLzPgL2nw2wm/dg2j5IaVeD0CVo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=UrpNRP/0NlbaV5ajh9A5r+0iqYxkMqBxDeFzNIqgPUS0DgiAYpsep2cURalt5oEdf rx84rOAxXn/jI++X/PoCSvkLjZVt7myltPm6fPzPdzJ8mNUcWeOzkoJ6wVc96iMpdu AGxnq2sJY5Cqyjm7M5NNohw0vyZ30tee88UFsT3vgSXhghafs36o9J4gChRULIHS53 f0DWdb97YqJx/i+eM3nPTKVishPstGO0XRzLCrK4OZCyW+vSfJJLuD9ruLcXm50up+ jgAgn0XHQ5LYG5nYbcUQjxVCO8wrxja1S6zqdKmGHz+ZBUpAr6zIwd47R2z3tbaMAg 3fQ5UVVlaSCWg== Date: Thu, 20 Aug 2026 21:49:18 +0800 From: Gao Xiang To: Jingbo Xu Cc: Zhan Xusheng , Gao Xiang , Chao Yu , Zhan Xusheng , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] erofs: use the shared page cache for splice in inode_share mode Message-ID: Mail-Followup-To: Jingbo Xu , Zhan Xusheng , Gao Xiang , Chao Yu , Zhan Xusheng , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20260820064441.1083470-1-zhanxusheng@xiaomi.com> <3d735f18-2d26-4b4c-be68-b000742e9826@linux.alibaba.com> <20260820123705.1748738-1-zhanxusheng@xiaomi.com> <76ee52de-1dcb-44da-b2cf-329864adca07@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <76ee52de-1dcb-44da-b2cf-329864adca07@linux.alibaba.com> On Thu, Aug 20, 2026 at 09:34:49PM +0800, Jingbo Xu wrote: > > > On 8/20/26 8:37 PM, Zhan Xusheng wrote: > > On Thu, 20 Aug 2026 17:53:20 +0800, Jingbo Xu wrote: > >> Please refer to backing_file_splice_read() called from > >> ovl_splice_read(), file_accessed() needs to be called on the original > >> file (just as what .read_iter() i.e. filemap_read() does), and the input > >> @ppos needs to be updated accordingly. > > > > Taking the file_accessed() one, thanks. filemap_splice_read() calls it at > > mm/filemap.c:3155 on whatever file it was handed, so on the backing file, > > whereas backing_file_splice_read() ends in ctx->accessed(iocb->ki_filp), > > which for ovl_splice_read() is the original. v2 adds file_accessed(in). > > > > @ppos looks already handled to me. filemap_splice_read() takes a loff_t * > > and advances it itself, at mm/filemap.c:3144; its internal kiocb is seeded > > from *ppos at 3083 and 3098, not the other way round. ovl_splice_read() > > has to copy iocb.ki_pos back because backing_file_splice_read() takes a > > struct kiocb and hands &iocb->ki_pos to vfs_splice_read(). Say if I have > > that wrong. > > Make sense. > > > > > > One you may want for read_iter too: it clones the kiocb onto the backing > > file, so filemap_read() marks that one accessed rather than the user's > > file, which is the shape splice_read had. Neither is observable today, > > since erofs_fc_fill_super() sets SB_RDONLY | SB_NOATIME and the backing > > file is opened O_NOATIME, so both reach a no-op. That is why I left > > read_iter alone here. > > Okay, it seems that file_accessed() shall also be added to > erofs_ishare_file_read_iter()? I think file_accessed() is a no-op for erofs? Thanks, Gao Xiang > > > -- > Thanks, > Jingbo > >