Skip to content

Commit

Permalink
Locating snapshot could busyloop
Browse files Browse the repository at this point in the history
If the first found snapshot was not the one
we were looking for, it would loop looking
for the first one again. Making it appear that
listing snapshot would hang.

Signed-off-by: Jorgen Lundman <[email protected]>
  • Loading branch information
lundman committed Oct 30, 2024
1 parent 801cc56 commit 2c7fc76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions module/os/windows/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,9 @@ zfsctl_vnop_readdir_snapdir(vnode_t *vp, emitdir_ptr_t *ctx, cred_t *cr,
zfsvfs_t *zfsvfs = zp->z_zfsvfs;
int flag_return_single_entry = flags & SL_RETURN_SINGLE_ENTRY ? 1 : 0;

// Caller sets 0 or index based on flags.
pos = ctx->offset;

dprintf("%s\n", __func__);

if ((error = zfs_enter(zfsvfs, FTAG)) != 0)
Expand Down
2 changes: 1 addition & 1 deletion module/os/windows/zfs/zfs_vnops_windows_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2198,8 +2198,8 @@ zfs_build_path(znode_t *start_zp, znode_t *start_parent, char **fullpath,
else if (zp->z_id == ZFSCTL_INO_SNAPDIR)
strlcpy(name, ZFS_SNAPDIR_NAME, MAXPATHLEN);
else if (zfsctl_is_leafnode(zp)) {
uint64_t id, pos = 0;
while (error == 0) {
uint64_t id, pos = 0;
boolean_t case_conflict;
dsl_pool_config_enter(
dmu_objset_pool(zfsvfs->z_os), FTAG);
Expand Down

0 comments on commit 2c7fc76

Please sign in to comment.