busybox mount -a behavior problem

Adam Slattery aslattery at sunriselinux.com
Sun Jun 3 00:29:07 UTC 2001


Package: busybox
Version: 0.51

What busybox does:
  If you do mount -a and an entry listed in fstab is already mounted,
  mount(2) will return EBUSY as an error, and mount(busybox) will
  print an error and return non-zero.


What gnu util-linux does:
  If you do the same thing, mount(8/util-linux) will silently ignore
  the error.


What is "correct":
  gnu util-linux.  The user shouldn't have to unmount something they
  already mounted when issueing a mount -a (for example, on startup the
  kernel will have mounted / already.  EBUSY should be ignored when doing
  a `mount -a`.


Patch:
  here is a trivial work-around.  It has the side effect of ignoring EBUSY
  when mounting a single specified entry (which is _wrong_), but imho the
  behavior of mount -a is more important.  It will take a substantial code
  clean-up to do the right thing.  For now, I think this should be applied
  until somebody cleans up mount.c to do the right thing.


+++ mount.c   Sat Jun  2 18:44:43 2001
@@ -150,6 +150,8 @@
                        error_msg("%s is write-protected, mounting read-only", specialfile);
                        status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags);
                }
+               if (errno == EBUSY)
+                       return (TRUE);
        }


Thanks,
Adam Slattery
Sunrise Linux Development Team
aslattery at sunriselinux.com


---------------------------------------
Received: (at 1177-done) by bugs.lineo.com; 3 Jun 2001 02:21:41 +0000


More information about the busybox mailing list