is NFS mounting borked in bb-1.1.1?

Kumar Gala galak at kernel.crashing.org
Tue Mar 28 00:44:28 UTC 2006


> On Mar 24, 2006, at 8:31 PM, Rob Landley wrote:
> 
> > On Friday 24 March 2006 8:47 am, Robert P. J. Day wrote:
> >>   after upgrading to bb-1.1.1 earlier this morning, i have been
> >> *utterly* unable to successfully NFS mount what used to work just  
> >> fine
> >> under bb-1.00.  (bb-1.1.1 on client, NFS server running on FC4
> >> system.)
> >>
> >>   every mount attempt gives me:
> >>
> >>     mount: Mounting 10.1.1.100:/tmp on /mnt failed: Invalid argument
> >>
> >> among other things i have:
> >>
> >>   1) pinged from each machine to the other to verify connectivity
> >>   2) used "showmount" on the server to verify what's being shared
> >>   3) restarted NFS on the server, just to play it safe
> >>   4) used (non-bb) "showmount" command on client to verify what's
> >> 	being shared on the server
> >>   5) verified that portmap is running on the client
> >>
> >> etc., etc.
> >>
> >>   i recall much mount-related discussion lately but i don't remember
> >> any of it having to do with NFS.  what am i missing?  thanks.
> >
> > I don't use nfs so I have no idea, but I'm pondering having a
> > "busybox-1.1.1.fixes.patch" in the download directory that we add  
> > to if we
> > find stupid stuff like the losetup dependency thing.  (I'm not  
> > releasing a
> > 1.1.1, but I can have a patch to fix known issues...)
> >
> > Each of these fixes would of course need to be checked into the  
> > current tree
> > first.  (Something to resolve the issue, anyway.  Not necessarily  
> > the same
> > exact patch.)
> 
> So I figured out what's wrong with nfs in 1.1.1, however I'm not sure  
> how we want to go about fixing it.
> 
> The issue is that nfsmount() has a data structure it fills out which  
> is expected to get passed to the call of mount().
> 
> In singlemount() we call nfsmount() and pass it an options pointer.   
> This pointer is set to a buffer that is allocated and filled out in  
> nsfmount().  However, we are not passing the "options" pointer to  
> mount_it_now().
> 
> Rob, suggestions?

Here's a possible patch that works, but is a little ugly.

Index: util-linux/mount.c
===================================================================
--- util-linux/mount.c	(revision 14675)
+++ util-linux/mount.c	(working copy)
@@ -196,12 +196,15 @@
 
 // Perform actual mount of specific filesystem at specific location.
 
-static int mount_it_now(struct mntent *mp, int vfsflags)
+static int mount_it_now(struct mntent *mp, int vfsflags, int normal_opts)
 {
 	int rc;
 	char *filteropts = 0;
 
-	parse_mount_options(mp->mnt_opts, &filteropts);
+	if (normal_opts)
+		parse_mount_options(mp->mnt_opts, &filteropts);
+	else
+		filteropts = mp->mnt_opts;
 
 	if (fakeIt) { return 0; }
 
@@ -287,11 +290,12 @@
 		if (nfsmount(mp->mnt_fsname, mp->mnt_dir, &vfsflags, &options, 1)) {
 			bb_perror_msg("nfsmount failed");
 			return 1;
+		} else {
+			// Strangely enough, nfsmount() doesn't actually mount() anything.
+			mp->mnt_opts = options;
+
+			return mount_it_now(mp, vfsflags, 0);
 		}
-
-		// Strangely enough, nfsmount() doesn't actually mount() anything.
-
-		else return mount_it_now(mp, vfsflags);
 	}
 
 	// Look at the file.  (Not found isn't a failure for remount.)
@@ -324,7 +328,7 @@
 	 * to the actual mount. */
 
 	if (mp->mnt_type || (vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE)))
-		rc = mount_it_now(mp, vfsflags);
+		rc = mount_it_now(mp, vfsflags, 1);
 
 	// Loop through filesystem types until mount succeeds or we run out
 
@@ -345,7 +349,7 @@
 		for (fl = fslist; fl; fl = fl->link) {
 			mp->mnt_type = fl->data;
 
-			if (!(rc = mount_it_now(mp,vfsflags))) break;
+			if (!(rc = mount_it_now(mp,vfsflags, 1))) break;
 
 			mp->mnt_type = 0;
 		}




More information about the busybox mailing list