From patchwork Mon Jul 1 09:12:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junichi Nomura X-Patchwork-Id: 2806561 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AE55F9F3EB for ; Mon, 1 Jul 2013 09:17:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA92B20159 for ; Mon, 1 Jul 2013 09:17:37 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mail.kernel.org (Postfix) with ESMTP id 68E0420158 for ; Mon, 1 Jul 2013 09:17:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r619E3bV031849; Mon, 1 Jul 2013 05:14:04 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r619E1Gr030194 for ; Mon, 1 Jul 2013 05:14:01 -0400 Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.19]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r619E0Ax014160 for ; Mon, 1 Jul 2013 05:14:00 -0400 Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [210.143.35.52]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r619Dw3I021253 for ; Mon, 1 Jul 2013 05:13:59 -0400 Received: from mailgate3.nec.co.jp ([10.7.69.160]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id r619DfXH022946; Mon, 1 Jul 2013 18:13:41 +0900 (JST) Received: from mailsv3.nec.co.jp (imss63.nec.co.jp [10.7.69.158]) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) with ESMTP id r619Dfp08368; Mon, 1 Jul 2013 18:13:41 +0900 (JST) Received: from mail03.kamome.nec.co.jp (mail03.kamome.nec.co.jp [10.25.43.7]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id r619DPTB010157; Mon, 1 Jul 2013 18:13:41 +0900 (JST) Received: from shoin.jp.nec.com ([10.26.220.3] [10.26.220.3]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-409953; Mon, 1 Jul 2013 18:12:51 +0900 Received: from xzibit.linux.bs1.fc.nec.co.jp ([10.34.125.175] [10.34.125.175]) by mail.jp.nec.com with ESMTP; Mon, 1 Jul 2013 18:12:51 +0900 Message-ID: <51D14813.6070803@ce.jp.nec.com> Date: Mon, 01 Jul 2013 18:12:51 +0900 From: "Jun'ichi Nomura" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Hannes Reinecke References: <1372666331-66996-1-git-send-email-hare@suse.de> <1372666331-66996-5-git-send-email-hare@suse.de> In-Reply-To: <1372666331-66996-5-git-send-email-hare@suse.de> X-RedHat-Spam-Score: -4.602 (BAYES_00, DCC_REPUT_00_12, RCVD_IN_DNSWL_MED, SPF_HELO_PASS, SPF_PASS) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.19 X-loop: dm-devel@redhat.com Cc: Theodore Tso , linux-scsi@vger.kernel.org, Dave Chinner , James Bottomley , device-mapper development , Ren Mingxin , linux-fsdevel@vger.kernel.org Subject: Re: [dm-devel] [PATCH 4/5] scsi: Return ENODATA on medium error X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 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 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 07/01/13 17:12, Hannes Reinecke wrote: > When a medium error is detected the SCSI stack should return > ENODATA to the upper layers. Hi Hannes, since you change the error code from -EREMOTEIO to -ENODATA/-ENOSPC, upper layers that checks -EREMOTEIO have to be updated as well. Something like below for dm-multipath. It seems btrfs checking -EREMOTEIO, too. diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index bdf26f5..15bf881 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -1261,6 +1261,21 @@ static void activate_path(struct work_struct *work) pg_init_done, pgpath); } +static int maybe_path_failure(int error) +{ + switch(error) { + case -EOPNOTSUPP: + case -EREMOTEIO: + case -EILSEQ: + case -ENOSPC: + case -ENODATA: + return 0; + } + + /* Anything else could be a path failure */ + return 1; +} + /* * end_io handling */ @@ -1284,7 +1299,7 @@ static int do_end_io(struct multipath *m, struct request *clone, if (!error && !clone->errors) return 0; /* I/O complete */ - if (error == -EOPNOTSUPP || error == -EREMOTEIO || error == -EILSEQ) + if (!maybe_path_failure(error)) return error; if (mpio->pgpath)