apfs: fix reading of large directories

A single call to apfs_readdir() is not necessarily enough to list a
whole directory; ctx->pos tries to keep track of the last dentry found,
so that the next call can continue from the same spot.

Now that the module can create large numbers of files, it has become
obvious that this doesn't work: many files are missing from the ls
output for big directories.  The bug is very simple: ctx->pos is being
incremented twice for each new record.  Remove one of the increments.

Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
This commit is contained in:
Ernesto A. Fernández
2019-10-13 12:47:06 -03:00
parent 9ebb4308ea
commit 39e4474396
-1
View File
@@ -218,7 +218,6 @@ static int apfs_readdir(struct file *file, struct dir_context *ctx)
if (!dir_emit(ctx, drec.name, drec.name_len,
drec.ino, drec.type))
break;
ctx->pos++;
}
pos--;
}