linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Linux NFSv4 mailing list <nfsv4@linux-nfs.org>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 2/2] Enable v4 mounts when either "nfsvers=4" or "vers=4" option are set (vers-02)
Date: Tue, 25 Aug 2009 13:55:31 -0400	[thread overview]
Message-ID: <4A942593.8030101@RedHat.com> (raw)
In-Reply-To: <4A9424DB.2040303-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>

commit 1471d23d692efc7388794a8a3c3b9e548d1c5be8
Author: Steve Dickson <steved@redhat.com>
Date:   Tue Aug 25 12:15:18 2009 -0400

    Make sure umount use correct fs type.
    
    umounts use the fs type in /etc/mtab to determine
    which file system is being unmounted. The mtab
    entry is create during the mount. To ensure the
    correct entry is create when the fs type changes
    due to the mount options, the address of the fs_type
    variable has to be passed so it can be updated.
    
    Signed-off-by: Steve Dickson <steved@redhat.com>

diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index 355df79..507fbb5 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -417,13 +417,14 @@ static int chk_mountpoint(char *mount_point)
 }
 
 static int try_mount(char *spec, char *mount_point, int flags,
-			char *fs_type, char **extra_opts, char *mount_opts,
+			char *type, char **extra_opts, char *mount_opts,
 			int fake, int bg)
 {
 	int ret;
+	char *fs_type = type;
 
 	if (string)
-		ret = nfsmount_string(spec, mount_point, fs_type, flags,
+		ret = nfsmount_string(spec, mount_point, &fs_type, flags,
 					extra_opts, fake, bg);
 	else {
 		if (strcmp(fs_type, "nfs4") == 0)
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 153723d..1031c08 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -734,13 +734,13 @@ static int nfsmount_start(struct nfsmount_info *mi)
  * @fake: flag indicating whether to carry out the whole operation
  * @child: one if this is a mount daemon (bg)
  */
-int nfsmount_string(const char *spec, const char *node, const char *type,
+int nfsmount_string(const char *spec, const char *node, char **type,
 		    int flags, char **extra_opts, int fake, int child)
 {
 	struct nfsmount_info mi = {
 		.spec		= spec,
 		.node		= node,
-		.type		= type,
+		.type		= *type,
 		.extra_opts	= extra_opts,
 		.flags		= flags,
 		.fake		= fake,
@@ -751,6 +751,9 @@ int nfsmount_string(const char *spec, const char *node, const char *type,
 	mi.options = po_split(*extra_opts);
 	if (mi.options) {
 		retval = nfsmount_start(&mi);
+		/* Note any fs type changes */
+		if (!retval)
+			*type =  (char *)mi.type;
 		po_destroy(mi.options);
 	} else
 		nfs_error(_("%s: internal option parsing error"), progname);
diff --git a/utils/mount/stropts.h b/utils/mount/stropts.h
index b4fd888..dad9997 100644
--- a/utils/mount/stropts.h
+++ b/utils/mount/stropts.h
@@ -24,7 +24,7 @@
 #ifndef _NFS_UTILS_MOUNT_STROPTS_H
 #define _NFS_UTILS_MOUNT_STROPTS_H
 
-int nfsmount_string(const char *, const char *, const char *, int,
+int nfsmount_string(const char *, const char *, char **, int,
 			char **, int, int);
 
 #endif	/* _NFS_UTILS_MOUNT_STROPTS_H */


  parent reply	other threads:[~2009-08-25 17:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-25 17:52 [PATCH 0/2] Enable v4 mounts when either "nfsvers=4" or "vers=4" option are set (vers-02) Steve Dickson
2009-08-25 17:54 ` [PATCH 1/2] " Steve Dickson
     [not found] ` <4A9424DB.2040303-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-08-25 17:55   ` Steve Dickson [this message]
2009-08-25 18:59     ` [PATCH 2/2] " Chuck Lever
2009-08-25 19:18       ` Steve Dickson
2009-08-25 19:32         ` Chuck Lever
2009-08-25 20:15           ` Steve Dickson
2009-08-25 20:37             ` Chuck Lever
2009-08-26 12:10               ` Steve Dickson
2009-08-25 20:49             ` Trond Myklebust
2009-08-26 12:28               ` Steve Dickson
2009-08-26 14:20               ` Chuck Lever
2009-08-26 15:07                 ` Steve Dickson
2009-08-26 16:35                   ` Chuck Lever
2009-08-26 17:08                     ` Steve Dickson
2009-08-26 17:22                       ` Chuck Lever
2009-08-26 17:51                         ` Steve Dickson
2009-08-26 19:50                           ` Chuck Lever
2009-08-26 19:59                             ` Trond Myklebust
2009-08-27 14:14                               ` Steve Dickson
2009-08-27 17:32                                 ` Chuck Lever
2009-08-28  2:55                                   ` Steve Dickson
2009-08-28 16:12                                   ` Christoph Hellwig
2009-08-28 16:35                                     ` Steve Dickson
     [not found]                                       ` <4A980751.7070206-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-08-28 16:41                                         ` Christoph Hellwig
2009-08-28 16:44                                           ` Chuck Lever
2009-08-28 16:53                                           ` Steve Dickson
2009-08-28 16:59                                             ` Christoph Hellwig
2009-08-28 17:19                                               ` Steve Dickson
2009-08-27 17:48                                 ` Trond Myklebust
2009-08-27 17:58                                   ` Chuck Lever
2009-08-27 19:28                                     ` 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=4A942593.8030101@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=nfsv4@linux-nfs.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;
as well as URLs for NNTP newsgroup(s).