Commit 7b88dadc authored by Sage Weil's avatar Sage Weil

ceph: fix frag offset for non-leftmost frags

We start at offset 2 for the leftmost frag, and 0 for subsequent frags.
When we reach the end (rightmost), we go back to 2.  This fixes readdir on
fragmented (large) directories.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent a1629c3b
......@@ -336,7 +336,10 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (req->r_reply_info.dir_end) {
kfree(fi->last_name);
fi->last_name = NULL;
if (ceph_frag_is_rightmost(frag))
fi->next_offset = 2;
else
fi->next_offset = 0;
} else {
rinfo = &req->r_reply_info;
err = note_last_dentry(fi,
......
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