All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alain Kalker <a.c.kalker@gmail.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH V2] sd: Reduce log level to KERN_NOTICE for missing caching mode page
Date: Mon, 02 Jun 2014 21:31:28 +0200	[thread overview]
Message-ID: <538CD110.5040605@gmail.com> (raw)
In-Reply-To: <1401736473.12939.10.camel@dabdike.int.hansenpartnership.com>

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

  reply	other threads:[~2014-06-02 19:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 18:48 [PATCH V2] sd: Reduce log level to KERN_NOTICE for missing caching mode page Alain Kalker
2014-06-02 19:08 ` Alain Kalker
2014-06-02 19:14 ` James Bottomley
2014-06-02 19:31   ` Alain Kalker [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-06-02 11:51 [PATCH] " Alain Kalker
2014-06-02 12:10 ` [PATCH V2] " Alain Kalker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=538CD110.5040605@gmail.com \
    --to=a.c.kalker@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.