From patchwork Tue Oct 13 04:02:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 53294 X-Patchwork-Delegate: snitzer@redhat.com Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9D42d5M010935 for ; Tue, 13 Oct 2009 04:02:39 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 925E961910F; Tue, 13 Oct 2009 00:02:37 -0400 (EDT) Received: from int-mx04.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n9D42Z7Y027902 for ; Tue, 13 Oct 2009 00:02:36 -0400 Received: from localhost.localdomain (vpn-12-29.rdu.redhat.com [10.11.12.29]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9D42Y4W013270; Tue, 13 Oct 2009 00:02:35 -0400 From: michaelc@cs.wisc.edu To: linux-scsi@vger.kernel.org, dm-devel@redhat.com Date: Mon, 12 Oct 2009 23:02:33 -0500 Message-Id: <1255406553-7054-1-git-send-email-michaelc@cs.wisc.edu> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-loop: dm-devel@redhat.com Cc: Mike Christie Subject: [dm-devel] [PATCH 1/1] RFC: scsi/dm-mpath: return -EACCES on reservation conflict X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 32d0b87..93e6ce5 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -1214,7 +1214,7 @@ static int do_end_io(struct multipath *m, struct request *clone, if (!error && !clone->errors) return 0; /* I/O complete */ - if (error == -EOPNOTSUPP) + if (error == -EOPNOTSUPP || error == -EACCES) return error; if (mpio->pgpath) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 1086552..5635035 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -797,6 +797,10 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) * happens. */ action = ACTION_RETRY; + else if (status_byte(cmd->result) == RESERVATION_CONFLICT) { + error = -EACCES; + description = "Could not access device"; + action = ACTION_FAIL; } else if (sense_valid && !sense_deferred) { switch (sshdr.sense_key) { case UNIT_ATTENTION: