aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_file.c
diff options
context:
space:
mode:
authorLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2007-12-20 19:00:23 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2007-12-20 19:40:05 -0500
commit4743e0ec1217fd00f57461ebdd7979d31af18700 (patch)
tree9e497a5d4c554e2fe2575475c6b2464d5ba14e46 /fs/xfs/linux-2.6/xfs_file.c
parentbad60fdd14df32459e31cc75ab681e4458bf25cf (diff)
[XFS] Initialise current offset in xfs_file_readdir correctly
After reading the directory contents into the temporary buffer, we grab each dirent and pass it to filldir witht eh current offset of the dirent. The current offset was not being set for the first dirent in the temporary buffer, which coul dresult in bad offsets being set in the f_pos field result in looping and duplicate entries being returned from readdir. SGI-PV: 974905 SGI-Modid: xfs-linux-melb:xfs-kern:30282a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_file.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index e1fcef2eb928..4847eb83fc18 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -347,6 +347,7 @@ xfs_file_readdir(
347 347
348 size = buf.used; 348 size = buf.used;
349 de = (struct hack_dirent *)buf.dirent; 349 de = (struct hack_dirent *)buf.dirent;
350 curr_offset = de->offset /* & 0x7fffffff */;
350 while (size > 0) { 351 while (size > 0) {
351 if (filldir(dirent, de->name, de->namlen, 352 if (filldir(dirent, de->name, de->namlen,
352 curr_offset & 0x7fffffff, 353 curr_offset & 0x7fffffff,