btrfs: fix missing last-entry in readdir(3)
diff mbox

Message ID alpine.LSU.2.01.0912092259200.11799@obet.zrqbmnf.qr
State Accepted
Headers show

Commit Message

Jan Engelhardt Dec. 9, 2009, 10 p.m. UTC
None

Patch
diff mbox

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index b3ad168..7bf9811 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3869,7 +3869,11 @@  skip:
 
 	/* Reached end of directory/root. Bump pos past the last item. */
 	if (key_type == BTRFS_DIR_INDEX_KEY)
-		filp->f_pos = INT_LIMIT(off_t);
+		/*
+		 * 32-bit glibc will use getdents64, but then strtol -
+		 * so the last number we can serve is this.
+		 */
+		filp->f_pos = 0x7fffffff;
 	else
 		filp->f_pos++;
 nopos: