diff --git a/kmod/src/ioctl.c b/kmod/src/ioctl.c index abbf3fa4..2013b31c 100644 --- a/kmod/src/ioctl.c +++ b/kmod/src/ioctl.c @@ -123,8 +123,7 @@ static long scoutfs_ioc_walk_inodes(struct file *file, unsigned long arg) if (ret < 0) goto out; - for (nr = 0; nr < walk.nr_entries; - nr++, walk.entries_ptr += sizeof(ent)) { + for (nr = 0; nr < walk.nr_entries; ) { ret = scoutfs_item_next_same(sb, &key, &last_key, NULL, lock->end); if (ret < 0 && ret != -ENOENT) @@ -178,6 +177,9 @@ static long scoutfs_ioc_walk_inodes(struct file *file, unsigned long arg) break; } + nr++; + walk.entries_ptr += sizeof(ent); + scoutfs_key_inc_cur_len(&key); }