1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-28 16:43:09 +00:00

Temporarily back out revision 1.77. This changed cd9660_getattr() and

cd9660_readdir() to return the address of the file's first data block as
the inode number instead of the address of the directory entry, but
neglected to update cd9660_vget_internal() for the new inode numbering
scheme.

Since the NFS server calls VFS_VGET (cd9660_vget()) with inode numbers
returned through VOP_READDIR (cd9660_readdir()) when servicing a READDIRPLUS
request, these two interfaces must agree on the numbering scheme; failure to
do so caused panics and/or bogus information about the entries to be returned
to clients using READDIRPLUS (Solaris, FreeBSD w/ mount -o rdirplus).

PR:		63446
This commit is contained in:
Tim J. Robbins 2004-09-05 11:18:53 +00:00
parent 62c36019a5
commit 82c0aec8de
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134807
2 changed files with 12 additions and 28 deletions

View File

@ -167,14 +167,7 @@ cd9660_getattr(ap)
struct iso_node *ip = VTOI(vp);
vap->va_fsid = dev2udev(ip->i_dev);
/*
* 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_fileid = ip->i_number;
vap->va_mode = ip->inode.iso_mode;
vap->va_nlink = ip->inode.iso_links;
@ -528,12 +521,11 @@ cd9660_readdir(ap)
break;
}
/*
* 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);
if (isonum_711(ep->flags)&2)
idp->current.d_fileno = isodirino(ep, imp);
else
idp->current.d_fileno = dbtob(bp->b_blkno) +
entryoffsetinblock;
idp->curroff += reclen;

View File

@ -167,14 +167,7 @@ cd9660_getattr(ap)
struct iso_node *ip = VTOI(vp);
vap->va_fsid = dev2udev(ip->i_dev);
/*
* 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_fileid = ip->i_number;
vap->va_mode = ip->inode.iso_mode;
vap->va_nlink = ip->inode.iso_links;
@ -528,12 +521,11 @@ cd9660_readdir(ap)
break;
}
/*
* 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);
if (isonum_711(ep->flags)&2)
idp->current.d_fileno = isodirino(ep, imp);
else
idp->current.d_fileno = dbtob(bp->b_blkno) +
entryoffsetinblock;
idp->curroff += reclen;