From patchwork Fri Oct 31 18:33:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrique Martins X-Patchwork-Id: 5206411 Return-Path: X-Original-To: patchwork-linux-nfs@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 C34C39F349 for ; Fri, 31 Oct 2014 18:40:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21AB720158 for ; Fri, 31 Oct 2014 18:40:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3CE8E20149 for ; Fri, 31 Oct 2014 18:40:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758848AbaJaSkr (ORCPT ); Fri, 31 Oct 2014 14:40:47 -0400 Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]:53136 "HELO gproxy9-pub.mail.unifiedlayer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1757046AbaJaSkp (ORCPT ); Fri, 31 Oct 2014 14:40:45 -0400 X-Greylist: delayed 400 seconds by postgrey-1.27 at vger.kernel.org; Fri, 31 Oct 2014 14:40:45 EDT Received: (qmail 14114 invoked by uid 0); 31 Oct 2014 18:34:04 -0000 Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy9.mail.unifiedlayer.com with SMTP; 31 Oct 2014 18:34:04 -0000 Received: from box503.bluehost.com ([74.220.219.103]) by cmgw2 with id 9uZy1p00v2ESxDm01ua1TX; Fri, 31 Oct 2014 12:34:02 -0600 X-Authority-Analysis: v=2.1 cv=W5+rC3mk c=1 sm=1 tr=0 a=PavW1xtFd4Pw9NMPtIuMBw==:117 a=PavW1xtFd4Pw9NMPtIuMBw==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=5FTrZqgKwc4A:10 a=Iv8U_6P3r1YA:10 a=RmPfQv0KBzQh-ECYuwUA:9 a=QEXdDO2ut3YA:10 a=F4Ru-bMgixstx4Xd2AAA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=martins.cc; s=default; h=Message-ID:Date:Content-Type:MIME-Version:References:In-reply-to:Subject:cc:To:From; bh=BXRo0vpnled4IQssLBRwm5r6ctncQGCvppnKh+q4Y/Y=; b=xl/TfB/CV+7snWRVKy+zr9amkY0pgm6kv+GLU5ZeiFyllXAmgRw+Dpo7qPkgoamdq1HeVJ+Rc6FE94OmKue+q/m4/tzcCCXHKxY2esXLuZycL9C7+6eDOy2y6iqnGVnF; Received: from [24.130.49.43] (port=42415 helo=monster.martins.cc) by box503.bluehost.com with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1XkH1L-0002r9-GR; Fri, 31 Oct 2014 12:33:59 -0600 Received: from monster.martins.cc (monster.martins.cc [127.0.0.1]) by monster.martins.cc (Postfix) with ESMTP id BEE236031E; Fri, 31 Oct 2014 11:33:55 -0700 (PDT) From: Henrique Martins To: linux-nfs@vger.kernel.org cc: Steve Dickson Subject: Re: F20 nfs-utils exportfs patch In-reply-to: <14393.1409936528@monster.martins.cc> References: <14393.1409936528@monster.martins.cc> Comments: In-reply-to Henrique Martins message dated "Fri, 05 Sep 2014 10:02:08 -0700." X-Mailer: MH-E 8.5; nmh 1.6; XEmacs 21.5 (beta34) MIME-Version: 1.0 Date: Fri, 31 Oct 2014 11:33:55 -0700 Message-ID: <15531.1414780435@monster.martins.cc> X-Identified-User: {32533:box503.bluehost.com:silvadoc:silvado.com} {sentby:smtp auth 24.130.49.43 authed with relay+silvado.com} Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham 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 Re-sending this patch, at Steve Dickson's request. -- Henrique -------------------------------------------------------------- Attaching path to exportfs that: - in client.c/client_lookup: changes the (x)log level for unresolvable entries in /etc/exports from L_ERROR to L_WARNING, - in hostname.c/host_addrinfo: changes the (x)log level for unresolvable entries in /etc/exports from D_GENERAL to D_PARSE, - in export.c/export_read: counts the number of exported volume entries and generates a (x)log L_ERROR if no volumes are exported. Built and tested on a Fedora 20 system. -------------------------------------------------------------- --- nfs-utils-1.3.0/support/export/client.c.orig 2014-09-05 08:21:37.568364360 -0700 +++ nfs-utils-1.3.0/support/export/client.c 2014-09-05 08:21:41.709451778 -0700 @@ -277,7 +277,7 @@ if (htype == MCL_FQDN && !canonical) { ai = host_addrinfo(hname); if (!ai) { - xlog(L_ERROR, "Failed to resolve %s", hname); + xlog(L_WARNING, "Failed to resolve %s", hname); goto out; } hname = ai->ai_canonname; --- nfs-utils-1.3.0/support/export/hostname.c.orig 2014-09-05 08:09:07.387551291 -0700 +++ nfs-utils-1.3.0/support/export/hostname.c 2014-09-05 08:09:13.799573723 -0700 @@ -175,11 +175,11 @@ case 0: return ai; case EAI_SYSTEM: - xlog(D_GENERAL, "%s: failed to resolve %s: (%d) %m", + xlog(D_PARSE, "%s: failed to resolve %s: (%d) %m", __func__, hostname, errno); break; default: - xlog(D_GENERAL, "%s: failed to resolve %s: %s", + xlog(D_PARSE, "%s: failed to resolve %s: %s", __func__, hostname, gai_strerror(error)); break; } --- nfs-utils-1.3.0/support/export/export.c.orig 2014-03-25 08:12:07.000000000 -0700 +++ nfs-utils-1.3.0/support/export/export.c 2014-09-05 09:23:37.424105125 -0700 @@ -76,15 +76,22 @@ struct exportent *eep; nfs_export *exp; + int volumes = 0; + setexportent(fname, "r"); while ((eep = getexportent(0,1)) != NULL) { exp = export_lookup(eep->e_hostname, eep->e_path, 0); - if (!exp) - export_create(eep, 0); + if (!exp) { + exp = export_create(eep, 0); + if (exp) + volumes++; + } else warn_duplicated_exports(exp, eep); } endexportent(); + if (volumes == 0) + xlog(L_ERROR, "no or all unresolvable export entries"); } /**