Skip to content

Commit 8801015

Browse files
dhowellsSteve French
authored andcommitted
cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF moved
Fix the cifs filesystem implementations of FALLOC_FL_INSERT_RANGE, in smb3_insert_range(), to set i_size after extending the file on the server and before we do the copy to open the gap (as we don't clean up the EOF marker if the copy fails). Fixes: 7fe6fe9 ("cifs: add FALLOC_FL_INSERT_RANGE support") Cc: [email protected] Signed-off-by: David Howells <[email protected]> Acked-by: Paulo Alcantara <[email protected]> cc: Shyam Prasad N <[email protected]> cc: Rohith Surabattula <[email protected]> cc: Jeff Layton <[email protected]> cc: [email protected] cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent 83d5518 commit 8801015

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/smb/client/smb2ops.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,6 +3745,9 @@ static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon,
37453745
if (rc < 0)
37463746
goto out_2;
37473747

3748+
truncate_setsize(inode, old_eof + len);
3749+
fscache_resize_cookie(cifs_inode_cookie(inode), i_size_read(inode));
3750+
37483751
rc = smb2_copychunk_range(xid, cfile, cfile, off, count, off + len);
37493752
if (rc < 0)
37503753
goto out_2;

0 commit comments

Comments
 (0)