>Number:         159357
>Category:       misc
>Synopsis:       ZFS MAXNAMELEN macro has confusing name (off-by-one)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 01 14:50:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Robert Millan
>Release:        FreeBSD 8.2
>Organization:
>Environment:
>Description:

It's not clear what MAXNAMELEN in ZFS compat environment means. Name indicates 
it's the maximum name length (for ZFS objects), but actual checks error out 
when requested name has the maximum length. In practice this makes it the 
maximum plus one:

./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: if 
(dsl_dataset_namelen(ds) + 1 + strlen(snapname) >= MAXNAMELEN)
./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: if 
(dsl_dir_namelen(ds->ds_dir) + 1 + strlen(newsnapname) >= MAXNAMELEN)
./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: if 
(strlen(oldname) + delta >= MAXNAMELEN)
./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c:   if 
(strlcat(zc->zc_name, "@", sizeof (zc->zc_name)) >= MAXNAMELEN) {
./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c:           if 
(strlen(propname) >= ZAP_MAXNAMELEN)
./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c:    if 
(strlen(propname) >= ZAP_MAXNAMELEN)
./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c:            if 
(strlen(nvpair_name(elem)) >= ZAP_MAXNAMELEN)
./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c:             if 
(strlen(path) >= MAXNAMELEN)
./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c:             if 
(p-path >= MAXNAMELEN)
./sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c:             if 
(p-path >= MAXNAMELEN)
./sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c:      if 
(strlen(path) >= MAXNAMELEN) {
./sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c:      if 
(strlen(path) >= MAXNAMELEN) {
./sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c:              if (end 
- start >= MAXNAMELEN) {
./sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c:      if 
(strlen(pool) >= MAXNAMELEN) {
./cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c:     } else if (p - 
volname >= ZFS_MAXNAMELEN) {
./cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c:                  
if (strlen(nvpair_name(elem)) >= ZAP_MAXNAMELEN) {

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to