* [nfs-utils PATCH] mount.nfs: don't parse "device" name for -o remount
@ 2017-11-24 4:30 NeilBrown
2017-12-07 15:39 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: NeilBrown @ 2017-11-24 4:30 UTC (permalink / raw)
To: Steve Dickson; +Cc: linux-nfs@vger.kernel.org, Lennart Poettering
[-- 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 --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [nfs-utils PATCH] mount.nfs: don't parse "device" name for -o remount
2017-11-24 4:30 [nfs-utils PATCH] mount.nfs: don't parse "device" name for -o remount NeilBrown
@ 2017-12-07 15:39 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2017-12-07 15:39 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-nfs@vger.kernel.org, Lennart Poettering
On 11/23/2017 11:30 PM, NeilBrown wrote:
>
> 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>
Committed....
steved.
> ---
> 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))
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-07 15:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-24 4:30 [nfs-utils PATCH] mount.nfs: don't parse "device" name for -o remount NeilBrown
2017-12-07 15:39 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox