diff options
author | Tony Perkins <[email protected]> | 2020-09-27 20:46:22 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2020-11-11 17:06:16 -0800 |
commit | 9bd14b8724717bd344ac0c61378fc60e501c3c13 (patch) | |
tree | a6f4f251cd76d3ef558cdc47052967d7f5758e43 /module/os/linux/zfs/zpl_ctldir.c | |
parent | 3fcd737478217ab3f4cc518fadb20e1931f13dfe (diff) |
Start snapdir_iterate traversals to begin wtih the value of zero.
The microzap hash can sometimes be zero for single digit snapnames.
The zap cursor can then have a serialized value of two (for . and ..),
and skip the first entry in the avl tree for the .zfs/snapshot directory
listing, and therefore does not return all snapshots.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Cedric Berger <[email protected]>
Signed-off-by: Tony Perkins <[email protected]>
Closes #11039
Diffstat (limited to 'module/os/linux/zfs/zpl_ctldir.c')
-rw-r--r-- | module/os/linux/zfs/zpl_ctldir.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/module/os/linux/zfs/zpl_ctldir.c b/module/os/linux/zfs/zpl_ctldir.c index fa4500f6f..b503962cd 100644 --- a/module/os/linux/zfs/zpl_ctldir.c +++ b/module/os/linux/zfs/zpl_ctldir.c @@ -248,7 +248,8 @@ zpl_snapdir_iterate(struct file *filp, zpl_dir_context_t *ctx) if (!zpl_dir_emit_dots(filp, ctx)) goto out; - pos = ctx->pos; + /* Start the position at 0 if it already emitted . and .. */ + pos = (ctx->pos == 2 ? 0 : ctx->pos); while (error == 0) { dsl_pool_config_enter(dmu_objset_pool(zfsvfs->z_os), FTAG); error = -dmu_snapshot_list_next(zfsvfs->z_os, MAXNAMELEN, |