Skip to contentSkip to conversation

TAKE 973746 - Put the correct offset in dirent d_off

DISCUSSION David Chinner 1 participant 1 message Dec 13, 2007

lore
Share & tools
lore
#0 lore raw

Put the correct offset in dirent d_off

The recent filldir regression fix was not putting the correct d_off in each dirent. This was resulting in incorrect cookies being passed to dmapi ioctls and the wrong offset appearing in the dirents. readdir was unaffected as the filp->f_pos was being updated with the correct offset and this was being written into the last dirent in each buffer. Fix the XFS code to do the right thing.

Date:  Thu Dec 13 14:44:12 AEDT 2007
Workarea:  chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs
Inspected by:  [email protected]

The following file(s) were checked into:
longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb

Modid: xfs-linux-melb:xfs-kern:30240a
fs/xfs/xfs_dir2_block.c - 1.58 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_block.c.diff?r1=text&tr1=1.58&r2=text&tr2=1.57&f=h
- pass the current offset to the filldir method rather than the offset of the next object. filldir expects the current offset, not the next one.

fs/xfs/xfs_dir2_sf.c - 1.50 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_sf.c.diff?r1=text&tr1=1.50&r2=text&tr2=1.49&f=h
- pass the current offset to the filldir method rather than the offset of the next object. filldir expects the current offset, not the next one.

fs/xfs/xfs_dir2_leaf.c - 1.60 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_leaf.c.diff?r1=text&tr1=1.60&r2=text&tr2=1.59&f=h
- pass the current offset to the filldir method rather than the offset of the next object. filldir expects the current offset, not the next one.

fs/xfs/linux-2.6/xfs_file.c - 1.160 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_file.c.diff?r1=text&tr1=1.160&r2=text&tr2=1.159&f=h
- Update filp->f_pos correctly now that we pass the current offset with each dirent to filldir.

fs/xfs/dmapi/xfs_dm.c - 1.61 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.61&r2=text&tr2=1.60&f=h
- Remove special handling of dirent offsets for the cookie betwen ioctl calls.