From patchwork Thu Sep 1 15:16:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 1119442 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p81FGaV9004419 for ; Thu, 1 Sep 2011 15:16:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932164Ab1IAPQe (ORCPT ); Thu, 1 Sep 2011 11:16:34 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:53992 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932129Ab1IAPQd (ORCPT ); Thu, 1 Sep 2011 11:16:33 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 562F01B402C for ; Thu, 1 Sep 2011 15:16:33 +0000 (UTC) From: Mike Frysinger To: linux-nfs@vger.kernel.org Subject: [PATCH 2/2] exportfs: do not warn if /etc/exports.d/ does not exist Date: Thu, 1 Sep 2011 11:16:32 -0400 Message-Id: <1314890192-11075-2-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1314890192-11075-1-git-send-email-vapier@gentoo.org> References: <1314890192-11075-1-git-send-email-vapier@gentoo.org> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 01 Sep 2011 15:16:36 +0000 (UTC) It isn't uncommon for /etc/exports.d/ to not exist, and imo, it's not that big of a deal as often times, a simple /etc/exports is sufficient. So silently skip the case where the dir is missing. Signed-off-by: Mike Frysinger --- utils/exportfs/exportfs.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index 986a272..7432a65 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -529,9 +529,12 @@ export_d_read(const char *dname) n = scandir(dname, &namelist, NULL, versionsort); - if (n < 0) + if (n < 0) { + if (errno == ENOENT) + /* Silently return */ + return; xlog(L_NOTICE, "scandir %s: %s", dname, strerror(errno)); - else if (n == 0) + } else if (n == 0) return; for (i = 0; i < n; i++) {