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 807D346E013 for ; Thu, 20 Aug 2026 13:33:57 +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=1787232838; cv=none; b=Z7iliJCcDQ1IOaBpkrOEeQqQMrOHHIRTbU56c50Msw+nglkRtrX6oxZfZqSWyL9gKKUtNRief7sBKn9UAmWrQNJpTaYNV0AvsJ5CzvK0ykdnk2SOq41TYAcbTX9SkRm6cXwZRZt8DbYWDz6tip/TMCuqHt9acmm+WTLgC6Ck9w8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787232838; c=relaxed/simple; bh=7r8LNBdQr2+/bTk60UzM8T1/pPtQRb3xEKOMPZiil/g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Rx2aELfAhqYw2FoOM8lpEwY8KWciRWdan4FQ6RyY682uOqMAk0TwsKzMHmSWAShDtHztlTGEn/onyrZ1jpLnt6LbrOml/12NVyNfpNtn9rQc1BO4A4yUUV2tQXQhtS5ggAlX7/mRPX8cCtZ6LVZaAQvUIAvGDrnCdh+Jb3IEwdk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k2zHofpj; 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="k2zHofpj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EDD21F00A3A; Thu, 20 Aug 2026 13:33:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787232837; bh=LbGyTW7vRWPON5I5dgHRtEXadLVcIPrLH2urM6dqQ+Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=k2zHofpjD2dl+NpLakhmQTgFlJjH0Ca5WMR8Ozbcr4D55PS3/R558M+oS0OCYekDV Y/czbLy5UnKT0NlWfwwV5CBpMtFutbenRetnCV7DgL0CvX/kj7JH4Tsw8BrQqfIOGQ xqN/DLDcQRvO7VvUxMEbK3paBXCVkVOzOqd1BMIgXE/Svj8lnKr/XQpkVeaDVP/enB KX5gB6zYIlCbFI8zzkTiqenrTZVdgLb7I1soKZ4aitgCqUOQXZ2XTATqwlaWy2KU/L Ji8EGAYKcBYTlaW/UmhGYOIeybO30nONDxFhb+l8PH6j4EvKazeD52cTIRnhic8pKz 58PFj/4kqwnNw== Date: Thu, 20 Aug 2026 21:33:49 +0800 From: Gao Xiang To: Jingbo Xu Cc: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] erofs: support SEEK_HOLE/SEEK_DATA in inode_share mode Message-ID: Mail-Followup-To: Jingbo Xu , xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20260818113713.116849-1-jefflexu@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: <20260818113713.116849-1-jefflexu@linux.alibaba.com> Hi Jingbo, On Tue, Aug 18, 2026 at 07:37:13PM +0800, Jingbo Xu wrote: > When inode_share is enabled, erofs_ishare_fops.llseek falls back to > generic_file_llseek, which treats the whole file as data and always > returns i_size for SEEK_HOLE, hiding real holes in sparse files. > > Switch it to erofs_file_llseek instead. For user files f_mapping->host > is always the real erofs inode, so SEEK_HOLE/SEEK_DATA resolve the > per-file on-disk layout via iomap_seek_hole()/iomap_seek_data(). > > Reported-by: Yuanhe Shu > Signed-off-by: Jingbo Xu > --- > fs/erofs/data.c | 2 +- > fs/erofs/internal.h | 2 ++ > fs/erofs/ishare.c | 2 +- > 3 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/fs/erofs/data.c b/fs/erofs/data.c > index d2f01245ee79..09d668deb86d 100644 > --- a/fs/erofs/data.c > +++ b/fs/erofs/data.c > @@ -509,7 +509,7 @@ static int erofs_file_mmap_prepare(struct vm_area_desc *desc) > #define erofs_file_mmap_prepare generic_file_readonly_mmap_prepare > #endif > > -static loff_t erofs_file_llseek(struct file *file, loff_t offset, int whence) > +loff_t erofs_file_llseek(struct file *file, loff_t offset, int whence) > { > struct inode *inode = file->f_mapping->host; > const struct iomap_ops *ops = &erofs_iomap_ops; > diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h > index 57bd21859c65..3263c11d714c 100644 > --- a/fs/erofs/internal.h > +++ b/fs/erofs/internal.h > @@ -528,6 +528,8 @@ static inline struct inode *erofs_real_inode(struct inode *inode, bool *need_ipu > } > #endif > > +loff_t erofs_file_llseek(struct file *file, loff_t offset, int whence); > + Could you move this line below erofs_fiemap()? I hope all declarations in data.c are closer. Otherwise it looks good to me, Reviewed-by: Gao Xiang Also could you help write a test for this functionality too? Thanks, Gao Xiang