Btrfs: Fix looping on readdir of the subvol roots
authorYan Zheng <yanzheng@21cn.com>
Tue, 19 Feb 2008 16:41:02 +0000 (11:41 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:04:00 +0000 (11:04 -0400)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c

index 913ab12..3e79572 100644 (file)
@@ -1465,7 +1465,10 @@ read_dir_items:
                        di = (struct btrfs_dir_item *)((char *)di + di_len);
                }
        }
-       filp->f_pos = INT_LIMIT(typeof(filp->f_pos));
+       if (key_type == BTRFS_DIR_INDEX_KEY)
+               filp->f_pos = INT_LIMIT(typeof(filp->f_pos));
+       else
+               filp->f_pos++;
 nopos:
        ret = 0;
 err: