From patchwork Tue May 31 18:20:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Groshans X-Patchwork-Id: 833212 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4VIL9kb006659 for ; Tue, 31 May 2011 18:21:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758059Ab1EaSVA (ORCPT ); Tue, 31 May 2011 14:21:00 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:61695 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758058Ab1EaSU7 (ORCPT ); Tue, 31 May 2011 14:20:59 -0400 Received: by gyd10 with SMTP id 10so1876850gyd.19 for ; Tue, 31 May 2011 11:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=XhhXbmClSeyRNdFVlmM5c8rGJbtnEUKz7Y3o9Vsceyo=; b=rPmzwYLR6vfBgN33b8uAGgaehPD99rdNPbFkY54ZRYTXj+pXU/K9qmIKzGjvH9AIY+ LkpGTGykuGKpQ/vkU+fIDXzXEOE+LdFlIDGHR6FwMT8bPVyh3VKeC+VWzcIiSsei1KlS HD8EJzpO0GafVnKof1ZkrEpeSj/CEFpCz7X+c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=cPJ3h+K1kW2oor71ObTYL7oi3BzPJmGY5vdjk2z/pEpYEdPrj4qyt8iv+/luAJ7e6J 5dB329KAcAwmc8Ew6QyLG4CJ16C27eqYPH5LxBUhUg9OCisikd7v06TTqVaRTt45id6n DpXg/eipQyt/bUPQxQos2xptT7N2Adg/43lcY= Received: by 10.91.195.29 with SMTP id x29mr5455330agp.97.1306866058965; Tue, 31 May 2011 11:20:58 -0700 (PDT) Received: from [141.212.112.44] (moscow.citi.umich.edu [141.212.112.44]) by mx.google.com with ESMTPS id 19sm191151anx.10.2011.05.31.11.20.57 (version=SSLv3 cipher=OTHER); Tue, 31 May 2011 11:20:58 -0700 (PDT) Message-ID: <4DE5316D.1030906@gmail.com> Date: Tue, 31 May 2011 14:20:29 -0400 From: Michael Groshans User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: linux-nfs@vger.kernel.org Subject: [PATCH] pnfsd-lexp: Export correct ipv6 address for local exports 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 (demeter2.kernel.org [140.211.167.43]); Tue, 31 May 2011 18:21:09 +0000 (UTC) From: Michael Groshans A sockaddr is not big enough to hold most ipv6 addresses. Changed to use sockaddr_storage to hold the ipv6 address used for local exports. Signed-off by: Michael Groshans --- fs/nfsd/pnfsd.h | 2 +- fs/nfsd/pnfsd_lexp.c | 6 +++--- include/linux/sunrpc/svc_xprt.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/nfsd/pnfsd.h b/fs/nfsd/pnfsd.h index c11d93d..56adc53 100644 --- a/fs/nfsd/pnfsd.h +++ b/fs/nfsd/pnfsd.h @@ -135,7 +135,7 @@ void pnfs_set_device_notify(clientid_t *, unsigned int types); void pnfs_clear_device_notify(struct nfs4_client *); #if defined(CONFIG_PNFSD_LOCAL_EXPORT) -extern struct sockaddr pnfsd_lexp_addr; +extern struct sockaddr_storage pnfsd_lexp_addr; extern size_t pnfs_lexp_addr_len; extern void pnfsd_lexp_init(struct inode *); diff --git a/fs/nfsd/pnfsd_lexp.c b/fs/nfsd/pnfsd_lexp.c index e9382da..86614b1 100644 --- a/fs/nfsd/pnfsd_lexp.c +++ b/fs/nfsd/pnfsd_lexp.c @@ -27,7 +27,7 @@ #define NFSDDBG_FACILITY NFSDDBG_PNFS -struct sockaddr pnfsd_lexp_addr; +struct sockaddr_storage pnfsd_lexp_addr; size_t pnfs_lexp_addr_len; static wait_queue_head_t lo_recall_wq; @@ -87,7 +87,7 @@ pnfsd_lexp_get_device_info(struct super_block *sb, goto out; } - /* count the number of comma-delimited DS IPs */ + /* format local address */ fdev.fl_device_length = 1; fdev.fl_device_list = fl_devices; @@ -100,7 +100,7 @@ pnfsd_lexp_get_device_info(struct super_block *sb, if (err < 0) goto out; daddr.r_addr.len = err; - switch (pnfsd_lexp_addr.sa_family) { + switch (pnfsd_lexp_addr.ss_family) { case AF_INET: daddr.r_netid.data = "tcp"; daddr.r_netid.len = 3; diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 52cd57501..eff2127 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h @@ -208,13 +208,13 @@ static inline char *__svc_print_addr(const struct sockaddr *addr, /* * Print a network address in a universal format (see rfc1833 and nfsv4.1) */ -static inline int __svc_print_netaddr(struct sockaddr *addr, +static inline int __svc_print_netaddr(struct sockaddr_storage *addr, struct xdr_netobj *na) { u16 port; ssize_t len; - switch (addr->sa_family) { + switch (addr->ss_family) { case AF_INET: { struct sockaddr_in *sin = (struct sockaddr_in *)addr; port = ntohs(sin->sin_port); @@ -235,7 +235,7 @@ static inline int __svc_print_netaddr(struct sockaddr *addr, } default: snprintf(na->data, na->len, "unknown address type: %d", - addr->sa_family); + addr->ss_family); len = -EINVAL; break; }