Will Andrews
2013-08-01 03:13:30 UTC
Hi,
What's the plan for how/when changes to libzfs_core's API can be done?
I'm looking at zfs_destroy_snaps_nvl()/lzc_destroy_snaps()
specifically. The 'zfs destroy' command has an '-f' option which is
supposed to mean "do a force unmount". In the case of snapshots,
however, the absence of this flag is ignored and the snapshots are
always force unmounted, as you can see from:
zfs_do_destroy()
zfs_destroy_snaps_nvl()
lzc_destroy_snaps()
lzc_ioctl() -> ioctl()
--syscall interface--
zfs_ioc_destroy_snaps()
zfs_unmount_snap()
dounmount(..., MS_FORCE, ...)
It seems to me that zfs_destroy_snaps_nvl()/lzc_destroy_snaps() should
accept an args nvlist that already has the "snaps" and "defer" keys
filled in, so the call API doesn't need to be changed to support
additional flags, such as "force".
"force" in this case would be passed down to zfs_unmount_snap() in the
kernel so it has the option of returning an error.
Thoughts?
--Will.
What's the plan for how/when changes to libzfs_core's API can be done?
I'm looking at zfs_destroy_snaps_nvl()/lzc_destroy_snaps()
specifically. The 'zfs destroy' command has an '-f' option which is
supposed to mean "do a force unmount". In the case of snapshots,
however, the absence of this flag is ignored and the snapshots are
always force unmounted, as you can see from:
zfs_do_destroy()
zfs_destroy_snaps_nvl()
lzc_destroy_snaps()
lzc_ioctl() -> ioctl()
--syscall interface--
zfs_ioc_destroy_snaps()
zfs_unmount_snap()
dounmount(..., MS_FORCE, ...)
It seems to me that zfs_destroy_snaps_nvl()/lzc_destroy_snaps() should
accept an args nvlist that already has the "snaps" and "defer" keys
filled in, so the call API doesn't need to be changed to support
additional flags, such as "force".
"force" in this case would be passed down to zfs_unmount_snap() in the
kernel so it has the option of returning an error.
Thoughts?
--Will.