-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support .zfs/snapshot access via NFS #616
Comments
The issue appears to be that zpl_encode_fh() is generating short rather than long fids for the snapshot entries. Short fids should be used for the normal zfs filesystem and the .zfs entires. However, long fids need to be used for the snapshot directories to ensure the object set is encoded. zfs_fid() is setup to do this but it assumes that the .zfsctl are part of a different filesystem from the normal filesystem. This is true on Solaris but not on Linux due to an implementation detail. We're going to need a different way to make the same check, we may also need to trigger automounting of the snapshot here. |
Just checking back on this item - has any progress been made on this item? Maybe rc12 has some developments on it? |
@bubble1975 I'd love to see this fixed, but so far nobody has found the time to work on it. |
This issue hurts me badly enough to make me look into it. @behlendorf Do you believe your comment above about Linux vs Solaris behavior still holds true ? It feels like latest changes to .zfs/snapshots hierarchy invalidated it. I've experimented with different approaches, but without any particular success meanwhile. I will summarize my observations and update this issue later. |
@imp First off, thanks for starting to work on this. This is support I'd love to be using as well but I haven't had the time to dedicate to it. Doing it right is more complicated than it initially appears. The above comments about the .zfs directory being part of the mounted dataset on Linux are true. But upon further reflection it's not clear to me that's part of the problem. Someone still needs to dig in to this and determine exactly what the problem is so I'm looking forward to your analysis. A few things to keep in mind when looking at this.
|
Are there any improvements made? This feature is very important for us, we need to export the snapshots via NFS. Are there any workarounds? |
@illenseer Short of properly implementing this for Linux the only workaround I can think of is to manually mount the snapshot |
Just want to give a heads up for all the interested party - my college @andrey-ve and me spent a lot of time recently on this issue. The problem turned out to be quite entangled. We have a working solution which we are going to push for review shortly. (All the gory details are going to be in review) |
Just want to let you know that I've compiled the zfs-snap branch of @andrey-ve including those patches and now snapshots are accessible from NFS export mounted on another linux box. Good work :) |
This also might affect bind mounts (e.g. when trying to access a snapshot from within a linux container or a docker box): http://comments.gmane.org/gmane.linux.file-systems.zfs.user/20179 @behlendorf , what's the reason to have the milestone set to 0.8.0? It seems that there are working patches since more than a year. Solving this would allow much new use cases for zfs on linux. |
For bind mounts (e.g. in lxc containers) the issue can be workarounded by calling
before creating the bind mount. |
@micw Can you elaborate on the workaround with "--make-shared"? I was pretty excited when I saw it but unfortunately it does not work for me: On the "root machine" (hardware node):
Then, entering the OpenVZ container (conceptually should be the same as LXC):
... exactly the same result as without "--make-shared" :-( |
This patch is based on the previous work done by @andrey-ve and @yshui. It triggers the automount by using kern_path() to traverse to the known snapshout mount point. Once the snapshot is mounted NFS can access the contents of the snapshot. Signed-off-by: Brian Behlendorf <[email protected]> Issue openzfs#2797 Issue openzfs#1655 Issue openzfs#616
This patch is based on the previous work done by @andrey-ve and @yshui. It triggers the automount by using kern_path() to traverse to the known snapshout mount point. Once the snapshot is mounted NFS can access the contents of the snapshot. Allowing NFS clients to access to the .zfs/snapshot directory would normally mean that a root user on a client mounting an export with 'no_root_squash' would be able to use mkdir/rmdir/mv to manipulate snapshots on the server. To prevent configuration mistakes a zfs_admin_snapshot module option was added which disables the mkdir/rmdir/mv functionally. System administators desiring this functionally must explicitly enable it. Signed-off-by: Brian Behlendorf <[email protected]> Issue openzfs#2797 Issue openzfs#1655 Issue openzfs#616
This patch is based on the previous work done by @andrey-ve and @yshui. It triggers the automount by using kern_path() to traverse to the known snapshout mount point. Once the snapshot is mounted NFS can access the contents of the snapshot. Allowing NFS clients to access to the .zfs/snapshot directory would normally mean that a root user on a client mounting an export with 'no_root_squash' would be able to use mkdir/rmdir/mv to manipulate snapshots on the server. To prevent configuration mistakes a zfs_admin_snapshot module option was added which disables the mkdir/rmdir/mv functionally. System administators desiring this functionally must explicitly enable it. Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#2797 Closes openzfs#1655 Closes openzfs#616
This patch is based on the previous work done by @andrey-ve and @yshui. It triggers the automount by using kern_path() to traverse to the known snapshout mount point. Once the snapshot is mounted NFS can access the contents of the snapshot. Allowing NFS clients to access to the .zfs/snapshot directory would normally mean that a root user on a client mounting an export with 'no_root_squash' would be able to use mkdir/rmdir/mv to manipulate snapshots on the server. To prevent configuration mistakes a zfs_admin_snapshot module option was added which disables the mkdir/rmdir/mv functionally. System administators desiring this functionally must explicitly enable it. Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#2797 Closes openzfs#1655 Closes openzfs#616
Perform the already past expiration time check before updating cvp->cv_mutex with the provided mutex. This check only depends on local state. Doing it first ensures that cvp->cv_mutex will not be updated in the timeout case or if it's ever called with an expire_time <= now. Reviewed-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#616
Signed-off-by: Paul Dagnelie <[email protected]>
While the .zfs/snapshot directory is supported in the latest source, it is not yet accessible via NFS. There are a few integrations issues with the Linux NFS kernel servers which still need to be worked out. This issue is to track that work.
The text was updated successfully, but these errors were encountered: