From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (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 D4726446C18 for ; Thu, 20 Aug 2026 13:36:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787232965; cv=none; b=PXTKu8WRwi1WYTOZTLOu8Iq+TKCP8KCb5LOw7HqbaRQAQ79M6O0gJKcJdCUFcUYUg1UIq9GU2ULiU+ldwvw7dUJ4EG9MybLwDeaZDExPgpGCkR+G2pSqmfjBWubyvpBnxNv2N02QvKmON9WkdYktp9nAK+JrcP2RhMooBTxvZ1w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787232965; c=relaxed/simple; bh=iJu8Kbm7qh3b6EHV8cvz8dApZ4Ql/8zHm/F+2jZOJb0=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=c0jHVAw5eNrseOpHSJl4msy2mxQpclEkb/4HaLzpXuEo4O+Lf5Ay2hsSGmMLWwv/Xxq4ahaMBVcjiZwj/WZtBSvXmQlN158ST7Qnb6E62Y87RT9LdYDDBATQbG6+CZ9jPMOdBKumjLE7DWjcGHZolUmmW59yHBpQhOPfT0tAy6U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=E3yTHcvd; arc=none smtp.client-ip=115.124.30.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="E3yTHcvd" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1787232953; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=CwcEUbYO4HWf1Px33ZovDCtsznzv2AsinQ8h6cepSGU=; b=E3yTHcvdqp5bZyqFJKXLIH6sTHM3J0WuQ2LS66jUZzt9zipM3gWNGq3vHo99pg+W7mKItNUuLmYvAzLZqZdJLJ+6AQ7p50p+/5pIyvdlfcRHB/eURwM0FZkj53/N/HIZJSC0HfeODXxjcoA26DalD2MBt6+7B6QyrEF+zoMHUhU= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032089153;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0X9Jd65l_1787232952; Received: from 30.42.155.165(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0X9Jd65l_1787232952 cluster:ay36) by smtp.aliyun-inc.com; Thu, 20 Aug 2026 21:35:53 +0800 Message-ID: Date: Thu, 20 Aug 2026 21:35:52 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] erofs: support SEEK_HOLE/SEEK_DATA in inode_share mode To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20260818113713.116849-1-jefflexu@linux.alibaba.com> Content-Language: en-US From: Jingbo Xu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 8/20/26 9:33 PM, Gao Xiang wrote: > 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. Sure. > > Otherwise it looks good to me, > Reviewed-by: Gao Xiang > > Also could you help write a test for this functionality too? Will post the test later after posting v2. -- Thanks, Jingbo