--- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3248,6 +3248,10 @@ static long smb3_simple_falloc(struct fi * Extending the file */ if ((keep_size == false) && i_size_read(inode) < off + len) { + rc = inode_newsize_ok(inode, off + len); + if (rc) + goto out; + if ((cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE) == 0) smb2_set_sparse(xid, tcon, cfile, inode, false);