From patchwork Thu Mar 14 14:08:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 2271431 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by patchwork2.kernel.org (Postfix) with ESMTP id AB0F5DFB79 for ; Thu, 14 Mar 2013 14:12:41 +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 r2EE9t48008529; Thu, 14 Mar 2013 10:09:56 -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 r2EE96w2021427 for ; Thu, 14 Mar 2013 10:09:06 -0400 Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.20]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2EE96gJ008825 for ; Thu, 14 Mar 2013 10:09:06 -0400 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 r2EE8o3s032478 for ; Thu, 14 Mar 2013 10:08:51 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E7C66A5230; Thu, 14 Mar 2013 15:08:49 +0100 (CET) From: Hannes Reinecke To: dm-devel@redhat.com Date: Thu, 14 Mar 2013 15:08:45 +0100 Message-Id: <1363270128-20900-4-git-send-email-hare@suse.de> In-Reply-To: <1363270128-20900-1-git-send-email-hare@suse.de> References: <1363270128-20900-1-git-send-email-hare@suse.de> X-RedHat-Spam-Score: -9.302 (BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, URIBL_BLOCKED) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.20 X-loop: dm-devel@redhat.com Cc: Christophe Varoqui Subject: [dm-devel] [PATCH 3/6] libmultipath: improve debugging messages in sysfs_attr_set_value() 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 be printing out debugging messages for all failure cases in sysfs_attr_set_value(). Signed-off-by: Hannes Reinecke --- libmultipath/sysfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c index d33747f..da228e4 100644 --- a/libmultipath/sysfs.c +++ b/libmultipath/sysfs.c @@ -58,12 +58,16 @@ ssize_t sysfs_attr_set_value(struct udev_device *dev, const char *attr_name, } /* skip directories */ - if (S_ISDIR(statbuf.st_mode)) + if (S_ISDIR(statbuf.st_mode)) { + condlog(4, "%s is a directory", devpath); return 0; + } /* skip non-writeable files */ - if ((statbuf.st_mode & S_IWUSR) == 0) + if ((statbuf.st_mode & S_IWUSR) == 0) { + condlog(4, "%s is not writeable", devpath); return 0; + } /* write attribute value */ fd = open(devpath, O_WRONLY);