While starting to convert cd9660 to vcache the following problems and bugs came up: - cd9660_vget_internal() has two hint arguments "isodir" and "relocated" that have values when called from cd9660_lookup() and are NULL when called from cd9660_fhtovp(). - cd9660_lookup() passes data from a released buffer as "isodir". - directory data is sometimes read via the directory vnode and sometimes via the device vnode leading to an inconsistent buffer cache that will just not explode as the filesystem is read-only. - directory entries are sometimes taken from the parent and somtimes from the "."-entry of the directory. The attached diff will: Remove the hints "isodir" and "relocated" from cd9660_vget_internal() and always reread the directory entry by inumber. For directories the directory entry is always its "." entry. Always read directories via the device vnode to prevent buffer cache inconsistency. Keep i_devvp as a hint for fstat(1) and friends and always use im_devvp for reads. No need to vref()/vrele() i_devvp. The additional bread is either cached because cd9660_lookup() just released the buffer or will be used in the near future when the directory gets traversed during lookup. Comments or objections anyone? -- J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)
Attachment:
cd9660.diff
Description: Binary data