diff options
Diffstat (limited to 'sys/fs/cd9660')
-rw-r--r-- | sys/fs/cd9660/cd9660_vnops.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 7dcf1a9..91ecaa3 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -170,7 +170,14 @@ cd9660_getattr(ap) register struct iso_node *ip = VTOI(vp); vap->va_fsid = dev2udev(ip->i_dev); - vap->va_fileid = ip->i_number; + + /* + * Don't use ip->i_ino for this since it is wrong for hard links. + * ip->i_ino should be the same as ip->iso_start (or not exist), + * but this currently doesn't work since we abuse it to look up + * parent directories from inodes. + */ + vap->va_fileid = ip->iso_start; vap->va_mode = ip->inode.iso_mode; vap->va_nlink = ip->inode.iso_links; @@ -524,11 +531,12 @@ cd9660_readdir(ap) break; } - if (isonum_711(ep->flags)&2) - idp->current.d_fileno = isodirino(ep, imp); - else - idp->current.d_fileno = dbtob(bp->b_blkno) + - entryoffsetinblock; + /* + * The "inode number" is iso_start, not i_ino, as in + * cd9660_getattr(). + */ + idp->current.d_fileno = isonum_711(ep->ext_attr_length) + + isonum_733(ep->extent); idp->curroff += reclen; |