From patchwork Thu Oct 11 15:10:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1582281 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8549EDFABE for ; Thu, 11 Oct 2012 15:10:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757556Ab2JKPKx (ORCPT ); Thu, 11 Oct 2012 11:10:53 -0400 Received: from mail-ia0-f174.google.com ([209.85.210.174]:56988 "EHLO mail-ia0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757156Ab2JKPKw (ORCPT ); Thu, 11 Oct 2012 11:10:52 -0400 Received: by mail-ia0-f174.google.com with SMTP id y32so1303750iag.19 for ; Thu, 11 Oct 2012 08:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=TD+nbrtGVEA13TShKtHb+anc/nt5xl8/fK7sCbJ4/Xg=; b=laEm7FQE86Ikclk5zli+pfagaX54F/QH2IIaVEomSuRTn96Ls9NS080GqSGSfKZvPd 1RtVy9+HyKZrxhgu34v0keVjRMHG8wO9b5BzUcLfrSPfKqAomvgZySpuDMONfIglUEkZ anCFSjOiaaZErfJXlt00kmrrSC6IMrbvPA8MAAhgGKsxcRur4Kjikn/HHnLFe0PTqv+r /sWUVl1j3nNVNzVzQfEHpog/wsZ+aNxNc5lEzH4jE/s7Tn0IjfVWfRTO4/i+jOFc8RGH G+916dZwP0wKY8X7AdjldgS2Zu6RQ5IviF1sR95dB3ugIPh1bL1ueRbT9zjorst8x6IL Bd9g== Received: by 10.50.188.199 with SMTP id gc7mr9233743igc.4.1349968252564; Thu, 11 Oct 2012 08:10:52 -0700 (PDT) Received: from lebasque.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id vq4sm9390065igb.10.2012.10.11.08.10.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Oct 2012 08:10:49 -0700 (PDT) From: Chuck Lever Subject: [PATCH 1/8] mountd: Warn when a broken junction is encountered To: steved@redhat.com Cc: bfields@redhat.com, linux-nfs@vger.kernel.org Date: Thu, 11 Oct 2012 11:10:48 -0400 Message-ID: <20121011151048.4665.10650.stgit@lebasque.1015granger.net> In-Reply-To: <20121011150421.4665.35964.stgit@lebasque.1015granger.net> References: <20121011150421.4665.35964.stgit@lebasque.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org A broken junction is a problem that administrators will want to know about and correct. Signed-off-by: Chuck Lever --- utils/mountd/cache.c | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index 7d80432..942fdbd 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -975,8 +975,8 @@ static struct exportent *locations_to_export(struct jp_ops *ops, static struct exportent *invoke_junction_ops(void *handle, const char *junction) { + struct exportent *exp = NULL; nfs_fsloc_set_t locations; - struct exportent *exp; enum jp_status status; struct jp_ops *ops; char *error; @@ -1002,15 +1002,24 @@ static struct exportent *invoke_junction_ops(void *handle, } status = ops->jp_get_locations(junction, &locations); - if (status != JP_OK) { - xlog(D_GENERAL, "%s: failed to resolve %s: %s", - __func__, junction, ops->jp_error(status)); - return NULL; + switch (status) { + case JP_OK: + break; + case JP_NOTJUNCTION: + xlog(D_GENERAL, "%s: %s is not a junction", + __func__, junction); + goto out; + default: + xlog(L_WARNING, "Dangling junction %s: %s", + junction, ops->jp_error(status)); + goto out; } exp = locations_to_export(ops, locations, junction); ops->jp_put_locations(locations); + +out: ops->jp_done(); return exp; }