Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Aug 2010 22:41:23 -0700
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        hackers@freebsd.org
Subject:   mount(2) not returning EINVAL with invalid filesystems
Message-ID:  <AANLkTimk7fjqmp2uHxd86Q%2BcKHdVvat0Nt0TbL4%2BGNc_@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
    mount(2) says it should fail with EINVAL if the magic block is wrong:

     [EINVAL]           The super block for the file system had a bad magic
                        number or an out of range block size.

    This doesn't appear to be the case with a nmount layer though :/.
I didn't find anything conclusive that noted where the issue was
occurring, but I was wondering if anyone knew where it might be
happening?

$ sudo mount_msdosfs /dev/ada0s1b /mnt/
# ...
madvise(0x800c09000,0x1000,0x5,0x8,0x3008,0x5039d0) = 0 (0x0)
nmount(0x800c0d100,0x10,0x0,0x4,0xf0,0x5039d0)	 ERR#1 'Operation not permitted'
write(2,"mount_msdosfs: ",15)			 ERR#9 'Bad file descriptor'
write(2,": ",2)					 ERR#9 'Bad file descriptor'
# ...
mount_msdosfs: /dev/ada0s1b: Operation not permitted
$ sudo mount /dev/ada0s1b /mnt/
# ...
madvise(0x800c0b000,0x1000,0x5,0xa,0x2008,0x505dd8) = 0 (0x0)
nmount(0x800c0d080,0x8,0x0,0x7fffffffdff0,0x70,0x505dd8) ERR#1
'Operation not permitted'
write(2,"mount: ",7)				 ERR#9 'Bad file descriptor'
write(2,": ",2)					 ERR#9 'Bad file descriptor'
# ...
mount: /dev/ada0s1b : Operation not permitted

    This is something small that I've noticed for a while now that
doesn't make sense from a requirements perspective with the manpage.
Thanks!
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimk7fjqmp2uHxd86Q%2BcKHdVvat0Nt0TbL4%2BGNc_>