From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: SCSI eats error from flush failure during hot plug Date: Thu, 26 Jun 2014 08:02:08 -0700 Message-ID: <20140626150208.GA14887@infradead.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from bombadil.infradead.org ([198.137.202.9]:33405 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754832AbaFZPCI (ORCPT ); Thu, 26 Jun 2014 11:02:08 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: Steven Haber Cc: linux-scsi@vger.kernel.org Hi Steven, can you test the patch below? diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f7e3163..9b56e48 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -733,6 +733,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) scsi_next_command(cmd); return; } + } else if (req->cmd_flags & REQ_FLUSH) { + /* + * Flush request don't transfer data, so we can't try + * to complete the good bytes first before checking + * the error. + */ + if (result && !sense_deferred) + error = __scsi_error_from_host_byte(cmd, result); } /* no bidi support for !REQ_TYPE_BLOCK_PC yet */