From patchwork Mon Dec 3 17:18:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1834491 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DA20E3FCD5 for ; Mon, 3 Dec 2012 17:18:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755458Ab2LCRSL (ORCPT ); Mon, 3 Dec 2012 12:18:11 -0500 Received: from mail-ie0-f174.google.com ([209.85.223.174]:34497 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755214Ab2LCRSJ (ORCPT ); Mon, 3 Dec 2012 12:18:09 -0500 Received: by mail-ie0-f174.google.com with SMTP id c11so4554894ieb.19 for ; Mon, 03 Dec 2012 09:18:09 -0800 (PST) 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=htYupj5r0IN54wlkscIqBF/HXLajNM7l0bAD1nYLa48=; b=EdFexa+DK9gc6l7GpPYw+YWMas4aniiF9IXDQUTFGQhmdndJyD0nhHSL/Il44cyoGR pKTP9vwQzgV1Goa3FxiNcTdkrVRhzGBR5LsbCL51D/rZ47LuzbevHLfK0uejXjutlMIL eEeuoeVjACl2GqKSttz2Zk3zvBWKz49BmFqNSWxbc7a5WEeG91xBfSDl+bV1ueM3mQrU 9GmOKyvSuBNmPfXgO8CFEB6jQ8kTZJda/O11Qlk6XS4d45mGT/iuWbhBqK7rppE1+PE6 4UQx22qV3KGWvTIhNQd3ZNFKr3j89fJp5N2Cplkbp6XiYdtfOdgdlPt/7mXOh8NBYfIQ oc1g== Received: by 10.50.7.234 with SMTP id m10mr7073382iga.43.1354555089635; Mon, 03 Dec 2012 09:18:09 -0800 (PST) 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 as6sm7487901igc.8.2012.12.03.09.18.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Dec 2012 09:18:09 -0800 (PST) From: Chuck Lever Subject: [PATCH 5/5] mountd: Report the absolute path used to load the junction plug-in To: steved@redhat.com Cc: linux-nfs@vger.kernel.org Date: Mon, 03 Dec 2012 12:18:08 -0500 Message-ID: <20121203171808.1390.33578.stgit@lebasque.1015granger.net> In-Reply-To: <20121203171549.1390.64007.stgit@lebasque.1015granger.net> References: <20121203171549.1390.64007.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 As a debugging feature, report the absolute pathname of the plug-in library that mountd loads to resolve junctions. Since mountd passes a relative path to dlopen(3), dlopen(3) must search for the right library. Displaying the absolute pathname of the object that it found verifies that mountd loaded the correct plug-in. Note: dlinfo(3) is provided by libdl, but there doesn't seem to be a man page on Fedora 16 for dlinfo(3). Instead, see: http://www.unix.com/man-page/all/3/dlinfo/ Signed-off-by: Chuck Lever --- utils/mountd/cache.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 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 c264e14..3853bb6 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -826,6 +826,7 @@ lookup_export(char *dom, char *path, struct addrinfo *ai) #ifdef HAVE_NFS_PLUGIN_H #include +#include #include /* @@ -1090,6 +1091,7 @@ static struct exportent *lookup_junction(char *dom, const char *pathname, struct addrinfo *ai) { struct exportent *exp; + struct link_map *map; void *handle; handle = dlopen("libnfsjunct.so", RTLD_NOW); @@ -1097,6 +1099,11 @@ static struct exportent *lookup_junction(char *dom, const char *pathname, xlog(D_GENERAL, "%s: dlopen: %s", __func__, dlerror()); return NULL; } + + if (dlinfo(handle, RTLD_DI_LINKMAP, &map) == 0) + xlog(D_GENERAL, "%s: loaded plug-in %s", + __func__, map->l_name); + (void)dlerror(); /* Clear any error */ exp = invoke_junction_ops(handle, dom, pathname, ai);