public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <ltuikov@yahoo.com>
To: Tony Battersby <tonyb@cybernetics.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] [RFC] sd: make error handling more robust
Date: Fri, 1 Feb 2008 16:49:54 -0800 (PST)	[thread overview]
Message-ID: <668582.37066.qm@web31809.mail.mud.yahoo.com> (raw)
In-Reply-To: <47A38903.9010902@cybernetics.com>

--- On Fri, 2/1/08, Tony Battersby <tonyb@cybernetics.com> wrote:
> 
> I disagree only with this part of the commit:
> 
> -                       good_bytes = (error_sector -
> SCpnt->request->sector) << 9;
> -                       if (good_bytes < 0 || good_bytes
> >= this_count)
> -                               good_bytes = 0;
> 
> So it removed the sanity-check on good_bytes, which broke
> error handling
> for my out-of-spec RAID.

Tony, I explained to you the inequality this
is based on, and gave you a patch which tested
for it (hunk #2, 2 lines) and it also tried to
accommodate your complaint about RECOVERED ERROR
(hunk #1, 3 lines), residual rather, which James addressed and apparently(?) I misunderstood.

You then took hunk #2 (2 lines) of the patch I sent
you and submitted it as your own, and then I acked
"your" patch.

I think it would've been much clearer if you had
singled out the problems you were seeing with your
HW and sent a single problem with a single patch per
single email.

> My patch adds the check back,
> only doing it
> before the multiplication by the sector size rather than
> after.  That is
> also why I wanted to add an upper-bound check, to make sure
> that sd_done
> never returned good_bytes > xfer_size, but no one else
> agreed with that
> level of paranoia.

I think James' email explained why. He also gave an
alternative way to implement one-off behaviour.

> I guess the question is: if a disk drive returns RECOVERED
> ERROR with
> info_valid=1 and the sector number in the sense bytes, does
> that mean
> that the disk completed the command successfully and
> transferred all the
> data (and is reporting the sector number for information
> logging
> purposes only), or does it mean that it stopped reading or
> writing at
> the sector indicated in the sense data?

The former.  It is what 03aba2f7 implements.

>  I can't really
> say for sure, so
> I will leave the debate to others.

The answer is in SBC3 and also in 03aba2f7.

> BTW, your patch will result in sd_done returning good_bytes
> == 0 for the
> case where sense_key == RECOVERED ERROR &&
> info_valid == 0, which I
> think is probably wrong.

Tony, I tried to accommodate your complaints
in the email that started this thread, and thus
the patch that we asked you to try.  RECOVERED
ERROR is handled as per spec in 03aba2f7.

RECOVERED ERROR, info_valid = X, commit
03aba2f7 will return good_bytes = xfer_size,
as per SBC3.

> In this case I would return
> good_bytes == 0
> for hardware/medium error and good_bytes == xfer_size for
> recovered error.

For HARDWARE/MEDIUM ERROR, good_bytes is computed,
depending on sense data.
It is 0 <= good_bytes < xfer_size (latter strict inequality).

For RECOVERED ERROR, good_bytes = xfer_size,
as you can see in 03aba2f7.

> My hardware isn't returning "recovered error"
> or "no sense" sense keys;

Sorry, I assumed you were since you were talking
about it and your original patch touched it.

> I was just trying to improve the handling of these cases
> while I was
> looking at the function.
> Thus, there is no point for me to
> test your
> full patch.  My problem is now solved with the simplified
> patch I
> already posted.  If you want to push for the RECOVERED
> ERROR change,
> then go right ahead with your own patch, but I'm done.

No, I'm not pushing for anything.  I already
acked "your" patch.  I was merely trying to
accommodate the concerns you had, as I explained
above.

03aba2f7 stands with "your" simplified patch.

If you still think there is something wrong
with drivers/scsi/sd.c, a kernel log with a 
spec reference and a patch from you would be
most welcome I assure you.

   Luben


  reply	other threads:[~2008-02-02  0:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-01  1:24 [PATCH] [RFC] sd: make error handling more robust Luben Tuikov
2008-02-01 11:53 ` Luben Tuikov
2008-02-01 13:44   ` Salyzyn, Mark
2008-02-01 16:15     ` Tony Battersby
2008-02-01 15:46 ` Tony Battersby
2008-02-01 16:09   ` James Bottomley
2008-02-01 20:06   ` Luben Tuikov
2008-02-01 21:02     ` Tony Battersby
2008-02-02  0:49       ` Luben Tuikov [this message]
2008-02-04 14:34         ` Tony Battersby
2008-02-04 21:02           ` Luben Tuikov
  -- strict thread matches above, loose matches on Subject: below --
2008-01-31 21:31 Tony Battersby

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=668582.37066.qm@web31809.mail.mud.yahoo.com \
    --to=ltuikov@yahoo.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tonyb@cybernetics.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox