Re: Mount command should document EROFS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 25 Jul 2018 at 11:03, Walter Harms <wharms@xxxxxx> wrote:
>
>
>
> > Harry Mallon <hjmallon@xxxxxxxxx> hat am 25. Juli 2018 um 11:56 geschrieben:
> >
> >
> > Hello all,
> >
> > I have reported a bug in Bugzilla
> > https://bugzilla.kernel.org/show_bug.cgi?id=200649
> >
> > "man-pages: mount does not document EROFS"
> >
> > ===
> > The man pages for mount(...) GLibC function do not document when a EROFS might
> > be received.
> >
> > When mounting without READONLY flag:
> > I have a UDF formatted disk which returns EACCESS as it is read only.
> > I have a VFat formatted disk (with hardware write protect turned on) which
> > returns EROFS.
> >
> > I think a line should be added to the man pages to cover EROFS, but I am not
> > sure on the detail of when it would happen.
>
>
> I am not sure that i understand the steps propperly.
> You are doing "mount /dev/xx /mnt" and this results in an error
> or do you "mount /dev/xx /mnt ; cd /mnt" tp get am error ?

Sorry for being unclear. I have code similar to what follows and I am
inpecting errno.

---
if (::mount("/dev/xx", "/mnt/name", FSTYPE, 0, NULL) == 0)
    return true;

int err = errno;
std::cerr << "mount returned: " << err << "\n";
if (err == EACCESS)
{
    // Do some stuff as it is read only
}
return false;
---

I have a couple of different devices that are both read only, but only
one was caught in the read only section.

A UDF read only device returns EACCESS, which is well documented in
the man pages for read only devices.
A VFAT device (which has a hardware read only switch) returns EROFS,
which is undocumented in the man pages.

It caught me out, so I thought it should be documented.

Best (and apologes for resending, failed to reply all previously),
H

>
> re,
>  wh
>
> > ===
> >
> > Thanks for your attention,
> > Harry Mallon
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-man" in
> > the body of a message to majordomo@xxxxxxxxxxxxxxx
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux