From patchwork Tue Jul 26 01:16:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Snitzer X-Patchwork-Id: 9247503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CDF56607FD for ; Tue, 26 Jul 2016 01:16:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFC0C20453 for ; Tue, 26 Jul 2016 01:16:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B43C927813; Tue, 26 Jul 2016 01:16:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0D4C20453 for ; Tue, 26 Jul 2016 01:16:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754004AbcGZBPv (ORCPT ); Mon, 25 Jul 2016 21:15:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41297 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753755AbcGZBPu (ORCPT ); Mon, 25 Jul 2016 21:15:50 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D719C85376; Tue, 26 Jul 2016 01:15:49 +0000 (UTC) Received: from localhost (vpn-61-248.rdu2.redhat.com [10.10.61.248]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6Q1FmFY023690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Jul 2016 21:15:49 -0400 Date: Mon, 25 Jul 2016 21:16:07 -0400 From: Mike Snitzer To: Bart Van Assche Cc: device-mapper development , "linux-scsi@vger.kernel.org" Subject: Re: dm-mq and end_clone_request() Message-ID: <20160726011607.GA77078@redhat.com> References: <4ed669ed-beae-76a8-b806-a284565b327a@sandisk.com> <20160720140815.GA19045@redhat.com> <20160720142727.GA57399@redhat.com> <1ca6d31d-f175-9daa-9ddd-17d653851ceb@sandisk.com> <20160720183321.GA20223@redhat.com> <84d9dc64-0c10-ed1a-7bc1-e656874853a5@sandisk.com> <20160725175344.GA23000@redhat.com> <20160725212325.GA23961@redhat.com> <1490356d-2c0e-d94a-7a88-5e8bc89953ef@sandisk.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1490356d-2c0e-d94a-7a88-5e8bc89953ef@sandisk.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 26 Jul 2016 01:15:49 +0000 (UTC) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jul 25 2016 at 6:00P -0400, Bart Van Assche wrote: > On 07/25/2016 02:23 PM, Mike Snitzer wrote: > >So I'd be curious to know if your debugging has enabled you to identify > >exactly where in the dm-mapth.c code the -EIO return is being > >established. do_end_io() is the likely candidate -- but again the > >__must_push_back() check should prevent it and DM_ENDIO_REQUEUE should > >be returned. > > Hello Mike, > > Thanks for looking further into this. The pr_info() statement that I had > added in the following code block in __multipath_map() fired what told me > that the following code block triggered the -EIO return: > > if (!pgpath) { > if (!must_push_back(m)) > r = -EIO; /* Failed */ > pr_info("%s(): (a) returning %d\n", __func__, r); > return r; > } > > From the system log: > > kernel: mpath 254:0: queue_if_no_path 1 -> 0 > kernel: __multipath_map(): (a) returning -5 > > The code that I had added in queue_if_no_path() is as follows: > > old = test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags); > [ ... ] > pr_info("mpath %s: queue_if_no_path %d -> %d\n", > dm_device_name(dm_table_get_md(m->ti->table)), old, > queue_if_no_path); Hi Bart, Please try this patch to see if it fixes your issue, thanks. --- To unsubscribe from this list: send the line "unsubscribe linux-scsi" 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/md/dm-mpath.c b/drivers/md/dm-mpath.c index 52baf8a..287caa7 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -433,10 +433,17 @@ failed: */ static int must_push_back(struct multipath *m) { - return (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags) || - ((test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags) != - test_bit(MPATHF_SAVED_QUEUE_IF_NO_PATH, &m->flags)) && - dm_noflush_suspending(m->ti))); + bool r; + unsigned long flags; + + spin_lock_irqsave(&m->lock, flags); + r = (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags) || + ((test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags) != + test_bit(MPATHF_SAVED_QUEUE_IF_NO_PATH, &m->flags)) && + dm_noflush_suspending(m->ti))); + spin_unlock_irqrestore(&m->lock, flags); + + return r; } /*