cifs: Fix smb3_insert_range() to move the zero_point
David Howells
maintainerPATCH 1/1 cifs: Fix smb3_insert_range() to move the zero_point
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 <[email protected]>
cc Steve French <[email protected]>
cc Shyam Prasad N <[email protected]>
cc Rohith Surabattula <[email protected]>
cc Jeff Layton <[email protected]>
--- fs/smb/client/smb2ops.c | 1 + 1 file changed, 1 insertion(+)
fs/smb/client/smb2ops.c +1 -0
@@ -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 )
Added the patch to the test branch and rerunning tests on it now
http://smb311-linux-testing.southcentralus.cloudapp.azure.com/#/builders/3/builds/122
Quoted 31 lines · David Howells
Fix
smb3_insert_range()to move thezero_pointover 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 <[email protected]>cc Steve French <[email protected]>cc Shyam Prasad N <[email protected]>cc Rohith Surabattula <[email protected]>cc Jeff Layton <[email protected]>--- fs/smb/client/smb2ops.c | 1 + 1 file changed, 1 insertion(+)fs/smb/client/smb2ops.c +1
-0@@ -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 )
Signature · 3 lines
Thanks, Steve