Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] cifs: Fix smb3_insert_range() to move the zero_point
@ 2024-05-22  8:38 David Howells
  2024-05-22  9:27 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2024-05-22  8:38 UTC (permalink / raw)
  To: Steve French
  Cc: dhowells, Shyam Prasad N, Rohith Surabattula, Jeff Layton,
	Christian Brauner, linux-cifs, netfs, linux-fsdevel, linux-kernel

Fix smb3_insert_range() to move the zero_point over to the new EOF.
Without this, generic/147 fails as reads of data beyond the old EOF point
return zeroes.

Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Shyam Prasad N <nspmangalore@gmail.com>
cc: Rohith Surabattula <rohiths.msft@gmail.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cifs@vger.kernel.org
cc: netfs@lists.linux.dev
---
 fs/smb/client/smb2ops.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index ef18cd30f66c..b87b70edd0be 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -3636,6 +3636,7 @@ static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
 	rc = smb2_copychunk_range(xid, cfile, cfile, off, count, off + len);
 	if (rc < 0)
 		goto out_2;
+	cifsi->netfs.zero_point = new_eof;
 
 	rc = smb3_zero_data(file, tcon, off, len, xid);
 	if (rc < 0)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-22  9:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-22  8:38 [PATCH] cifs: Fix smb3_insert_range() to move the zero_point David Howells
2024-05-22  9:27 ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox