aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_block.c
diff options
context:
space:
mode:
authorLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2007-12-18 00:19:34 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2007-12-18 01:16:23 -0500
commit041388b54ed95cd169546bd83bacd08ee32bd7ea (patch)
treef457ee15545f6fbed0b0d5b8edd772c8ef7354e5 /fs/xfs/xfs_dir2_block.c
parentc734c79bc397eace039bea406997efa89f879c14 (diff)
[XFS] 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. SGI-PV: 973746 SGI-Modid: xfs-linux-melb:xfs-kern:30240a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_block.c')
-rw-r--r--fs/xfs/xfs_dir2_block.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index c171767e242a..a5f4f4fb8868 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -508,7 +508,7 @@ xfs_dir2_block_getdents(
508 continue; 508 continue;
509 509
510 cook = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk, 510 cook = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk,
511 ptr - (char *)block); 511 (char *)dep - (char *)block);
512 ino = be64_to_cpu(dep->inumber); 512 ino = be64_to_cpu(dep->inumber);
513#if XFS_BIG_INUMS 513#if XFS_BIG_INUMS
514 ino += mp->m_inoadd; 514 ino += mp->m_inoadd;
@@ -519,9 +519,7 @@ xfs_dir2_block_getdents(
519 */ 519 */
520 if (filldir(dirent, dep->name, dep->namelen, cook, 520 if (filldir(dirent, dep->name, dep->namelen, cook,
521 ino, DT_UNKNOWN)) { 521 ino, DT_UNKNOWN)) {
522 *offset = xfs_dir2_db_off_to_dataptr(mp, 522 *offset = cook;
523 mp->m_dirdatablk,
524 (char *)dep - (char *)block);
525 xfs_da_brelse(NULL, bp); 523 xfs_da_brelse(NULL, bp);
526 return 0; 524 return 0;
527 } 525 }