Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752852Ab3HZWUr (ORCPT ); Mon, 26 Aug 2013 18:20:47 -0400 Received: from mail-oa0-f45.google.com ([209.85.219.45]:63908 "EHLO mail-oa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752685Ab3HZWTX (ORCPT ); Mon, 26 Aug 2013 18:19:23 -0400 From: "Nicholas A. Bellinger" To: target-devel Cc: lkml , linux-scsi , Christoph Hellwig , Hannes Reinecke , Martin Petersen , Chris Mason , Roland Dreier , Zach Brown , Kent Overstreet , Theodore Tso , James Bottomley , Nicholas Bellinger , Nicholas Bellinger Subject: [PATCH-v2 5/9] target: Avoid non-existent tg_pt_gp_mem in target_alua_state_check Date: Mon, 26 Aug 2013 22:03:04 +0000 Message-Id: <1377554588-28394-6-git-send-email-nab@daterainc.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1377554588-28394-1-git-send-email-nab@daterainc.com> References: <1377554588-28394-1-git-send-email-nab@daterainc.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1530 Lines: 41 From: Nicholas Bellinger This patch adds an check for a non-existent port->sep_alua_tg_pt_gp_mem within target_alua_state_check(), which is not present for internally dispatched EXTENDED_COPY WRITE I/O to the destination target port. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Martin Petersen Cc: Chris Mason Cc: Roland Dreier Cc: Zach Brown Cc: James Bottomley Cc: Nicholas Bellinger Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_alua.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index 5403186..ea928c4 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c @@ -557,6 +557,9 @@ target_alua_state_check(struct se_cmd *cmd) * a ALUA logical unit group. */ tg_pt_gp_mem = port->sep_alua_tg_pt_gp_mem; + if (!tg_pt_gp_mem) + return 0; + spin_lock(&tg_pt_gp_mem->tg_pt_gp_mem_lock); tg_pt_gp = tg_pt_gp_mem->tg_pt_gp; out_alua_state = atomic_read(&tg_pt_gp->tg_pt_gp_alua_access_state); -- 1.7.2.5 -- 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/