Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751741AbbGaGo1 (ORCPT ); Fri, 31 Jul 2015 02:44:27 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:37357 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751216AbbGaGoZ (ORCPT ); Fri, 31 Jul 2015 02:44:25 -0400 Message-ID: <1438325063.16598.15.camel@haakon3.risingtidesystems.com> Subject: Re: [PATCH] target: allow underflow/overflow for PR OUT etc. commands From: "Nicholas A. Bellinger" To: Spencer Baugh Cc: "open list:TARGET SUBSYSTEM" , "open list:TARGET SUBSYSTEM" , open list , Joern Engel , Spencer Baugh , Roland Dreier Date: Thu, 30 Jul 2015 23:44:23 -0700 In-Reply-To: <1437602898-15229-4-git-send-email-sbaugh@catern.com> References: <1437602898-15229-4-git-send-email-sbaugh@catern.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1695 Lines: 42 On Wed, 2015-07-22 at 15:08 -0700, Spencer Baugh wrote: > From: Roland Dreier > > It's not necessarily a fatal error if a command with a data-out phase > has a data length that differs from the transport data length (e.g. > PERSISTENT RESERVE OUT might have a parameter list length in the CDB > that's smaller than the FC_DL field), so allow these commands. The > Windows compliance test sends them. > > Signed-off-by: Roland Dreier > Signed-off-by: Spencer Baugh > --- > drivers/target/target_core_transport.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c > index ac002a7..f6626bb 100644 > --- a/drivers/target/target_core_transport.c > +++ b/drivers/target/target_core_transport.c > @@ -1087,9 +1087,9 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size) > " 0x%02x\n", cmd->se_tfo->get_fabric_name(), > cmd->data_length, size, cmd->t_task_cdb[0]); > > - if (cmd->data_direction == DMA_TO_DEVICE) { > - pr_err("Rejecting underflow/overflow" > - " WRITE data\n"); > + if (cmd->data_direction == DMA_TO_DEVICE && > + cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) { > + pr_err("Rejecting underflow/overflow WRITE data\n"); > return TCM_INVALID_CDB_FIELD; > } > /* Applied to target-pending/for-next. Thanks Roland & Co. -- 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/