* [PATCH] sd: Reduce log level to KERN_NOTICE for missing caching mode page
@ 2014-06-02 10:46 Alain Kalker
2014-06-02 11:51 ` Alain Kalker
0 siblings, 1 reply; 7+ messages in thread
From: Alain Kalker @ 2014-06-02 10:46 UTC (permalink / raw)
To: linux-scsi; +Cc: Alain Kalker
Reduce the lernel log level to KERN_NOTICE for messages related
to a missing caching mode page.
Reasons why I think this change is justified:
- The condition is non-fatal; the existing workaround assumes
a write through cache. Although this reduces write performance,
it doesn't limit functionality in any way.
- The current log level suggests that immediate action is
required, however, as it is a hardware limitation, there is
nothing much the user can do about it besides replacing the
affected hardware.
- The current situation breaks quiet boot (kernel commandline
parameter 'quiet'), and may trip log monitoring software
unneccessarily, either on every boot or whenever an affected
external device is plugged in.
Signed-off-by: Alain Kalker <a.c.kalker@gmail.com>
---
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 efcbcd1..5f0f6c6 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2442,7 +2442,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_NOTICE, sdkp, "No Caching mode page found\n");
goto defaults;
Page_found:
@@ -2489,7 +2489,7 @@ defaults:
"Assuming drive cache: write back\n");
sdkp->WCE = 1;
} else {
- sd_first_printk(KERN_ERR, sdkp,
+ sd_first_printk(KERN_NOTICE, sdkp,
"Assuming drive cache: write through\n");
sdkp->WCE = 0;
}
--
2.0.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] sd: Reduce log level to KERN_NOTICE for missing caching mode page
2014-06-02 10:46 [PATCH] sd: Reduce log level to KERN_NOTICE for missing caching mode page Alain Kalker
@ 2014-06-02 11:51 ` Alain Kalker
2014-06-02 12:10 ` [PATCH V2] " Alain Kalker
0 siblings, 1 reply; 7+ messages in thread
From: Alain Kalker @ 2014-06-02 11:51 UTC (permalink / raw)
To: linux-scsi
On 06/02/2014 12:46 PM, Alain Kalker wrote:
> Reduce the lernel log level to KERN_NOTICE for messages related
> to a missing caching mode page.
>
> Reasons why I think this change is justified:
> - The condition is non-fatal; the existing workaround assumes
> a write through cache. Although this reduces write performance,
> it doesn't limit functionality in any way.
> - The current log level suggests that immediate action is
> required, however, as it is a hardware limitation, there is
> nothing much the user can do about it besides replacing the
> affected hardware.
whoops, confused that one with KERN_ALERT, sorry about that.
Will reword, rebase and repost.
> - The current situation breaks quiet boot (kernel commandline
> parameter 'quiet'), and may trip log monitoring software
> unneccessarily, either on every boot or whenever an affected
> external device is plugged in.
>
> Signed-off-by: Alain Kalker <a.c.kalker@gmail.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH V2] sd: Reduce log level to KERN_NOTICE for missing caching mode page
2014-06-02 11:51 ` Alain Kalker
@ 2014-06-02 12:10 ` Alain Kalker
0 siblings, 0 replies; 7+ messages in thread
From: Alain Kalker @ 2014-06-02 12:10 UTC (permalink / raw)
To: linux-scsi; +Cc: Alain Kalker
Reduce the lernel log level to KERN_NOTICE for messages related
to a missing caching mode page.
Reasons why I think this change is justified:
- The condition is not an error; the existing workaround of assuming
a write through cache doesn't limit functionality in any way.
- It doesn't warrant a warning either: as it is most likely
a hardware limitation, there is little that an ordinary user can do
about it besides replacing the affected hardware.
Making it a warning would still break quiet boot (kernel commandline
parameter 'quiet'), and may still trip log monitoring software
unneccessarily, either on every boot or whenever an affected
external device is plugged in.
- It should be a notice, for it is a normal but significant condition,
as it may impact write performance. This would bring it on par with
the log messages in the same function.
Signed-off-by: Alain Kalker <a.c.kalker@gmail.com>
---
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 efcbcd1..5f0f6c6 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2442,7 +2442,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_NOTICE, sdkp, "No Caching mode page found\n");
goto defaults;
Page_found:
@@ -2489,7 +2489,7 @@ defaults:
"Assuming drive cache: write back\n");
sdkp->WCE = 1;
} else {
- sd_first_printk(KERN_ERR, sdkp,
+ sd_first_printk(KERN_NOTICE, sdkp,
"Assuming drive cache: write through\n");
sdkp->WCE = 0;
}
--
2.0.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH V2] sd: Reduce log level to KERN_NOTICE for missing caching mode page
@ 2014-06-02 18:48 Alain Kalker
2014-06-02 19:08 ` Alain Kalker
2014-06-02 19:14 ` James Bottomley
0 siblings, 2 replies; 7+ messages in thread
From: Alain Kalker @ 2014-06-02 18:48 UTC (permalink / raw)
To: linux-scsi; +Cc: James E.J. Bottomley, Martin K. Petersen, Alain Kalker
Reduce the lernel log level to KERN_NOTICE for messages related
to a missing caching mode page.
Reasons why I think this change is justified:
- The condition is not an error; the existing workaround of assuming
a write through cache doesn't limit functionality in any way.
- It doesn't warrant a warning either: as it is most likely
a hardware limitation, there is little that an ordinary user can do
about it besides replacing the affected hardware.
Making it a warning would still break quiet boot (kernel commandline
parameter 'quiet'), and may still trip log monitoring software
unneccessarily, either on every boot or whenever an affected
external device is plugged in.
- It should be a notice, for it is a normal but significant condition,
as it may impact write performance. This would bring it on par with
the log messages in the same function.
Signed-off-by: Alain Kalker <a.c.kalker@gmail.com>
---
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 efcbcd1..5f0f6c6 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2442,7 +2442,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_NOTICE, sdkp, "No Caching mode page found\n");
goto defaults;
Page_found:
@@ -2489,7 +2489,7 @@ defaults:
"Assuming drive cache: write back\n");
sdkp->WCE = 1;
} else {
- sd_first_printk(KERN_ERR, sdkp,
+ sd_first_printk(KERN_NOTICE, sdkp,
"Assuming drive cache: write through\n");
sdkp->WCE = 0;
}
--
2.0.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH V2] sd: Reduce log level to KERN_NOTICE for missing caching mode page
2014-06-02 18:48 Alain Kalker
@ 2014-06-02 19:08 ` Alain Kalker
2014-06-02 19:14 ` James Bottomley
1 sibling, 0 replies; 7+ messages in thread
From: Alain Kalker @ 2014-06-02 19:08 UTC (permalink / raw)
To: linux-scsi; +Cc: James E.J. Bottomley, Martin K. Petersen
On 06/02/2014 08:48 PM, Alain Kalker wrote:
> Reduce the lernel log level to KERN_NOTICE for messages related
> to a missing caching mode page.
There is an open bug report at kernel.org (dating all the way back to
Linux 2.6.34.1) about this:
Bug 16490 – "Assuming drive cache: write through" messages probably have
wrong loglevel : https://bugzilla.kernel.org/show_bug.cgi?id=16490
Also, many people are asking questions about this on internet fora,
submitting bug reports to bugtrackers for their distributions,
apparently the error log level makes them think their system is
malfunctioning in some way.
> Reasons why I think this change is justified:
> - The condition is not an error; the existing workaround of assuming
> a write through cache doesn't limit functionality in any way.
> - It doesn't warrant a warning either: as it is most likely
> a hardware limitation, there is little that an ordinary user can do
> about it besides replacing the affected hardware.
> Making it a warning would still break quiet boot (kernel commandline
> parameter 'quiet'), and may still trip log monitoring software
> unneccessarily, either on every boot or whenever an affected
> external device is plugged in.
> - It should be a notice, for it is a normal but significant condition,
> as it may impact write performance. This would bring it on par with
> the log messages in the same function.
>
> Signed-off-by: Alain Kalker <a.c.kalker@gmail.com>
> ---
> 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 efcbcd1..5f0f6c6 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -2442,7 +2442,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_NOTICE, sdkp, "No Caching mode page found\n");
> goto defaults;
>
> Page_found:
> @@ -2489,7 +2489,7 @@ defaults:
> "Assuming drive cache: write back\n");
> sdkp->WCE = 1;
> } else {
> - sd_first_printk(KERN_ERR, sdkp,
> + sd_first_printk(KERN_NOTICE, sdkp,
> "Assuming drive cache: write through\n");
> sdkp->WCE = 0;
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2] sd: Reduce log level to KERN_NOTICE for missing caching mode page
2014-06-02 18:48 Alain Kalker
2014-06-02 19:08 ` Alain Kalker
@ 2014-06-02 19:14 ` James Bottomley
2014-06-02 19:31 ` Alain Kalker
1 sibling, 1 reply; 7+ messages in thread
From: James Bottomley @ 2014-06-02 19:14 UTC (permalink / raw)
To: Alain Kalker; +Cc: linux-scsi, Martin K. Petersen
On Mon, 2014-06-02 at 20:48 +0200, Alain Kalker wrote:
> Reduce the lernel log level to KERN_NOTICE for messages related
> to a missing caching mode page.
>
> Reasons why I think this change is justified:
> - The condition is not an error; the existing workaround of assuming
> a write through cache doesn't limit functionality in any way.
That's not actually correct. The condition may be an error. We have
some USB attached storage devices with writeback caches which don't
supply caching information. Treating a writeback device as writethrough
is a potential error because you may lose data as a result of it.
The error is that we've made an assumption which may damage your data.
The problem for us is that we can't tell if the assumption is going to
be fatal or not ... the message is harmless for older USB devices.
> - It doesn't warrant a warning either: as it is most likely
> a hardware limitation, there is little that an ordinary user can do
> about it besides replacing the affected hardware.
> Making it a warning would still break quiet boot (kernel commandline
> parameter 'quiet'), and may still trip log monitoring software
> unneccessarily, either on every boot or whenever an affected
> external device is plugged in.
> - It should be a notice, for it is a normal but significant condition,
> as it may impact write performance. This would bring it on par with
> the log messages in the same function.
But this message may serve a purpose: If you see it and you find you do
have a USB device with a writeback cache, you can set the boot system to
correct the cache type assumption and we'll send the correcting
synchronize cache commands.
It certainly helps bug triagers identify issues which may require adding
a particular device to the list that need to be treated as writeback.
James
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2] sd: Reduce log level to KERN_NOTICE for missing caching mode page
2014-06-02 19:14 ` James Bottomley
@ 2014-06-02 19:31 ` Alain Kalker
0 siblings, 0 replies; 7+ messages in thread
From: Alain Kalker @ 2014-06-02 19:31 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi, Martin K. Petersen
On 06/02/2014 09:14 PM, James Bottomley wrote:
> On Mon, 2014-06-02 at 20:48 +0200, Alain Kalker wrote:
>> Reduce the lernel log level to KERN_NOTICE for messages related
>> to a missing caching mode page.
>>
>> Reasons why I think this change is justified:
>> - The condition is not an error; the existing workaround of assuming
>> a write through cache doesn't limit functionality in any way.
>
> That's not actually correct. The condition may be an error. We have
> some USB attached storage devices with writeback caches which don't
> supply caching information. Treating a writeback device as writethrough
> is a potential error because you may lose data as a result of it.
Aha, I thought that the write through treatment would always make sure
that the device has written all the data before returning. If that's not
always true, then I agree that the condition could be an error.
> The error is that we've made an assumption which may damage your data.
>
> The problem for us is that we can't tell if the assumption is going to
> be fatal or not ... the message is harmless for older USB devices.
I think that I wrongly assumed that only (older?) writethrough devices
might not return caching information. If there are also writeback
devices which don't return (correct) information, then I have to agree.
>> - It doesn't warrant a warning either: as it is most likely
>> a hardware limitation, there is little that an ordinary user can do
>> about it besides replacing the affected hardware.
>> Making it a warning would still break quiet boot (kernel commandline
>> parameter 'quiet'), and may still trip log monitoring software
>> unneccessarily, either on every boot or whenever an affected
>> external device is plugged in.
>> - It should be a notice, for it is a normal but significant condition,
>> as it may impact write performance. This would bring it on par with
>> the log messages in the same function.
>
> But this message may serve a purpose: If you see it and you find you do
> have a USB device with a writeback cache, you can set the boot system to
> correct the cache type assumption and we'll send the correcting
> synchronize cache commands.
Very informative, thanks!
I do think that this should be documented somewhere, especially with
regard to the risk of data loss. People might think that falling back on
writethrough is always a 'safe bet' where it actually might not be.
> It certainly helps bug triagers identify issues which may require adding
> a particular device to the list that need to be treated as writeback.
Thanks for your feedback, much appreciated.
Alain
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-06-02 19:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-02 10:46 [PATCH] sd: Reduce log level to KERN_NOTICE for missing caching mode page Alain Kalker
2014-06-02 11:51 ` Alain Kalker
2014-06-02 12:10 ` [PATCH V2] " Alain Kalker
-- strict thread matches above, loose matches on Subject: below --
2014-06-02 18:48 Alain Kalker
2014-06-02 19:08 ` Alain Kalker
2014-06-02 19:14 ` James Bottomley
2014-06-02 19:31 ` Alain Kalker
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).