aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-12-09 17:00:38 -0500
committerChris Mason <chris.mason@oracle.com>2010-01-17 20:06:27 -0500
commit406266ab9ac8ed8b085c58aacd9e3161480dc5d5 (patch)
tree811d305c4c4fdf6b19279173959d06698a304416 /fs/btrfs
parent3a1abec9f6880cf406593c392636199ea1c6c917 (diff)
btrfs: fix missing last-entry in readdir(3)
parent 49313cdac7b34c9f7ecbb1780cfc648b1c082cd7 (v2.6.32-1-g49313cd) commit ff48c08e1c05c67e8348ab6f8a24de8034e0e34d Author: Jan Engelhardt <jengelh@medozas.de> Date: Wed Dec 9 22:57:36 2009 +0100 Btrfs: fix missing last-entry in readdir(3) When one does a 32-bit readdir(3), the last entry of a directory is missing. This is however not due to passing a large value to filldir, but it seems to have to do with glibc doing telldir or something quirky. In any case, this patch fixes it in practice. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/inode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 5440bab2363..d5aa9731094 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3995,7 +3995,11 @@ skip:
3995 3995
3996 /* Reached end of directory/root. Bump pos past the last item. */ 3996 /* Reached end of directory/root. Bump pos past the last item. */
3997 if (key_type == BTRFS_DIR_INDEX_KEY) 3997 if (key_type == BTRFS_DIR_INDEX_KEY)
3998 filp->f_pos = INT_LIMIT(off_t); 3998 /*
3999 * 32-bit glibc will use getdents64, but then strtol -
4000 * so the last number we can serve is this.
4001 */
4002 filp->f_pos = 0x7fffffff;
3999 else 4003 else
4000 filp->f_pos++; 4004 filp->f_pos++;
4001nopos: 4005nopos: