kern/vfs_mount.c vfs_donmount() checks of MFSNAMELEN

Kirk McKusick mckusick at mckusick.com
Mon Sep 23 18:02:25 UTC 2013


> From: Sean Bruno <sean_bruno at yahoo.com>
> Subject: kern/vfs_mount.c vfs_donmount() checks of MFSNAMELEN
> To: freebsd-fs <freebsd-fs at freebsd.org>
> Date: Mon, 23 Sep 2013 08:59:01 -0700
> 
> 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 ...

I agree with you. It should either be (> MFSNAMELEN - 1) or (>= MFSNAMELEN).

	Kirk McKusick


More information about the freebsd-fs mailing list