Linux NFS development
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Steve Dickson <SteveD@redhat.com>
Cc: "linux-nfs\@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	Lennart Poettering <lennart@poettering.net>
Subject: [nfs-utils PATCH] mount.nfs: don't parse "device" name for -o remount
Date: Fri, 24 Nov 2017 15:30:07 +1100	[thread overview]
Message-ID: <87zi7cxprk.fsf@notabene.neil.brown.name> (raw)

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]


When "-o remount" is used, the device/special name
is ignored.  So don't parse it and risk generating a
useless error.

This is particularly important when nfs-root is used
as the "device name" is listed as "/dev/nfs".
Because mount.nfs doesn't think that is valid,
  mount -o remount,rw /
will fail.

Link: https://github.com/systemd/systemd/issues/3590
Signed-off-by: NeilBrown <neilb@suse.com>
---
 utils/mount/stropts.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 440131482e2b..12178235f068 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -384,7 +384,9 @@ static int nfs_set_version(struct nfsmount_info *mi)
  */
 static int nfs_validate_options(struct nfsmount_info *mi)
 {
-	if (!nfs_parse_devname(mi->spec, &mi->hostname, NULL))
+	/* For remount, ignore mi->spec: the kernel will. */
+	if (!(mi->flags & MS_REMOUNT) &&
+	    !nfs_parse_devname(mi->spec, &mi->hostname, NULL))
 		return 0;
 
 	if (!nfs_nfs_proto_family(mi->options, &mi->family))
-- 
2.14.0.rc0.dirty


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

             reply	other threads:[~2017-11-24  4:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24  4:30 NeilBrown [this message]
2017-12-07 15:39 ` [nfs-utils PATCH] mount.nfs: don't parse "device" name for -o remount Steve Dickson

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=87zi7cxprk.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=SteveD@redhat.com \
    --cc=lennart@poettering.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox