From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753517AbdKHV3z (ORCPT ); Wed, 8 Nov 2017 16:29:55 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41928 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752842AbdKHV3x (ORCPT ); Wed, 8 Nov 2017 16:29:53 -0500 Subject: Re: [PATCH 1/6] target: Fix QUEUE_FULL + SCSI task attribute handling To: "Nicholas A. Bellinger" , target-devel Cc: linux-scsi , lkml , Michael Cyr , Mike Christie , Hannes Reinecke References: <1510115512-15617-1-git-send-email-nab@linux-iscsi.org> <1510115512-15617-2-git-send-email-nab@linux-iscsi.org> From: "Bryant G. Ly" Date: Wed, 8 Nov 2017 15:29:45 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1510115512-15617-2-git-send-email-nab@linux-iscsi.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 17110821-0044-0000-0000-000003AC5928 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008033; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00943072; UDB=6.00475781; IPR=6.00723359; BA=6.00005679; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017916; XFM=3.00000015; UTC=2017-11-08 21:29:49 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110821-0045-0000-0000-000007DB72C3 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-08_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711080282 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Nicholas Bellinger > > This patch fixes a bug during QUEUE_FULL where transport_complete_qf() > calls transport_complete_task_attr() after it's already been invoked > by target_complete_ok_work() or transport_generic_request_failure() > during initial completion, preceeding QUEUE_FULL. > > This will result in se_device->simple_cmds, se_device->dev_cur_ordered_id > and/or se_device->dev_ordered_sync being updated multiple times for > a single se_cmd. > > To address this bug, clear SCF_TASK_ATTR_SET after the first call > to transport_complete_task_attr(), and avoid updating SCSI task > attribute related counters for any subsequent calls. > > Also, when a se_cmd is deferred due to ordered tags and executed > via target_restart_delayed_cmds(), set CMD_T_SENT before execution > matching what target_execute_cmd() does. > > Cc: Michael Cyr > Cc: Bryant G. Ly > Cc: Mike Christie > Cc: Hannes Reinecke > Signed-off-by: Nicholas Bellinger > --- > Reviewed-by: Bryant G. Ly