mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <behlendorf1@llnl.gov> Reviewed-by: Cedric Berger <cedric@precidata.com> Signed-off-by: Tony Perkins <tperkins@datto.com> Closes #11039
This commit is contained in:
committed by
Brian Behlendorf
parent
87f01fc158
commit
2132ae465d
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user