Commit 5e591a07 authored by Yan Zheng's avatar Yan Zheng Committed by Chris Mason

Btrfs: Fix looping on readdir of the subvol roots

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 0762704b
...@@ -1465,7 +1465,10 @@ static int btrfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -1465,7 +1465,10 @@ static int btrfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
di = (struct btrfs_dir_item *)((char *)di + di_len); di = (struct btrfs_dir_item *)((char *)di + di_len);
} }
} }
if (key_type == BTRFS_DIR_INDEX_KEY)
filp->f_pos = INT_LIMIT(typeof(filp->f_pos)); filp->f_pos = INT_LIMIT(typeof(filp->f_pos));
else
filp->f_pos++;
nopos: nopos:
ret = 0; ret = 0;
err: err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment