-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Initial stable API + ClusterHQ libzfs_core extensions + various fixes #3907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
780f6f0
to
47eb5bb
Compare
* Destroying snapshots and bookmarks is not currently supported. Call | ||
* lzc_destroy_snaps and lzc_destroy_bookmarks for those respectively. | ||
* | ||
* The only currently valud property is the boolean "defer". It makes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo "valud" > "valid"
b141e16
to
b23828a
Compare
Some minor changes have been made.
|
@@ -169,6 +171,29 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name, | |||
return (error); | |||
} | |||
|
|||
static int | |||
lzc_ioctl(const char *cmd, const char *name, nvlist_t *source, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between source (innvl) and opts? why separate them out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked during an earlier review; the answer was this was to let "options remain separate from actual data (e.g. a list of properties to set) so that we don't get pesky namespace collisions or inconsistencies from future extensions"
It also exists as an nvlist rather than a bitmask for said extensions. I'm still not entirely convinced this is necessary (worst case, nested lists would work).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryao commit
and errors with |
@mmlb Thanks for catching that. This is fixed in my local branch. I will clean it up and push it on either Thursday and Friday. |
9ea9c20
to
48de27d
Compare
@behlendorf @ahrens @mmlb This has been refreshed. There have been several changes from the last push:
There are a few minor outstanding things, but they should not impede review of this code:
An almost identical version was put into production in Gentoo Linux 1 week ago. The only difference is that So far, the only reported problem has been grub2-probe breaking when linked against the new libzfs.so on a system where an older kernel module is used. GRUB2 links to libzfs.so so that it can (ab)use it to read the cachefile and fallback to getting the cache file contents from the kernel if it is missing, which means it breaks every time that functionality changes in a backward incompatible way. The GRUB2 developers have requested functionality like |
48de27d
to
2deb68e
Compare
Clang's Address Sanitizer found a few issues in |
@ryao can these patches be structured such that intermediary patches in the stack don't break the build. |
@behlendorf Yes. I am working on that now. |
2deb68e
to
99918d3
Compare
a3b3606
to
b0fc5d2
Compare
b0fc5d2
to
d50f471
Compare
This is unused functionality that could bite us in the future. Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
lzc_snaprange_space has a couple of bugs. One is that `usedp == NULL` will cause a segmentation fault. Another is that passing snapshots from different datasets will return ENOENT rather than EXDEV, which is inconsistent. This corrects that to make this more predictable. Signed-off-by: Richard Yao <ryao@gentoo.org>
Some non-essential properties like mountpoint are lost during the creation of a temporary pool because will try to set them on the pool's permanent name, which does not exist inside the sPA namespace during pool creation. Most notably, the mountpoint property would be lost. Signed-off-by: Richard Yao <ryao@gentoo.org>
9eb3767
to
c585ca8
Compare
d03d464
to
8dad8bf
Compare
This introduces a new ZFS_IOC_LIBZFS_CORE ioctl and replaces the ioctl calls in all but 1 function in libzfs_core.so and adds many more. It is intended to be as stable kernel/userland interface that allows basic userland functionality to continue working when an older userland is used with newer kernel modules or vice versa by mistake. At this time, it is a subset of the legacy functionality, but enough API functions have been implemented that mismatched kernel/userland code will not break the Gentoo's boot process (excluding zfs share and ZED, which are excluded at this time) and ClusterHQ's flocker. This sufficiently addresses the long standing /dev/zfs API instability that it opens the possibility of stabilization of the ZFS packaging in Gentoo on amd64 and other architectures, which makes this an improvement in more ways than one. To ease the transition to the new ABI, we include a shim library that implements the new C library extensions using the old kernel ABI. The --with-libzfs_core=default|all|legacy|stable configure switch determines which is used and presently, the default is an alias for legacy that can be changed in a future release. --with-libzfs_core=all will install both, with libzfs_core.so.1 using the new ABI while a libzfs_core-legacy.so.0 that can be loaded with LD_PRELOAD will be installed containing the old one. Signed-off-by: Richard Yao <ryao@gentoo.org>
8dad8bf
to
32b87ca
Compare
@ryao I'd like to close this PR until it's being actively worked on again. We can always open a new PR in the future. |
@behlendorf Sure thing. |
This contains the initial stable API, the libzfs_core extensions and various fixes that we have developed at ClusterHQ for use with flocker. It also cherry-picks the proposed fix for Illumos 6267 from #3874. This was needed to fix test failures at ClusterHQ.
The current code passes the functional tests in clusterhq/pyzfs and the flocker acceptance tests. There are no known regressions in ClusterHQ's tracker and the code is believed to be production quality.