kern/vfs_mount.c vfs_donmount() checks of MFSNAMELEN

Sean Bruno sean_bruno at yahoo.com
Mon Sep 23 15:59:05 UTC 2013


So, I'm confused by this check:

        if (fstypelen >= MFSNAMELEN - 1 || fspathlen >= MNAMELEN - 1) {
                error = ENAMETOOLONG;
                goto bail;
        }

MFSNAMELEN is 16, why do we check against >= MFSNAMELEN - 1?  Why dont
we check against (> MFSNAMELEN - 1) or (>= MFSNAMELEN)?  Is a 14
character fstypelen with a "\0" at the end considered too long?

Sean

p.s. e.g. mount -t fuse.glusterfs ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20130923/f651b76c/attachment.sig>


More information about the freebsd-fs mailing list