Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c @@ -685,23 +685,25 @@ error = 0; return (error); } - if (uio->uio_offset != dots_offset) - return (SET_ERROR(EINVAL)); - CTASSERT(sizeof(node->snapdir->sn_name) <= sizeof(entry.d_name)); - entry.d_fileno = node->snapdir->sn_id; - entry.d_type = DT_DIR; - strcpy(entry.d_name, node->snapdir->sn_name); - entry.d_namlen = strlen(entry.d_name); - entry.d_reclen = sizeof(entry); - error = vfs_read_dirent(ap, &entry, uio->uio_offset); - if (error != 0) { - if (error == ENAMETOOLONG) - error = 0; - return (SET_ERROR(error)); + if (uio->uio_offset == dots_offset) { + CTASSERT(sizeof(node->snapdir->sn_name) <= + sizeof(entry.d_name)); + entry.d_fileno = node->snapdir->sn_id; + entry.d_type = DT_DIR; + strcpy(entry.d_name, node->snapdir->sn_name); + entry.d_namlen = strlen(entry.d_name); + entry.d_reclen = sizeof(entry); + error = vfs_read_dirent(ap, &entry, uio->uio_offset); + if (error != 0) { + if (error == ENAMETOOLONG) + error = 0; + return (SET_ERROR(error)); + } + if (eofp != NULL) + *eofp = 1; } - if (eofp != NULL) - *eofp = 1; + return (0); }