From patchwork Tue Jan 17 05:11:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 136391 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 37B95B6EE6 for ; Tue, 17 Jan 2012 16:11:34 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751106Ab2AQFLb (ORCPT ); Tue, 17 Jan 2012 00:11:31 -0500 Received: from mga11.intel.com ([192.55.52.93]:49810 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931Ab2AQFL2 (ORCPT ); Tue, 17 Jan 2012 00:11:28 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 16 Jan 2012 21:11:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="107794133" Received: from dwillia2-linux.jf.intel.com (HELO dwillia2-linux.localdomain) ([10.23.45.73]) by fmsmga001.fm.intel.com with ESMTP; 16 Jan 2012 21:11:27 -0800 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by dwillia2-linux.localdomain (Postfix) with ESMTP id B0B9F500248; Mon, 16 Jan 2012 21:11:27 -0800 (PST) Subject: [PATCH v4 05/10] libsas: check for 'gone' expanders in smp_execute_task() To: linux-scsi@vger.kernel.org From: Dan Williams Cc: linux-ide@vger.kernel.org Date: Mon, 16 Jan 2012 21:11:27 -0800 Message-ID: <20120117051127.22344.52386.stgit@localhost6.localdomain6> In-Reply-To: <20120117050847.22344.4961.stgit@localhost6.localdomain6> References: <20120117050847.22344.4961.stgit@localhost6.localdomain6> User-Agent: StGit/0.15-7-g9bfb-dirty MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org No sense in issuing or retrying commands to an expander that has been removed. Signed-off-by: Dan Williams --- drivers/scsi/libsas/sas_expander.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 7701ab5..6fb1f3a 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -74,6 +74,11 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size, mutex_lock(&dev->ex_dev.cmd_mutex); for (retry = 0; retry < 3; retry++) { + if (test_bit(SAS_DEV_GONE, &dev->state)) { + res = -ECOMM; + break; + } + task = sas_alloc_task(GFP_KERNEL); if (!task) { res = -ENOMEM;