Index: sys/compat/linux/linux_file.c =================================================================== --- sys/compat/linux/linux_file.c +++ sys/compat/linux/linux_file.c @@ -498,7 +498,7 @@ linux_dirent = (struct l_dirent*)lbuf; linux_dirent->d_ino = bdp->d_fileno; - linux_dirent->d_off = base + reclen; + linux_dirent->d_off = bdp->d_off; linux_dirent->d_reclen = linuxreclen; /* * Copy d_type to last byte of l_dirent buffer @@ -551,7 +551,6 @@ error = linux_getdents_error(td, args->fd, error); goto out1; } - lbuf = malloc(LINUX_RECLEN64(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); len = td->td_retval[0]; @@ -575,7 +574,7 @@ linux_dirent64 = (struct l_dirent64*)lbuf; linux_dirent64->d_ino = bdp->d_fileno; - linux_dirent64->d_off = base + reclen; + linux_dirent64->d_off = bdp->d_off; linux_dirent64->d_reclen = linuxreclen; linux_dirent64->d_type = bdp->d_type; strlcpy(linux_dirent64->d_name, bdp->d_name, @@ -632,7 +631,7 @@ linux_dirent = (struct l_dirent*)lbuf; linux_dirent->d_ino = bdp->d_fileno; - linux_dirent->d_off = linuxreclen; + linux_dirent->d_off = bdp->d_off; linux_dirent->d_reclen = bdp->d_namlen; strlcpy(linux_dirent->d_name, bdp->d_name, linuxreclen - offsetof(struct l_dirent, d_name));