From patchwork Tue Jan 8 13:53:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 1946341 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by patchwork2.kernel.org (Postfix) with ESMTP id DA762DF23A for ; Tue, 8 Jan 2013 14:00:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r08Dtwaj002299; Tue, 8 Jan 2013 08:55:58 -0500 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 r08DseN1004843 for ; Tue, 8 Jan 2013 08:54:40 -0500 Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.17]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r08DseE8027247 for ; Tue, 8 Jan 2013 08:54:40 -0500 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r08DsVxx010033 for ; Tue, 8 Jan 2013 08:54:31 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 405F8A51FD; Tue, 8 Jan 2013 14:54:28 +0100 (CET) From: Hannes Reinecke To: Christophe Varoqui Date: Tue, 8 Jan 2013 14:53:53 +0100 Message-Id: <1357653259-62650-16-git-send-email-hare@suse.de> In-Reply-To: <1357653259-62650-1-git-send-email-hare@suse.de> References: <1357653259-62650-1-git-send-email-hare@suse.de> X-RedHat-Spam-Score: -7.299 (BAYES_00, DCC_REPUT_00_12, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.17 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH 15/42] Clarify setting origin in propsel.c 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 We should differentiate between config file and internal default. And the controller settings are not defaults. Signed-off-by: Hannes Reinecke --- libmultipath/propsel.c | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index a02a644..b8c6b08 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @@ -282,8 +282,11 @@ select_features (struct multipath * mp) } else if (mp->hwe && mp->hwe->features) { mp->features = STRDUP(mp->hwe->features); origin = "controller setting"; - } else { + } else if (conf->features) { mp->features = STRDUP(conf->features); + origin = "config file default"; + } else { + mp->features = set_default(DEFAULT_FEATURES); origin = "internal default"; } condlog(3, "%s: features = %s (%s)", @@ -561,18 +564,22 @@ select_fast_io_fail(struct multipath *mp) if (mp->hwe && mp->hwe->fast_io_fail != MP_FAST_IO_FAIL_UNSET) { mp->fast_io_fail = mp->hwe->fast_io_fail; if (mp->fast_io_fail == MP_FAST_IO_FAIL_OFF) - condlog(3, "%s: fast_io_fail_tmo = off (controller default)", mp->alias); + condlog(3, "%s: fast_io_fail_tmo = off " + "(controller setting)", mp->alias); else - condlog(3, "%s: fast_io_fail_tmo = %d (controller default)", mp->alias, + condlog(3, "%s: fast_io_fail_tmo = %d " + "(controller setting)", mp->alias, mp->fast_io_fail == MP_FAST_IO_FAIL_ZERO ? 0 : mp->fast_io_fail); return 0; } if (conf->fast_io_fail != MP_FAST_IO_FAIL_UNSET) { mp->fast_io_fail = conf->fast_io_fail; if (mp->fast_io_fail == MP_FAST_IO_FAIL_OFF) - condlog(3, "%s: fast_io_fail_tmo = off (config file default)", mp->alias); + condlog(3, "%s: fast_io_fail_tmo = off " + "(config file default)", mp->alias); else - condlog(3, "%s: fast_io_fail_tmo = %d (config file default)", mp->alias, + condlog(3, "%s: fast_io_fail_tmo = %d " + "(config file default)", mp->alias, mp->fast_io_fail == MP_FAST_IO_FAIL_ZERO ? 0 : mp->fast_io_fail); return 0; }