diff mbox series

[SMB3] limit noisy error

Message ID CAH2r5msPnCHf2qHtJ=tJymfa9cgyOgnrv9xPEiYF=nsWTg1syg@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series [SMB3] limit noisy error | expand

Commit Message

Steve French April 20, 2021, 4:27 a.m. UTC
For servers which don't support copy_range (SMB3 CopyChunk), the
logging of:
 CIFS: VFS: \\server\share refcpy ioctl error -95 getting resume key
can fill the client logs and make debugging real problems more
difficult.  Change the -EOPNOTSUPP on copy_range to a "warn once"

Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/smb2ops.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

  }_exit;
+ } else if (rc) {
  cifs_tcon_dbg(VFS, "refcpy ioctl error %d getting resume key\n", rc);
  goto req_res_key_exit;
  }

Comments

Tom Talpey April 20, 2021, 6:38 p.m. UTC | #1
On 4/20/2021 12:27 AM, Steve French wrote:
> For servers which don't support copy_range (SMB3 CopyChunk), the
> logging of:
>   CIFS: VFS: \\server\share refcpy ioctl error -95 getting resume key
> can fill the client logs and make debugging real problems more
> difficult.  Change the -EOPNOTSUPP on copy_range to a "warn once"

Making this a warn_once will suppress the future message for all
tcon's, won't it? Is it possible to use a bit in the tcon to track
this instead? That might be a closer match to the scope of the
message.

Tom.

> Signed-off-by: Steve French <stfrench@microsoft.com>
> ---
>   fs/cifs/smb2ops.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> index 5ccc36d98dad..dd0eb665b680 100644
> --- a/fs/cifs/smb2ops.c
> +++ b/fs/cifs/smb2ops.c
> @@ -1567,7 +1567,10 @@ SMB2_request_res_key(const unsigned int xid,
> struct cifs_tcon *tcon,
>    NULL, 0 /* no input */, CIFSMaxBufSize,
>    (char **)&res_key, &ret_data_len);
> 
> - if (rc) {
> + if (rc == -EOPNOTSUPP) {
> + pr_warn_once("Server share %s does not support copy range\n", tcon->treeName);
> + goto req_res_keyFor servers which don't support copy_range (SMB3
> CopyChunk), the
> logging of:
>   CIFS: VFS: \\server\share refcpy ioctl error -95 getting resume key
> can fill the client logs and make debugging real problems more
> difficult.  Change the -EOPNOTSUPP on copy_range to a "warn once"
> 
> Signed-off-by: Steve French <stfrench@microsoft.com>
> ---
>   fs/cifs/smb2ops.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> index 5ccc36d98dad..dd0eb665b680 100644
> --- a/fs/cifs/smb2ops.c
> +++ b/fs/cifs/smb2ops.c
> @@ -1567,7 +1567,10 @@ SMB2_request_res_key(const unsigned int xid,
> struct cifs_tcon *tcon,
>    NULL, 0 /* no input */, CIFSMaxBufSize,
>    (char **)&res_key, &ret_data_len);
> 
> - if (rc) {
> + if (rc == -EOPNOTSUPP) {
> + pr_warn_once("Server share %s does not support copy range\n", tcon->treeName);
> + goto req_res_key_exit;
> + } else if (rc) {
>    cifs_tcon_dbg(VFS, "refcpy ioctl error %d getting resume key\n", rc);
>    goto req_res_key_exit;
>    }_exit;
> + } else if (rc) {
>    cifs_tcon_dbg(VFS, "refcpy ioctl error %d getting resume key\n", rc);
>    goto req_res_key_exit;
>    }
>
diff mbox series

Patch

From 0e8868212d1ca2f639171feb93f7b2b270ec9aba Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Mon, 19 Apr 2021 23:22:37 -0500
Subject: [PATCH] smb3: limit noisy error

For servers which don't support copy_range (SMB3 CopyChunk), the
logging of:
 CIFS: VFS: \\server\share refcpy ioctl error -95 getting resume key
can fill the client logs and make debugging real problems more
difficult.  Change the -EOPNOTSUPP on copy_range to a "warn once"

Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/smb2ops.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 5ccc36d98dad..dd0eb665b680 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -1567,7 +1567,10 @@  SMB2_request_res_key(const unsigned int xid, struct cifs_tcon *tcon,
 			NULL, 0 /* no input */, CIFSMaxBufSize,
 			(char **)&res_key, &ret_data_len);
 
-	if (rc) {
+	if (rc == -EOPNOTSUPP) {
+		pr_warn_once("Server share %s does not support copy range\n", tcon->treeName);
+		goto req_res_key_exit;
+	} else if (rc) {
 		cifs_tcon_dbg(VFS, "refcpy ioctl error %d getting resume key\n", rc);
 		goto req_res_key_exit;
 	}
-- 
2.27.0