From: Brian King <brking@us.ibm.com>
To: "Dailey, Nate" <Nate.Dailey@stratus.com>
Cc: Kai.Makisara@kolumbus.fi, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] drivers/scsi/st.c: add reference count and related fixes
Date: Wed, 06 Jul 2005 15:01:02 -0500 [thread overview]
Message-ID: <42CC387E.7050800@us.ibm.com> (raw)
In-Reply-To: <92952AEF1F064042B6EF2522E0EEF437348354@EXNA.corp.stratus.com>
Dailey, Nate wrote:
> These patches (against a 2.6.9 kernel, Redhat AS 4) for st add a
> reference count, and fix a few bugs I hit during testing (administrative
> removes and cable pulls with IO in progress).
>
> The primary change is adding a kref to the Scsi_Tape structure, to avoid
> an oops when the tape drive is removed while open. This includes
> scsi_tape_get/put routines and scsi_tape_release, and changes to st_open
> and st_release. This is all based on the SCSI disk & CD reference
> counting code.
I've actually been working on a similar patch for mainline.
I'd be happy to send out my patch, which has the kref added to Scsi_Tape
and has been tested on current mainline. I haven't hit the additional
bugs you mentioned below, but am still testing different scenarios.
-Brian
>
>
> I hit some bugs while I was testing this code. Fixes for these are also
> included in the patch:
>
> - When an IO gets a "dead device" error, we need to check the rq_status
> to determine if the request actually completed (scsi_wait_req does
> this)... else there's no notification to the caller that the IO failed.
> There are two changes for this, one in st_do_scsi and one in
> write_behind_check.
>
> - When an async IO gets a "dead device" error, we're notified of the
> completion by the block layer (end_that_request_last), so last_SRpnt
> doesn't get set (as it would if the complete were done by
> st_sleep_done). So I changed how last_SRpnt is used to get around
> this... it's now set only for async IOs, just before the IO is issued
> (and nulled out when the IO comes back).
>
>
> I also hit the following problem when I briefly tested on a SUSE kernel
> (it wasn't in the Redhat kernel I did most of my testing with, but it is
> in 2.6.12):
>
> - In these kernels, we no longer get a "complete" from
> end_that_request_last when a device goes away and an IO is rejected. I
> therefore added to st_do_scsi (but it's commented in this patch) setting
> SRpnt->sr_request->end_io to blk_end_sync_rq, which will do the
> complete. Since blk_end_sync_rq nulls out rq->waiting, I changed
> st_do_scsi to wait on a local variable, and added a check for null in
> st_sleep_done (just in case).
>
>
> And just one more thing:
>
> - I noticed that in 2.6.12, there is what appears to be a bogus use of
> last_SRpnt in st_chk_result (this doesn't exist in the kernels I tested
> with). This would cause problems if these patches are ported to 2.6.12,
> because of how I changed the use of last_SRpnt. Either my code has to
> change, or st_chk_result shouldn't use last_SRpnt.
>
>
> Anyway... as I said, these are against a 2.6.9 kernel (Redhat AS 4). If
> you're interested, I could port these changes to 2.6.12... can't promise
> I'll be able to test with that kernel, though.
>
> Nate Dailey
> Stratus Technologies
>
>
> Signed-off-by: Nate Dailey <nate.dailey@stratus.com>
--
Brian King
eServer Storage I/O
IBM Linux Technology Center
next prev parent reply other threads:[~2005-07-06 20:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-05 17:10 [PATCH] drivers/scsi/st.c: add reference count and related fixes Dailey, Nate
2005-07-06 20:01 ` Brian King [this message]
2005-07-07 11:11 ` Kai Makisara
2005-07-07 13:24 ` Brian King
2005-07-07 17:06 ` Kai Makisara
-- strict thread matches above, loose matches on Subject: below --
2005-07-12 15:10 Dailey, Nate
2005-07-12 20:07 ` Kai Makisara
2005-07-13 19:12 Dailey, Nate
2005-07-25 19:54 ` Brian King
2005-08-02 10:40 ` Kai Makisara
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=42CC387E.7050800@us.ibm.com \
--to=brking@us.ibm.com \
--cc=Kai.Makisara@kolumbus.fi \
--cc=Nate.Dailey@stratus.com \
--cc=linux-scsi@vger.kernel.org \
/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.