Bug 32499 - umount(2) man-page incorrectly says umount(block-dev) works (it doesn't)
Summary: umount(2) man-page incorrectly says umount(block-dev) works (it doesn't)
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: man-pages
Version: 7.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2001-03-21 02:48 UTC by Jay Turner
Modified: 2015-01-07 23:44 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2001-04-18 15:16:55 UTC

Attachments (Terms of Use)
brief test-case source (657 bytes, text/plain)
2001-03-21 02:48 UTC, Glen Foster
no flags Details

Description Glen Foster 2001-03-21 02:48:02 UTC
I found this while porting the VSX-PCTS to 7.1 with the 2.4 kernel:

#include <sys/mount.h>
{ blah, blah}
/* the mount(2) call works fine */
ret = mount("/dev/sda9", "/tmp/mnt", "ext2",  MS_MGC_VAL, (void *) &stuph);
/* the following umount(2) call fails */
ret = umount("/dev/sda9");
/* the following umount(2) call succeeds */
ret = umount("/tmp/mnt");

... tiny test-case included in case it helps.

Dunno if it's i386-only or not... mostly a nit since the user-space
commands work, but the man-page says differently:

MOUNT(2)            Linux Programmer's Manual            MOUNT(2)

       mount, umount - mount and unmount filesystems.

       #include <sys/mount.h>

       int  mount(const char * specialfile, const char * dir,
       const char * filesystemtype, unsigned long rwflag, const
       void * data);

       int umount(const char *specialfile);

       int umount(const char *dir);

Comment 1 Glen Foster 2001-03-21 02:48:37 UTC
Created attachment 13203 [details]
brief test-case source

Comment 2 Arjan van de Ven 2001-04-07 23:42:48 UTC
Not a bug.  What do you want to do when a single device has been
mounted in multiple places (legal under some circumstances, will
be more so in the future)?

Comment 3 Glen Foster 2001-04-08 13:22:53 UTC
I understand the logic of the code and the reasoning behind specifying the
*directory* instead of the block-device.  However, if you look at the man-page
versus what the code enforces, you will see a discrepancy.  I have NO issue with
umount requiring the directory-pathname as the arugment.  I do have a concern
that the man-page says you can use *either*.  Thus, there IS a bug, albeit a
low-weight one that I would like to see fixed at some point, but not necessary
for Florence.

I am re-opening this and changing the defect heading to reflect a man-page
error.  I also think it's a good idea to write a paragraph in the man-page that
says specifying the block-device form of the call is deprecated (because of
multiple mounts of the same device).

Comment 4 Arjan van de Ven 2001-04-18 15:16:50 UTC
$ rpm -qf /usr/share/man/man2/umount.2.gz
---> re-assigning

Comment 5 Trond Eivind Glomsrxd 2001-04-18 19:15:41 UTC
Fixed in man-pages-1.35-6

Note You need to log in before you can comment on or make changes to this bug.