diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2022-06-01 01:48:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-09 11:20:48 +0300 |
commit | c9ac773715fcfd15f2f9e61682ba1e1c82290ab5 (patch) | |
tree | bf41e62a19d9cfd13a451e3fb0079a0e45d20d56 /fs/cifs | |
parent | ce4627f09e666f1c8de880c19786a449725862ef (diff) | |
download | linux-c9ac773715fcfd15f2f9e61682ba1e1c82290ab5.tar.xz |
cifs: when extending a file with falloc we should make files not-sparse
commit f66f8b94e7f2f4ac9fffe710be231ca8f25c5057 upstream.
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.
Cc: stable@vger.kernel.org
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/smb2ops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index c758ff41b638..7fea94ebda57 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3632,7 +3632,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); |