linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: sd: Use warn for logs about no caching info
@ 2017-12-21 20:50 Jeremy Cline
  2018-01-04  3:50 ` Martin K. Petersen
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Cline @ 2017-12-21 20:50 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen
  Cc: linux-scsi, linux-kernel, Jeremy Cline

When no caching mode information can be found for a disk, use the
warning log level rather than error. It is common for this to occur
with cheap USB sticks.

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
---
 drivers/scsi/sd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index a028ab3322a9..9838d94b047e 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2789,7 +2789,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
 			}
 		}
 
-		sd_first_printk(KERN_ERR, sdkp, "No Caching mode page found\n");
+		sd_first_printk(KERN_WARNING, sdkp, "No Caching mode page found\n");
 		goto defaults;
 
 	Page_found:
@@ -2844,7 +2844,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
 				"Assuming drive cache: write back\n");
 		sdkp->WCE = 1;
 	} else {
-		sd_first_printk(KERN_ERR, sdkp,
+		sd_first_printk(KERN_WARNING, sdkp,
 				"Assuming drive cache: write through\n");
 		sdkp->WCE = 0;
 	}
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: sd: Use warn for logs about no caching info
  2017-12-21 20:50 [PATCH] scsi: sd: Use warn for logs about no caching info Jeremy Cline
@ 2018-01-04  3:50 ` Martin K. Petersen
  2018-01-11 20:22   ` Jeremy Cline
  0 siblings, 1 reply; 3+ messages in thread
From: Martin K. Petersen @ 2018-01-04  3:50 UTC (permalink / raw)
  To: Jeremy Cline
  Cc: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel


Hi Jeremy,

> When no caching mode information can be found for a disk, use the
> warning log level rather than error. It is common for this to occur
> with cheap USB sticks.

Just because something is common occurrence doesn't mean it's not an
error. What's the rationale behind demoting this to a warning?

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: sd: Use warn for logs about no caching info
  2018-01-04  3:50 ` Martin K. Petersen
@ 2018-01-11 20:22   ` Jeremy Cline
  0 siblings, 0 replies; 3+ messages in thread
From: Jeremy Cline @ 2018-01-11 20:22 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: James E . J . Bottomley, linux-scsi, linux-kernel

On Wed, Jan 03, 2018 at 10:50:29PM -0500, Martin K. Petersen wrote:
> 
> Hi Jeremy,
> 
> > When no caching mode information can be found for a disk, use the
> > warning log level rather than error. It is common for this to occur
> > with cheap USB sticks.
> 
> Just because something is common occurrence doesn't mean it's not an
> error. What's the rationale behind demoting this to a warning?

That's true, that's not a particularly compelling reason. My rationale
is that in this case when it can't find the cache info it drops back to
sane defaults and works fine. It's certainly something to note, but
I wouldn't describe it as an "error condition".

Regards,
Jeremy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-11 20:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-21 20:50 [PATCH] scsi: sd: Use warn for logs about no caching info Jeremy Cline
2018-01-04  3:50 ` Martin K. Petersen
2018-01-11 20:22   ` Jeremy Cline

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).