Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753397Ab3EUUEo (ORCPT ); Tue, 21 May 2013 16:04:44 -0400 Received: from mail-qa0-f43.google.com ([209.85.216.43]:52435 "EHLO mail-qa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753074Ab3EUUEm (ORCPT ); Tue, 21 May 2013 16:04:42 -0400 MIME-Version: 1.0 In-Reply-To: References: <20130429152639.GG32324@breakpoint.cc> Date: Tue, 21 May 2013 13:04:41 -0700 Message-ID: Subject: Re: "WRITE SAME failed. Manually zeroing" with 3w-xxxx driver From: adam radford To: "Martin K. Petersen" Cc: Florian Westphal , linux-scsi , linux-kernel , axboe@kernel.dk Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2751 Lines: 68 On Mon, Apr 29, 2013 at 9:13 AM, Martin K. Petersen wrote: >>>>>> "Florian" == Florian Westphal writes: > > Florian> After update to 3.8 dmesg is spammed with: kernel: [ > Florian> 280.272094] 3w-xxxx: scsi8: Unknown scsi opcode: 0x41 kernel: [ > Florian> 280.272107] sd 8:0:0:0: [sda] Unhandled error code kernel: > > Interesting. It looks like the 3ware handles this at the driver level > instead of passing the command through to the disk and letting it > fail. That in turn means that the logic we have in place to disable WS > when the disk does not support it does not get triggered. > > The driver should really fill out the sense buffer in that case. > > Could you please test the patch below? > > > Florian> This goes on and on. > > The second question is what it is that's issuing these zeroouts at boot? > Which filesystem are you using? What's your DM/MD config? > > -- > Martin K. Petersen Oracle Linux Engineering > > > 3w-xxxx: Create sense buffer for unsupported commands > > Make the driver return appropriate sense data when an unsupported > operation is queued. This will cause the SCSI layer to stop issuing the > offending command. > > Reported-by: Florian Westphal > CC: adam radford > Signed-off-by: Martin K. Petersen > > diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c > index 56662ae..b9276d1 100644 > --- a/drivers/scsi/3w-xxxx.c > +++ b/drivers/scsi/3w-xxxx.c > @@ -216,6 +216,7 @@ > #include > #include > #include > +#include > #include "3w-xxxx.h" > > /* Globals */ > @@ -2009,7 +2010,8 @@ static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_c > printk(KERN_NOTICE "3w-xxxx: scsi%d: Unknown scsi opcode: 0x%x\n", tw_dev->host->host_no, *command); > tw_dev->state[request_id] = TW_S_COMPLETED; > tw_state_request_finish(tw_dev, request_id); > - SCpnt->result = (DID_BAD_TARGET << 16); > + SCpnt->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; > + scsi_build_sense_buffer(1, SCpnt->sense_buffer, ILLEGAL_REQUEST, 0x20, 0); > done(SCpnt); > retval = 0; > } Thanks Martin. This patch looks good. Acked-by: Adam Radford -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/