[472] in SIPB_Linux_Development
Re: {sun4 7.6R, linux}: detach
daemon@ATHENA.MIT.EDU (Derek Atkins)
Fri Feb 25 01:35:04 1994
To: jweiss@MIT.EDU
Cc: linux-dev@MIT.EDU, jweiss@MIT.EDU, bugs@MIT.EDU
In-Reply-To: [11787] in Athena Bugs
Date: Fri, 25 Feb 94 01:34:40 EST
From: Derek Atkins <warlord@MIT.EDU>
I started tracking this down (at least on linux). It appears what is
happening is that detach is forking and running umount, and the parent
process checks the return value. On linux, the umount winds up
returning "1", since the unmount fails with an errno of EINVAL, since
it is not mounted.
As a result of the umount returning a non-zero status, the detach
decides that the umount fails, and hence doesn't remove the entry from
the attachtab.
There are a few possible ways around this:
1) Make detach call the umount() syscall directly instead of calling
the umount command. This is unlikely to be a good answer.
2) Fix umount to return better error messages. This is unlikely since
we may not have source, and shouldn't depend upon our own fixes.
3) Fix detach to actually check the status of the mountpoint after the
umount returns. This could work, if there is an easy, portable way to
test is a directory is a mountpoint.
4) Something I've overlooked.
I suggest 3. I'm looking into it, and if I come up with a patch I'll
forward it in...
-derek