diff mbox series

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

Message ID 20220531224838.425356-1-lsahlber@redhat.com (mailing list archive)
State New, archived
Headers show
Series cifs: when extending a file with falloc we should make files not-sparse | expand

Commit Message

Ronnie Sahlberg May 31, 2022, 10:48 p.m. UTC
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.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/smb2ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve French May 31, 2022, 10:58 p.m. UTC | #1
will merge to cifs-2.6.git for-next and cc:stable

On Tue, May 31, 2022 at 3:48 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
>
> 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.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/smb2ops.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> index d7ade739cde1..03ab28c341c4 100644
> --- a/fs/cifs/smb2ops.c
> +++ b/fs/cifs/smb2ops.c
> @@ -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
>
diff mbox series

Patch

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index d7ade739cde1..03ab28c341c4 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -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);