Skip to contentSkip to conversation

cifs: when extending a file with falloc we should make files not-sparse

PATCH In review Ronnie Sahlberg 2 participants 2 messages May 31, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: when extending a file with falloc we should make files not-sparse

as this is the only way to make sure the region is allocated. Fix the conditional that was wrong and only tried to make already non-sparse files non-sparse.

---
 fs/cifs/smb2ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/smb2ops.c +1 -1
index d7ade739cde1..03ab28c341c4 100644
@@ -3859,7 +3859,7 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon,
 		if (rc)
 			goto out;
 
-		if ((cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE) == 0)
+		if (cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE)
 			smb2_set_sparse(xid, tcon, cfile, inode, false);
 
 		eof = cpu_to_le64(off + len);
Signature · 1 line
2.35.3
#1 lore raw

will merge to cifs-2.6.git for-next and cc:stable

Quoted 26 lines · Ronnie Sahlberg

as this is the only way to make sure the region is allocated. Fix the conditional that was wrong and only tried to make already non-sparse files non-sparse.

---
 fs/cifs/smb2ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/smb2ops.c +1 -2
index d7ade739cde1..03ab28c341c4 100644
@@ -3859,7 +3859,7 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon,
                if (rc)
                        goto out;
 
-               if ((cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE) == 0)
+               if (cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE)
                        smb2_set_sparse(xid, tcon, cfile, inode, false);
 
                eof = cpu_to_le64(off + len);
--

2.35.3

Signature · 3 lines
Thanks,

Steve