diff mbox series

scsi: target: core: Silence the message about unknown VPD pages

Message ID 20220418212622.275516-1-k.shelekhin@yadro.com (mailing list archive)
State Accepted
Commit 95af09fabf3782be9728a6af6461f6937cd8e528
Headers show
Series scsi: target: core: Silence the message about unknown VPD pages | expand

Commit Message

Konstantin Shelekhin April 18, 2022, 9:26 p.m. UTC
Target does not support some VPD pages and is very verbose about it.
Sometimes initiators don't bother and just keep sending the same request
from time to time, filling up the logs.

This patch lowers the message priority to debug.

Signed-off-by: Konstantin Shelekhin <k.shelekhin@yadro.com>
---
 drivers/target/target_core_spc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen April 19, 2022, 3:08 a.m. UTC | #1
Konstantin,

> Target does not support some VPD pages and is very verbose about it.
> Sometimes initiators don't bother and just keep sending the same
> request from time to time, filling up the logs.
>
> This patch lowers the message priority to debug.

This essentially means the message will never be seen since it is not
particularly common to twiddle the syslog level. Have you considered
pr_err_once() or similar?
Konstantin Shelekhin April 19, 2022, 8:29 a.m. UTC | #2
On Mon, Apr 18, 2022 at 11:08:12PM -0400, Martin K. Petersen wrote:
> Konstantin,
> 
> > Target does not support some VPD pages and is very verbose about it.
> > Sometimes initiators don't bother and just keep sending the same
> > request from time to time, filling up the logs.
> >
> > This patch lowers the message priority to debug.
> 
> This essentially means the message will never be seen since it is not
> particularly common to twiddle the syslog level. Have you considered
> pr_err_once() or similar?

Hi,

Basically I was going the same route as with this message:

  pr_debug_ratelimited("%s/%s: Unsupported SCSI Opcode 0x%02x, sending CHECK_CONDITION.\n"

IMO it's kinda the same situation. I'm not sure that not implemented VPD
will be of any interest to anyone except for the developers.

Also if I recall correctly pr_err_once() will be triggered once per code
line, not per message, so it's possible to actually lose the info if
more that one page is not implemented.
Martin K. Petersen May 3, 2022, 12:51 a.m. UTC | #3
On Tue, 19 Apr 2022 00:26:22 +0300, Konstantin Shelekhin wrote:

> Target does not support some VPD pages and is very verbose about it.
> Sometimes initiators don't bother and just keep sending the same request
> from time to time, filling up the logs.
> 
> This patch lowers the message priority to debug.
> 
> 
> [...]

Applied to 5.19/scsi-queue, thanks!

[1/1] scsi: target: core: Silence the message about unknown VPD pages
      https://git.kernel.org/mkp/scsi/c/95af09fabf37
diff mbox series

Patch

diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
index 4c76498d3fb0..c14441c89bed 100644
--- a/drivers/target/target_core_spc.c
+++ b/drivers/target/target_core_spc.c
@@ -769,7 +769,7 @@  spc_emulate_inquiry(struct se_cmd *cmd)
 		}
 	}
 
-	pr_err("Unknown VPD Code: 0x%02x\n", cdb[2]);
+	pr_debug("Unknown VPD Code: 0x%02x\n", cdb[2]);
 	ret = TCM_INVALID_CDB_FIELD;
 
 out: