From: Nicholas Krause <uboot477@gmail.com>
To: JBottomley@odin.com
Cc: davem@davemloft.net, hariprasad@chelsio.com,
praveenm@chelsio.com, thenzl@redhat.com,
dan.carpenter@oracle.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org,
Nicholas Krause <xerofoify@gmail.com>
Subject: [PATCH] csiostor:Fix error handling in the function csio_hws_ready
Date: Tue, 4 Aug 2015 22:42:06 -0400 [thread overview]
Message-ID: <1438742526-28530-1-git-send-email-uboot477@gmail.com> (raw)
From: Nicholas Krause <xerofoify@gmail.com>
This fixes error handling in the function csio_hws_ready for when
this function calls csio_scim_cleanup_io to cleanup outstanding
commands by checking if it cleaned a error code to signal internal
failure and if so tell the user we are unable to clean up the
outstanding io commands by printing this to the console before
Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
drivers/scsi/csiostor/csio_hw.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
index 622bdab..49c47d3 100644
--- a/drivers/scsi/csiostor/csio_hw.c
+++ b/drivers/scsi/csiostor/csio_hw.c
@@ -2445,11 +2445,17 @@ csio_hws_ready(struct csio_hw *hw, enum csio_hw_ev evt)
csio_set_state(&hw->sm, csio_hws_quiescing);
/* cleanup all outstanding cmds */
if (evt == CSIO_HWE_HBA_RESET ||
- evt == CSIO_HWE_PCIERR_DETECTED)
- csio_scsim_cleanup_io(csio_hw_to_scsim(hw), false);
- else
- csio_scsim_cleanup_io(csio_hw_to_scsim(hw), true);
-
+ evt == CSIO_HWE_PCIERR_DETECTED) {
+ if (csio_scsim_cleanup_io(csio_hw_to_scsim(hw), false)) {
+ csio_err(hw, "Unable to properly cleanup outstanding commands on this device\n");
+ return;
+ }
+ } else {
+ if (csio_scsim_cleanup_io(csio_hw_to_scsim(hw), true)) {
+ csio_err(hw, "Unable to properly cleanup outstanding commands on this device\n");
+ return;
+ }
+ }
csio_hw_intr_disable(hw);
csio_hw_mbm_cleanup(hw);
csio_evtq_stop(hw);
--
2.1.4
reply other threads:[~2015-08-05 2:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1438742526-28530-1-git-send-email-uboot477@gmail.com \
--to=uboot477@gmail.com \
--cc=JBottomley@odin.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=hariprasad@chelsio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=praveenm@chelsio.com \
--cc=thenzl@redhat.com \
--cc=xerofoify@gmail.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;
as well as URLs for NNTP newsgroup(s).