From patchwork Fri Oct 25 00:50:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 3094081 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 9C87D9F2B7 for ; Fri, 25 Oct 2013 00:57:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9476220258 for ; Fri, 25 Oct 2013 00:57:13 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mail.kernel.org (Postfix) with ESMTP id 804B820251 for ; Fri, 25 Oct 2013 00:57:12 +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 r9P0pBpN020734; Thu, 24 Oct 2013 20:51:13 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9P0p9G7030427 for ; Thu, 24 Oct 2013 20:51:09 -0400 Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9P0p9SK030721 for ; Thu, 24 Oct 2013 20:51:09 -0400 Received: from sabe.cs.wisc.edu (sabe.cs.wisc.edu [128.105.6.20]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9P0p8mj011231 for ; Thu, 24 Oct 2013 20:51:08 -0400 Received: from localhost.localdomain (c-24-245-27-162.hsd1.mn.comcast.net [24.245.27.162]) (authenticated bits=0) by sabe.cs.wisc.edu (8.14.1/8.14.1) with ESMTP id r9P0p0aq029989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Oct 2013 19:51:06 -0500 From: michaelc@cs.wisc.edu To: dm-devel@redhat.com, christophe.varoqui@gmail.com Date: Thu, 24 Oct 2013 19:50:55 -0500 Message-Id: <1382662255-7861-1-git-send-email-michaelc@cs.wisc.edu> X-RedHat-Spam-Score: -1.495 (BAYES_00, RP_MATCHES_RCVD, SPF_NEUTRAL, URIBL_BLOCKED) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.21 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH] multipathd: revert mpp size update if map update fails 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: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-7.3 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 From: Mike Christie If updating the dm device in the kernel fails we cannot leave the mpp size updated, because if we correct the problem and try to resize later multipathd prevents resizing the device of the size has not changed. I hit this when all paths to a dm-multipath device where not yet updated but multipathd resize was run. Signed-off-by: Mike Christie --- multipathd/cli_handlers.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index 4b860bb..58a5643 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -567,6 +567,7 @@ int resize_map(struct multipath *mpp, unsigned long long size, struct vectors * vecs) { char params[PARAMS_SIZE] = {0}; + unsigned long long orig_size = mpp->size; mpp->size = size; update_mpp_paths(mpp, vecs->pathvec); @@ -575,6 +576,7 @@ int resize_map(struct multipath *mpp, unsigned long long size, if (domap(mpp, params) <= 0) { condlog(0, "%s: failed to resize map : %s", mpp->alias, strerror(errno)); + mpp->size = orig_size; return 1; } return 0;