Skip to content

Commit

Permalink
Applying the allocated_size fix from 97764d2 to zfs_iter_snapshots
Browse files Browse the repository at this point in the history
to see if it helps with issue #123
  • Loading branch information
ilovezfs committed Mar 14, 2014
1 parent e2f9ae5 commit 20312c8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/libzfs/libzfs_iter.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data)
return (ret);
}

printf("zfs_iter_filesystems zhp %p : zhp->zfs_props %p : "
"zhp->zfs_user_props %p :\n"
" resetting zc.zc_nvlist_dst_size from %llu to "
"allocated_size %llu\n", zhp, zhp->zfs_props, zhp->zfs_user_props,
zc.zc_nvlist_dst_size, allocated_size);

zc.zc_nvlist_dst_size = allocated_size;

}
Expand All @@ -149,6 +155,7 @@ zfs_iter_snapshots(zfs_handle_t *zhp, boolean_t simple, zfs_iter_f func,
zfs_cmd_t zc = {"\0"};
zfs_handle_t *nzhp;
int ret;
uint64_t allocated_size;

if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT)
return (0);
Expand All @@ -157,6 +164,9 @@ zfs_iter_snapshots(zfs_handle_t *zhp, boolean_t simple, zfs_iter_f func,

if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
return (-1);

allocated_size = zc.zc_nvlist_dst_size;

while ((ret = zfs_do_list_ioctl(zhp, ZFS_IOC_SNAPSHOT_LIST_NEXT,
&zc)) == 0) {

Expand All @@ -171,6 +181,15 @@ zfs_iter_snapshots(zfs_handle_t *zhp, boolean_t simple, zfs_iter_f func,
zcmd_free_nvlists(&zc);
return (ret);
}

printf("zfs_iter_snapshots zhp %p : zhp->zfs_props %p : "
"zhp->zfs_user_props %p :\n"
" resetting zc.zc_nvlist_dst_size from %llu to "
"allocated_size %llu\n", zhp, zhp->zfs_props, zhp->zfs_user_props,
zc.zc_nvlist_dst_size, allocated_size);

zc.zc_nvlist_dst_size = allocated_size;

}
zcmd_free_nvlists(&zc);
return ((ret < 0) ? ret : 0);
Expand Down

0 comments on commit 20312c8

Please sign in to comment.