diff mbox series

[3/4] cifs: return proper error code in statfs(2)

Message ID 20210308150050.19902-3-pc@cjr.nz (mailing list archive)
State New, archived
Headers show
Series [1/4] cifs: print MIDs in decimal notation | expand

Commit Message

Paulo Alcantara March 8, 2021, 3 p.m. UTC
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>
---
 fs/cifs/cifsfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Aurélien Aptel March 8, 2021, 3:13 p.m. UTC | #1
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Steve French March 8, 2021, 9:08 p.m. UTC | #2
cc:stable?

On Mon, Mar 8, 2021 at 9:01 AM Paulo Alcantara <pc@cjr.nz> wrote:
>
> 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>
> ---
>  fs/cifs/cifsfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
> index d43e935d2df4..099ad9f3660b 100644
> --- a/fs/cifs/cifsfs.c
> +++ b/fs/cifs/cifsfs.c
> @@ -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)
> --
> 2.30.1
>
Paulo Alcantara March 8, 2021, 10:21 p.m. UTC | #3
Steve French <smfrench@gmail.com> writes:

> cc:stable?

Yes, please.
ronnie sahlberg March 9, 2021, 12:40 a.m. UTC | #4
reviewed-by me

On Tue, Mar 9, 2021 at 1:02 AM Paulo Alcantara <pc@cjr.nz> wrote:
>
> 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>
> ---
>  fs/cifs/cifsfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
> index d43e935d2df4..099ad9f3660b 100644
> --- a/fs/cifs/cifsfs.c
> +++ b/fs/cifs/cifsfs.c
> @@ -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)
> --
> 2.30.1
>
diff mbox series

Patch

diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index d43e935d2df4..099ad9f3660b 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -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)