summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2017-12-06 14:16:56 -0500
committerSteve Dickson <steved@redhat.com>2017-12-07 10:11:46 -0500
commit27936a387b1ea2798a2f6d068e31b83c6ca2632b (patch)
tree328ff24aee5ef94d73ec90cd4541b720a3e63871
parent8d9bf479441d9d7a44a86b69026a7e9d431d3ade (diff)
downloadnfs-utils-27936a387b1ea2798a2f6d068e31b83c6ca2632b.tar.gz
mount.nfs: don't parse "device" name for -o remount
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> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/mount/stropts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 4401314..1217823 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))