Skip to content
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

Version ZFS ioctls #1290

Closed
behlendorf opened this issue Feb 12, 2013 · 7 comments
Closed

Version ZFS ioctls #1290

behlendorf opened this issue Feb 12, 2013 · 7 comments
Labels
Type: Feature Feature request or new feature
Milestone

Comments

@behlendorf
Copy link
Contributor

We've had a couple cases where the user space bits end up out of sync with the kernel modules. Something because the kernel modules couldn't be unloaded, sometimes because the user space packages never got updated. This can result in strange behavior and bogus bug reports.

To catch this sort of problem early it would probably be a good idea to start strictly versioning the ioctl()s. This would all us to detect immediately is something isn't right and report a useful error to the user. It would also force us to be even stricter about ABI changes to this interface.

@jcumming
Copy link

+1

I just had an outdated version of the userland utilities tell me that all of my vdevs were corrupted when I was trying to import a pool.

@behlendorf
Copy link
Contributor Author

Once #1923 is merged libzfs_init() can be updated to read the module version from /sys/module/zfs/version. This could then be compared against either a table of x.y.z version numbers for maximum compatibility, or more strictly (and simply) just verify the utility x.y.z version matches the module x.y.z version. If the case of a mismatch a clear error should be generated describing the issue. This would ensure we never issue ioctls() to the kernel for mismatched versions which has the potential to be dangerous.

@ryao what do you think, is this is reasonable first step? I know you've given this some thought.

@behlendorf
Copy link
Contributor Author

As a point of reference FreeBSD does implement compatibility between older utilities and newer kernels in zfs_ioctl_compat.c. This would be desirable but it doesn't really cover our more likely case of the utilities being updated but the kernel being left back until a reboot can be scheduled. Still this would be nice to have so I thought I'd reference it.

@FransUrbo
Copy link
Contributor

@behlendorf Didn't you finish this, or was it just the prequel (#1923)?

@behlendorf
Copy link
Contributor Author

@FransUrbo #1923 was just the first easy part. That allows us to cleanly expose the module version information. Now the utilities need to do something with it.

@FransUrbo
Copy link
Contributor

Ah, ok.

@behlendorf
Copy link
Contributor Author

Closing. This issue was addressed by the following commits which provide nvpair validation for new style ioc input and a mechanism for the installed kernel module to advertise what features and properties are supported.

b83a0e2 Add basic zfs ioc input nvpair validation
e8bcb69 Add zfs module feature and property info to sysfs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Feature request or new feature
Projects
None yet
Development

No branches or pull requests

3 participants