]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cifs: return proper error code in statfs(2)
authorPaulo Alcantara <pc@cjr.nz>
Mon, 8 Mar 2021 15:00:49 +0000 (12:00 -0300)
committerSteve French <stfrench@microsoft.com>
Tue, 9 Mar 2021 03:23:11 +0000 (21:23 -0600)
In cifs_statfs(), if server->ops->queryfs is not NULL, then we should
use its return value rather than always returning 0.  Instead, use rc
variable as it is properly set to 0 in case there is no
server->ops->queryfs.

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsfs.c

index d43e935d2df4365371200276509d4c72bab13289..099ad9f3660bb28db1b6a9aea9538282b41c6455 100644 (file)
@@ -290,7 +290,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
                rc = server->ops->queryfs(xid, tcon, cifs_sb, buf);
 
        free_xid(xid);
-       return 0;
+       return rc;
 }
 
 static long cifs_fallocate(struct file *file, int mode, loff_t off, loff_t len)