From patchwork Mon Aug 6 04:51:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Gilbert X-Patchwork-Id: 10556481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B56314E2 for ; Mon, 6 Aug 2018 04:51:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B4AB28FFB for ; Mon, 6 Aug 2018 04:51:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F380729007; Mon, 6 Aug 2018 04:51:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2E9828FFB for ; Mon, 6 Aug 2018 04:51:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726931AbeHFG6q (ORCPT ); Mon, 6 Aug 2018 02:58:46 -0400 Received: from smtp.infotech.no ([82.134.31.41]:35036 "EHLO smtp.infotech.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726894AbeHFG6o (ORCPT ); Mon, 6 Aug 2018 02:58:44 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp.infotech.no (Postfix) with ESMTP id 54CB220423B; Mon, 6 Aug 2018 06:51:27 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.6 (20110518) (Debian) at infotech.no Received: from smtp.infotech.no ([127.0.0.1]) by localhost (smtp.infotech.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AMPzTpQjtWMp; Mon, 6 Aug 2018 06:51:26 +0200 (CEST) Received: from xtwo70.bingwo.ca (host-45-58-245-67.dyn.295.ca [45.58.245.67]) by smtp.infotech.no (Postfix) with ESMTPA id BA07F20423F; Mon, 6 Aug 2018 06:51:24 +0200 (CEST) From: Douglas Gilbert To: linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, hare@suse.de, bart.vanassche@wdc.com, jthumshirn@suse.de Subject: [RFC PATCH 5/5] make sd_done() REQ_OP_FLUSH handling explicit Date: Mon, 6 Aug 2018 00:51:15 -0400 Message-Id: <20180806045115.7725-6-dgilbert@interlog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180806045115.7725-1-dgilbert@interlog.com> References: <20180806045115.7725-1-dgilbert@interlog.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP REQ_OP_FLUSH appears in the submission path processing but not in the response path processing. Hence it takes the "default" case which seems to be designed for REQ_OP_READ and REQ_OP_WRITE. So add a REQ_OP_FLUSH case to the response path. Signed-off-by: Douglas Gilbert --- Is it correct to treat REQ_OP_FLUSH like the other OPs that may send but never return data (as in a READ's data-in)? Should this be fixed separately in the mainline? drivers/scsi/sd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 05014054e357..9cf88392e994 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2007,6 +2007,7 @@ static int sd_done(struct scsi_cmnd *SCpnt) } } else { switch (req_op(req)) { + case REQ_OP_FLUSH: case REQ_OP_DISCARD: case REQ_OP_WRITE_ZEROES: case REQ_OP_WRITE_SAME: