From: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
To: David Dillow <dave-i1Mk8JYDVaaSihdK6806/g@public.gmane.org>
Cc: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Vu Pham <vuhuong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Sebastian Riemer
<sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>,
linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 3/6] IB/srp: Fail SCSI commands silently
Date: Mon, 24 Feb 2014 20:58:46 +0100 [thread overview]
Message-ID: <530BA476.7040005@acm.org> (raw)
In-Reply-To: <1393047697.12377.11.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
On 02/22/14 06:41, David Dillow wrote:
> I didn't suggest that -- I'm saying add a common functionality to turn
> on/off the message printing for commands that failed due to a dead
> transport. If it is useful for SRP initiators, it is probably useful for
> SAS and iSCSI imitators as well.
>
> At a quick look, it seems you need to add a new value to the
> rq_flag_bits enum in include/linux/blk_types.h, __REQ_FAILED_TRANSPORT,
> somewhere before __REQ_NR_BITS. And a #define in the style of those
> following it. Use that flag instead of REQ_QUIET in the patch we are
> discussing, and change the code in scsi_lib.c to check
>
> ((req->cmd_flags & REQ_FAILED_TRANSPORT) && $user_wants_this_knob) || !(req->cmd_flags & REQ_QUIET)
>
> before calling scsi_print_sense(), with appropriate naming, of course.
> This gives you a central place to control it, and allows for consistency
> between initiators.
>
> I agree it is much easier to just fix it in SRP, especially given the
> glacial rate of change for the SCSI mid-layer, but I really think a
> central control and driver-by-driver enablement would be the best
> approach. YMMV.
Hello Dave,
That makes sense to me. Do you think the (untested) patch below could
be a valid alternative to the above proposal ?
---
drivers/scsi/scsi_lib.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 7bd7f0d..124ab53 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -857,7 +857,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
*/
if ((sshdr.asc == 0x0) && (sshdr.ascq == 0x1d))
;
- else if (!(req->cmd_flags & REQ_QUIET))
+ else if (cmd->device->sdev_state != SDEV_TRANSPORT_OFFLINE &&
+ !(req->cmd_flags & REQ_QUIET))
scsi_print_sense("", cmd);
result = 0;
/* BLOCK_PC may have set error */
--
1.8.4.5
Thanks,
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-02-24 19:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-20 10:50 [PATCH 0/6] SRP initiator patches for kernel 3.15 Bart Van Assche
[not found] ` <5305DE01.7030004-HInyCGIudOg@public.gmane.org>
2014-02-20 10:51 ` [PATCH 1/6] scsi_transport_srp: Fix two kernel-doc warnings Bart Van Assche
[not found] ` <5305DE2C.4080203-HInyCGIudOg@public.gmane.org>
2014-02-20 12:01 ` Sebastian Riemer
2014-02-20 10:52 ` [PATCH 3/6] IB/srp: Fail SCSI commands silently Bart Van Assche
[not found] ` <5305DE67.9070805-HInyCGIudOg@public.gmane.org>
2014-02-20 10:57 ` Bart Van Assche
2014-02-21 3:55 ` David Dillow
[not found] ` <1392954937.26557.3.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2014-02-21 9:23 ` Bart Van Assche
[not found] ` <53071B2E.2050302-HInyCGIudOg@public.gmane.org>
2014-02-22 5:41 ` David Dillow
[not found] ` <1393047697.12377.11.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2014-02-24 19:58 ` Bart Van Assche [this message]
[not found] ` <530BA476.7040005-HInyCGIudOg@public.gmane.org>
2014-02-25 4:36 ` David Dillow
[not found] ` <1393302995.9096.1.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2014-02-25 10:33 ` Bart Van Assche
[not found] ` <530C7175.5060907-HInyCGIudOg@public.gmane.org>
2014-02-26 6:32 ` David Dillow
[not found] ` <1393396377.12328.5.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2014-02-26 13:16 ` Bart Van Assche
[not found] ` <530DE93A.2040400-HInyCGIudOg@public.gmane.org>
2014-02-27 5:48 ` David Dillow
[not found] ` <1393480118.16410.10.camel-a7a0dvSY7KqLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2014-02-27 13:44 ` Bart Van Assche
2014-02-20 10:53 ` [PATCH 4/6] IB/srp: Avoid duplicate connections Bart Van Assche
2014-02-20 10:54 ` [PATCH 5/6] IB/srp: Make writing into the "add_target" sysfs attribute interruptible Bart Van Assche
2014-02-20 10:55 ` [PATCH 6/6] IB/srp: Avoid that writing into "add_target" hangs due to a cable pull Bart Van Assche
2014-02-20 10:56 ` [PATCH 2/6] IB/srp: Add more logging Bart Van Assche
2014-02-21 3:36 ` [PATCH 0/6] SRP initiator patches for kernel 3.15 Vasiliy Tolstov
[not found] ` <CACaajQt5FVw-8rVhM1jwZPORGNdrAkTf-Gi3NdkKRnQaYde48Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-21 12:20 ` Bart Van Assche
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=530BA476.7040005@acm.org \
--to=bvanassche-hinycgiudog@public.gmane.org \
--cc=dave-i1Mk8JYDVaaSihdK6806/g@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org \
--cc=vuhuong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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.