aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index d776b29a1676..4fd2b168b2c4 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -486,19 +486,18 @@ static int btrfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
486 continue; 486 continue;
487 if (btrfs_disk_key_offset(&item->key) < filp->f_pos) 487 if (btrfs_disk_key_offset(&item->key) < filp->f_pos)
488 continue; 488 continue;
489 489 filp->f_pos = btrfs_disk_key_offset(&item->key);
490 advance = 1; 490 advance = 1;
491 di = btrfs_item_ptr(leaf, slot, struct btrfs_dir_item); 491 di = btrfs_item_ptr(leaf, slot, struct btrfs_dir_item);
492 over = filldir(dirent, (const char *)(di + 1), 492 over = filldir(dirent, (const char *)(di + 1),
493 btrfs_dir_name_len(di), 493 btrfs_dir_name_len(di),
494 btrfs_disk_key_offset(&item->key), 494 btrfs_disk_key_offset(&item->key),
495 btrfs_dir_objectid(di), d_type); 495 btrfs_dir_objectid(di), d_type);
496 if (over) { 496 if (over)
497 filp->f_pos = btrfs_disk_key_offset(&item->key); 497 goto nopos;
498 break;
499 }
500 filp->f_pos = btrfs_disk_key_offset(&item->key) + 1;
501 } 498 }
499 filp->f_pos++;
500nopos:
502 ret = 0; 501 ret = 0;
503err: 502err:
504 btrfs_release_path(root, path); 503 btrfs_release_path(root, path);