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

Workaround for 'zfs diff' shares error #1922

Closed
wants to merge 1 commit into from

Conversation

behlendorf
Copy link
Contributor

For some reason which is not yet fully explained it's possible for
stat64() to fail with EIO on the .zfs/shares directory. This then
causes the entire 'zfs diff' command to fail even though the shares
directory is not needed.

Until the root cause of the stat64() failure can be determined a
viable work around is to explicitly set the di->shares inode
number. The Linux .zfs directory implementation will always use
the same well known inode numbers for the top level directories.
Obtaining the number through stat64() is cleaner, but in case that
fails it can be safely assigned based on the known constant.

Signed-off-by: Brian Behlendorf [email protected]
Issue #1426
Issue #481

When creating a dataset with ZoL a zsb->z_shares_dir ZAP object
will not be created because shares are unimplemented.  Instead ZoL
just sets zsb->z_shares_dir to zero to indicate there are no shares.

However, if you import a pool which was created with a different
ZFS implementation then the shares ZAP object may exist.  Code was
added to handle this case but it clearly wasn't sufficiently tested
with other ZFS pools.

There was a bug in the zpl_shares_getattr() function which passed
the wrong inode to zfs_getattr_fast() for the case where are shares
ZAP object does exist.  This causes an EIO to be returned to stat64()
which in turn causes 'zfs diff' to fail.

This fix is the pass the correct inode after a sucessful zfs_zget().
Additionally, only put away the references if we were able to get one.

Signed-off-by: Brian Behlendorf [email protected]
Issue openzfs#1426
Issue openzfs#481
@behlendorf
Copy link
Contributor Author

Closing as obsolete

@behlendorf behlendorf closed this Dec 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant