From: Wei Yongjun Subject: [PATCH 1/4] Use correct UMNT version to do umount Date: Wed, 14 Mar 2007 14:46:22 +0800 Message-ID: <45F79A3E.6000504@nanjing-fnst.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Neil Brown , nfs@lists.sourceforge.net Return-path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list2-new.sourceforge.net with esmtp (Exim 4.43) id 1HRNKS-0002Jn-0n for nfs@lists.sourceforge.net; Tue, 13 Mar 2007 23:51:20 -0700 Received: from [221.6.14.228] (helo=proxy.fnst.com.cn) by mail.sourceforge.net with esmtp (Exim 4.44) id 1HRNKS-0005sC-5c for nfs@lists.sourceforge.net; Tue, 13 Mar 2007 23:51:22 -0700 List-Id: "Discussion of NFS under Linux development, interoperability, and testing." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfs-bounces@lists.sourceforge.net Errors-To: nfs-bounces@lists.sourceforge.net This patch let umount to use correct UMNT version to do umount. In latest kernel, the version format is "vers=3" etc., and in old kernel the version format is "v3","v4" etc. Signed-off-by: Wei Yongjun --- utils/mount/nfsumount.c.orig 2007-03-05 03:11:48.000000000 -0500 +++ utils/mount/nfsumount.c 2007-03-04 03:13:36.000000000 -0500 @@ -257,6 +257,7 @@ char *hostname; char *dirname; clnt_addr_t mnt_server = { &hostname, }; + struct mntent mnt = {.mnt_opts = opts}; struct pmap *pmap = &mnt_server.pmap; char *p; @@ -296,7 +297,11 @@ pmap->pm_prog = atoi(p+10); if (opts && (p = strstr(opts, "mountport=")) && isdigit(*(p+10))) pmap->pm_port = atoi(p+10); - if (opts && (p = strstr(opts, "nfsvers=")) && isdigit(*(p+8))) + if (opts && hasmntopt(&mnt, "v3")) + pmap->pm_vers = MOUNTVERS_NFSV3; + if (opts && hasmntopt(&mnt, "v4")) + pmap->pm_vers = 4; + if (opts && (p = strstr(opts, "vers=")) && isdigit(*(p+8))) pmap->pm_vers = nfsvers_to_mnt(atoi(p+8)); if (opts && (p = strstr(opts, "mountvers=")) && isdigit(*(p+10))) pmap->pm_vers = atoi(p+10); ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs