Discussion:
Accessing snapshots via .zfs/snapshot feature
(too old to reply)
ray vantassle
2012-01-09 17:22:07 UTC
Permalink
Is anybody thinking of doing any effort to make this work? I see some
discussion w/r/t this in both zfs-fuse and zfsonlinux, but it's not yet
present on either. Zfsonlinux folks seem to be trying to kludge it via
automounter, which seems to me to be, well, a messy kludge.

I'm am willing to look into adding this feature to zfs-fuse.
For those who have looked into it: Is it even remotely possible? Or is it
one of those things where "you can't get there from here"?
I'd rather see it working properly instead of being a kludge like
clone/destroy or automount?

Is it even worth looking at? If I did get it working, would the fixes be
accepted into the official zfs-fuse?

If so, I can start. Any pointers or tips or thoughts to get me started
would be appreciated.
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
sgheeren
2012-01-09 19:41:54 UTC
Permalink
Post by ray vantassle
Is anybody thinking of doing any effort to make this work? I see some
discussion w/r/t this in both zfs-fuse
Thinking of, hell yes! However, to my knowledge no-one ever had enough
knowledge about both the Solaris/ZFS codebase and Linux Fuse to pull it off.
To date, the most recent code is a topic branch by Emmanuel Anne
(showing some real pragmatic progress), rebased on a more recent branch
by me: sehe.nl/newctl
<http://gitweb.zfs-fuse.net/?p=sehe;a=shortlog;h=refs/heads/newctl>


The rebase was on top of 7cb2c61cfe7505b7abe53dc935be250e095e00e6 which
occurred roughly 15 commits before labeled 0.7.0 (see
http://gitweb.zfs-fuse.net/?p=sehe;a=log;h=master;hp=7cb2c61cfe7505b7abe53dc935be250e095e00e6
for relevant shortlog of differences)

It could most likely be rebased some more

* i'm not sure whether you'll like it (I'm not sure whether I do
myself) as it will actually invoke userland `zfs clone`/`zfs
mount` from within libzfs. Actually, it is less of an issue than
that might seem, since calling userland tools comes somewhat
naturally with fuse drivers, but it does feel like a (formidable)
kludge
* representative lines;
o snprintf(cmd,4096,"zfs clone -o
mountpoint=\"%s/.zfs/snapshot/%s\" -o readonly=on %s@%s
%s/snap_%s",mt,snapname,osname,snapname,osname,snapname);
o snprintf(cmd,4096,"zfs destroy %s",temp_snap[n]);
o sprintf(dir,"umount \"%s/.zfs\"",osname); system(dir);

* this is practically untested (I think I'm the only one who has
ever used it; I remember here are issues with the number of clones
mounted and it being quite slow)
* It *does* provide a reference as to implementing the fuse VFS
functions, and it shows some potential in that it actually mounts
datasets...
Post by ray vantassle
Zfsonlinux folks seem to be trying to kludge it via automounter, which
seems to me to be, well, a messy kludge
I'm afraid that you'd have to dismiss the Solaris implementation as a
messy kludge too, then, since, AFAIR Solaris leverages the kernel
automounter that is native in Solaris, so it is the same story. I
believe I remember there being an auto-dismount after a certain
grace-period of idle-ness per (dataset) mount point.
Post by ray vantassle
Is it even worth looking at? If I did get it working, would the fixes
be accepted into the official zfs-fuse?
Absolutely! Let me know what you can do for us, I'd be glad to be a
tester, allthough I must admit I moved my own system(s) over to
zfs-on-linux (except for a production machine)

Regards,
Seth
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
Brian Behlendorf
2012-01-09 20:41:44 UTC
Permalink
For what it's worth this support is close to being merged in to the
master branch for ZoL, at least for 2.6.37 and newer kernels. What is
holding it up is additional testing/feedback that everything works as
expected.

https://github.com/zfsonlinux/zfs/issues/173#issuecomment-3127660

Originally, I wanted to hold it back for 2.6.36 and earlier kernel
support but if everything else tests fine we could leave that for a
latter date. What really needs to be verified is:

* Everything works as expected with 2.6.37 and newer kernels
* The code causes no unexpected issues with 2.6.36 and older kernels.
You will just get the list of snapshots under .zfs/snapshot/ and have to
manually mount them.
* Accessing .zfs/snapshot/ directories over an NFS export works.
--
Thanks,
Brian
Post by sgheeren
Post by ray vantassle
Is anybody thinking of doing any effort to make this work? I see
some discussion w/r/t this in both zfs-fuse
Thinking of, hell yes! However, to my knowledge no-one ever had enough
knowledge about both the Solaris/ZFS codebase and Linux Fuse to pull it off.
To date, the most recent code is a topic branch by Emmanuel Anne
(showing some real pragmatic progress), rebased on a more recent
branch by me: sehe.nl/newctl
The rebase was on top of 7cb2c61cfe7505b7abe53dc935be250e095e00e6
which occurred roughly 15 commits before labeled 0.7.0 (see
http://gitweb.zfs-fuse.net/?p=sehe;a=log;h=master;hp=7cb2c61cfe7505b7abe53dc935be250e095e00e6 for relevant shortlog of differences)
It could most likely be rebased some more
* i'm not sure whether you'll like it (I'm not sure whether I do
myself) as it will actually invoke userland `zfs clone`/`zfs
mount` from within libzfs. Actually, it is less of an issue
than that might seem, since calling userland tools comes
somewhat naturally with fuse drivers, but it does feel like a
(formidable) kludge
* representative lines;
* snprintf(cmd,4096,"zfs clone -o mountpoint=\"%
s",mt,snapname,osname,snapname,osname,snapname);
* snprintf(cmd,4096,"zfs destroy %s",temp_snap[n]);
* sprintf(dir,"umount \"%s/.zfs\"",osname); system(dir);
* this is practically untested (I think I'm the only one who has
ever used it; I remember here are issues with the number of
clones mounted and it being quite slow)
* It *does* provide a reference as to implementing the fuse VFS
functions, and it shows some potential in that it actually
mounts datasets...
Post by ray vantassle
Zfsonlinux folks seem to be trying to kludge it via automounter,
which seems to me to be, well, a messy kludge
I'm afraid that you'd have to dismiss the Solaris implementation as a
messy kludge too, then, since, AFAIR Solaris leverages the kernel
automounter that is native in Solaris, so it is the same story. I
believe I remember there being an auto-dismount after a certain
grace-period of idle-ness per (dataset) mount point.
Post by ray vantassle
Is it even worth looking at? If I did get it working, would the
fixes be accepted into the official zfs-fuse?
Absolutely! Let me know what you can do for us, I'd be glad to be a
tester, allthough I must admit I moved my own system(s) over to
zfs-on-linux (except for a production machine)
Regards,
Seth
--
To visit our Web site, click on http://zfs-fuse.net/
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
Loading...