All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r@public.gmane.org
Cc: linux-nfs@vger.kernel.org,
	"Mr. Charles Edward Lever" <Chuck.Lever@oracle.com>,
	Hans de Bruin <bruinjm-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
Subject: Re: [Bug 14276] nfsroot will not remount rw and claims illegal options
Date: Sun, 04 Oct 2009 17:59:58 -0400	[thread overview]
Message-ID: <1254693598.30515.59.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <1254683162.9064.2.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>

On Sun, 2009-10-04 at 15:06 -0400, Trond Myklebust wrote:
> Chuck, can you see how the rpc_pton() might be breaking nfsroot?
> The cmdline is of the form
> 
>     root=/dev/nfs nfsroot=10.10.0.2:/nfs/gemini,v3,tcp ro ip=::::::dhcp

I think I see it...

The difference is that rpc_pton4() starts with

	memset(sap, 0, sizeof(struct sockaddr_in));

That clears the port number that was set in nfs_remount(), and so the
comparison in nfs_compare_remount_data() fails.

Does the following patch fix the problem?

--------------------------------------------------------------------------
NFS: Fix port initialisation in nfs_remount()
From: Trond Myklebust <Trond.Myklebust@netapp.com>

The recent changeset 53a0b9c4c99ab0085a06421f71592722e5b3fd5f (NFS: Replace
nfs_parse_ip_address() with rpc_pton()) broke nfs_remount, since the call
to rpc_pton() will zero out the port number in data->nfs_server.address.

This is actually due to a bug in nfs_remount: it should be looking at the
port number in nfs_server.port instead...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---

 fs/nfs/super.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 0d14704..fb3b280 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1846,9 +1846,10 @@ nfs_compare_remount_data(struct nfs_server *nfss,
 	    data->acdirmin != nfss->acdirmin / HZ ||
 	    data->acdirmax != nfss->acdirmax / HZ ||
 	    data->timeo != (10U * nfss->client->cl_timeout->to_initval / HZ) ||
+	    data->nfs_server.port != nfss->port ||
 	    data->nfs_server.addrlen != nfss->nfs_client->cl_addrlen ||
-	    memcmp(&data->nfs_server.address, &nfss->nfs_client->cl_addr,
-		   data->nfs_server.addrlen) != 0)
+	    !rpc_cmp_addr(&data->nfs_server.address,
+		    &nfss->nfs_client->cl_addr))
 		return -EINVAL;
 
 	return 0;
@@ -1891,6 +1892,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)
 	data->acdirmin = nfss->acdirmin / HZ;
 	data->acdirmax = nfss->acdirmax / HZ;
 	data->timeo = 10U * nfss->client->cl_timeout->to_initval / HZ;
+	data->nfs_server.port = nfss->port;
 	data->nfs_server.addrlen = nfss->nfs_client->cl_addrlen;
 	memcpy(&data->nfs_server.address, &nfss->nfs_client->cl_addr,
 		data->nfs_server.addrlen);



  parent reply	other threads:[~2009-10-04 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-14276-104@http.bugzilla.kernel.org/>
     [not found] ` <200910041748.n94HmwPY005082@demeter.kernel.org>
     [not found]   ` <200910041748.n94HmwPY005082-jEpIWWs/U2wOASNP4CLbKB2eb7JE58TQ@public.gmane.org>
2009-10-04 19:06     ` [Bug 14276] nfsroot will not remount rw and claims illegal options Trond Myklebust
     [not found]       ` <1254683162.9064.2.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-10-04 21:59         ` Trond Myklebust [this message]
     [not found]           ` <1254693598.30515.59.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-10-05 15:00             ` Chuck Lever
2009-10-01 19:26 2.6.32-rc1-git2: Reported regressions from 2.6.31 Rafael J. Wysocki
2009-10-01 19:38 ` [Bug #14276] nfsroot will not remount rw and claims illegal options Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1254693598.30515.59.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=Chuck.Lever@oracle.com \
    --cc=bruinjm-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org \
    --cc=bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r@public.gmane.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.