diff options
author | Sage Weil <sage@newdream.net> | 2010-11-11 19:48:59 -0500 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-11-11 19:48:59 -0500 |
commit | 7b88dadc13e0004947de52df128dbd5b0754ed0a (patch) | |
tree | 9a2fd203b382b5922dfd1be5cb3adf055ff50c2d | |
parent | a1629c3b24f26ec1b0f534874af674a6b4c1540b (diff) |
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: Sage Weil <sage@newdream.net>
-rw-r--r-- | fs/ceph/dir.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 1e11ed716f85..5f67728ba4d7 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -336,7 +336,10 @@ more: | |||
336 | if (req->r_reply_info.dir_end) { | 336 | if (req->r_reply_info.dir_end) { |
337 | kfree(fi->last_name); | 337 | kfree(fi->last_name); |
338 | fi->last_name = NULL; | 338 | fi->last_name = NULL; |
339 | fi->next_offset = 2; | 339 | if (ceph_frag_is_rightmost(frag)) |
340 | fi->next_offset = 2; | ||
341 | else | ||
342 | fi->next_offset = 0; | ||
340 | } else { | 343 | } else { |
341 | rinfo = &req->r_reply_info; | 344 | rinfo = &req->r_reply_info; |
342 | err = note_last_dentry(fi, | 345 | err = note_last_dentry(fi, |