[SMB3][PATCH] snapshots work from Linux!

Steve French smfrench at gmail.com
Fri Aug 10 07:38:31 UTC 2018


    mounting with the "snapshots=" mount parm allows a read-only
    view of a previous version of a file system (see MS-SMB2
    and "timewarp" tokens, section 2.2.13.2.6) based on the timestamp
    passed in on the snapshots mount parm.

    Add processing to optionally send this create context.

    Example output:

    /mnt1 is mounted with "snapshots=..." and will see an earlier
    version of the directory, with three fewer files than /mnt2
    the current version of the directory.

    root at Ubuntu-17-Virtual-Machine:~/cifs-2.6# cat /proc/mounts | grep cifs
    //172.22.149.186/public /mnt1 cifs
    ro,relatime,vers=default,cache=strict,username=smfrench,uid=0,noforceuid,gid=0,noforcegid,addr=172.22.149.186,file_mode=0755,dir_mode=0755,soft,nounix,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,snapshot=131748608570000000,actimeo=1

    //172.22.149.186/public /mnt2 cifs
    rw,relatime,vers=default,cache=strict,username=smfrench,uid=0,noforceuid,gid=0,noforcegid,addr=172.22.149.186,file_mode=0755,dir_mode=0755,soft,nounix,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1

    root at Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt1
    EmptyDir  newerdir
    root at Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt1/newerdir

    root at Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt2
    EmptyDir  file  newerdir  newestdir  timestamp-trace.cap
    root at Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt2/newerdir
    new-file-not-in-snapshot

    Snapshots are extremely useful for comparing previous versions of
files or directories,
    and recovering from data corruptions or mistakes.


See attached patch



-- 
Thanks,

Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-smb3-allow-previous-versions-to-be-mounted-with-snap.patch
Type: text/x-patch
Size: 4692 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180810/f769c1c9/0001-smb3-allow-previous-versions-to-be-mounted-with-snap.bin>


More information about the samba-technical mailing list