Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Huiwen He <huiwen.he@linux.dev>
To: smfrench@gmail.com, linkinjeon@kernel.org, pc@manguebit.org,
	ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com,
	bharathsm@microsoft.com, senozhatsky@chromium.org,
	dhowells@redhat.com, chenxiaosong@kylinos.cn
Cc: linux-cifs@vger.kernel.org
Subject: [PATCH v2 0/6] smb/client: fix emulated insert/collapse range issues
Date: Thu, 20 Aug 2026 15:15:20 +0800	[thread overview]
Message-ID: <20260820071526.826926-1-huiwen.he@linux.dev> (raw)

From: Huiwen He <hehuiwen@kylinos.cn>

This series fixes the SMB3 FALLOC_FL_INSERT_RANGE and
FALLOC_FL_COLLAPSE_RANGE emulation.

Patch 1 validates the new EOF for insert range, which previously allowed
RLIMIT_FSIZE to be bypassed.

Patch 2 validates the new EOF for zero range when it extends the file.

Patch 3 marks the file sparse before emulating insert range so the
inserted range becomes a real hole, fixing xfstests generic/064 against
Samba and ksmbd.

Patch 4 fixes data corruption in emulated insert range by copying
overlapping ranges from EOF backwards.

Patch 5 fixes integer truncation when the collapse-range copy exceeds
INT_MAX bytes.

Patch 6 fixes stale page cache after the range emulation, where reads
returned zeroes instead of the shifted data.

Changes in v2:

- update patch3 to propagate SET_SPARSE fails.
- Add patch2 and patch4-6.
 
Link to v1:
https://lore.kernel.org/linux-cifs/20260813132136.366532-1-huiwen.he@linux.dev/

Thanks,
Huiwen

Huiwen He (6):
  smb/client: validate new EOF for insert range
  smb/client: validate new EOF for zero range
  smb/client: mark file sparse before emulating insert range
  smb/client: fix data corruption in emulated insert range
  smb/client: fix integer truncation in collapse range
  smb/client: fix stale page cache in insert/collapse range

 fs/smb/client/smb2ops.c | 202 +++++++++++++++++++++++++++++++++-------
 1 file changed, 168 insertions(+), 34 deletions(-)

-- 
2.43.0


             reply	other threads:[~2026-08-20  7:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20  7:15 Huiwen He [this message]
2026-08-20  7:15 ` [PATCH v2 1/6] smb/client: validate new EOF for insert range Huiwen He
2026-08-20  7:15 ` [PATCH v2 2/6] smb/client: validate new EOF for zero range Huiwen He
2026-08-20  7:15 ` [PATCH v2 3/6] smb/client: mark file sparse before emulating insert range Huiwen He
2026-08-20  7:15 ` [PATCH v2 4/6] smb/client: fix data corruption in emulated " Huiwen He
2026-08-20  7:15 ` [PATCH v2 5/6] smb/client: fix integer truncation in collapse range Huiwen He
2026-08-20  7:15 ` [PATCH v2 6/6] smb/client: fix stale page cache in insert/collapse range Huiwen He

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=20260820071526.826926-1-huiwen.he@linux.dev \
    --to=huiwen.he@linux.dev \
    --cc=bharathsm@microsoft.com \
    --cc=chenxiaosong@kylinos.cn \
    --cc=dhowells@redhat.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=pc@manguebit.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=senozhatsky@chromium.org \
    --cc=smfrench@gmail.com \
    --cc=sprasad@microsoft.com \
    --cc=tom@talpey.com \
    /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