Skip to content

Commit

Permalink
cifs: Fix smb3_insert_range() to move the zero_point
Browse files Browse the repository at this point in the history
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: 3ee1a1f ("cifs: Cut over to using netfslib")
Signed-off-by: David Howells <dhowells@redhat.com>
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
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
David Howells authored and Steve French committed May 24, 2024
1 parent 10c623a commit 8a16072
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/smb/client/smb2ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8a16072

Please sign in to comment.