linux/fs/cifs
Steve French cdeaf9d04a smb3: allow previous versions to be mounted with snapshot= mount parm
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@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@Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt1
EmptyDir  newerdir
root@Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt1/newerdir

root@Ubuntu-17-Virtual-Machine:~/cifs-2.6# ls /mnt2
EmptyDir  file  newerdir  newestdir  timestamp-trace.cap
root@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.

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
2018-08-10 11:54:08 -05:00
..
asn1.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
cache.c cifs: use 64-bit timestamps for fscache 2018-08-07 14:15:41 -05:00
cifs_debug.c smb3: display stats counters for number of slow commands 2018-08-07 14:30:59 -05:00
cifs_debug.h cifs: add server argument to the dump_detail method 2018-05-27 17:56:35 -05:00
cifs_dfs_ref.c CIFS: add build_path_from_dentry_optional_prefix() 2017-03-01 22:26:10 -06:00
cifs_fs_sb.h smb3: fix redundant opens on root 2018-05-27 17:56:35 -05:00
cifs_ioctl.h Enable previous version support 2016-10-13 19:48:11 -05:00
cifs_spnego.c cifs: Create dedicated keyring for spnego operations 2016-05-19 21:56:30 -05:00
cifs_spnego.h [CIFS] Rename three structures to avoid camel case 2011-05-27 04:34:02 +00:00
cifs_unicode.c [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
cifs_unicode.h [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
cifs_uniupr.h cifs: correction of unicode header files 2010-08-20 00:46:42 +00:00
cifsacl.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
cifsacl.h cifs: For SMB2 security informaion query, check for minimum sized security descriptor instead of sizeof FileAllInformation class 2018-06-04 19:19:24 -05:00
cifsencrypt.c cifs: Make sure all data pages are signed correctly 2018-08-07 14:15:41 -05:00
cifsfs.c cifs: don't show domain= in mount output when domain is empty 2018-08-10 11:53:51 -05:00
cifsfs.h cifs: update internal module version number for cifs.ko to 2.12 2018-05-27 17:56:35 -05:00
cifsglob.h cifs: update receive_encrypted_standard to handle compounded responses 2018-08-09 21:19:45 -05:00
cifspdu.h CIFS: move DFS response parsing out of SMB1 code 2017-03-01 22:26:10 -06:00
cifsproto.h cifs: add compound_send_recv() 2018-08-07 14:23:20 -05:00
cifssmb.c cifs: use timespec64 internally 2018-08-07 14:15:41 -05:00
connect.c cifs: update receive_encrypted_standard to handle compounded responses 2018-08-09 21:19:45 -05:00
dir.c some smb3 fixes for stable, as well as addition of ftrace hooks for cifs.ko, and improvements in compounding and smbdirect (RDMA) 2018-06-04 14:42:46 -07:00
dns_resolve.c cifs: fix composing of mount options for DFS referrals 2013-05-24 13:08:31 -05:00
dns_resolve.h DNS: Separate out CIFS DNS Resolver code 2010-08-05 17:17:51 +00:00
export.c [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
file.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
fscache.c cifs: use 64-bit timestamps for fscache 2018-08-07 14:15:41 -05:00
fscache.h cifs: use 64-bit timestamps for fscache 2018-08-07 14:15:41 -05:00
inode.c smb3: Do not send SMB3 SET_INFO if nothing changed 2018-08-07 14:30:59 -05:00
ioctl.c [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
Kconfig cifs: simple stats should always be enabled 2018-08-07 14:20:22 -05:00
link.c smb3: don't request leases in symlink creation and query 2018-08-07 14:15:57 -05:00
Makefile smb3: Add ftrace tracepoints for improved SMB3 debugging 2018-05-27 17:56:35 -05:00
misc.c cifs: simple stats should always be enabled 2018-08-07 14:20:22 -05:00
netmisc.c cifs: use timespec64 internally 2018-08-07 14:15:41 -05:00
nterr.c CIFS: Rename 7 error codes to NT_ style 2012-07-24 10:25:10 -05:00
nterr.h CIFS: Rename 7 error codes to NT_ style 2012-07-24 10:25:10 -05:00
ntlmssp.h cifs: dynamic allocation of ntlmssp blob 2016-06-23 23:45:07 -05:00
readdir.c cifs: update calc_size to take a server argument 2018-05-27 17:56:35 -05:00
rfc1002pdu.h
sess.c smb2: Enforce sec= mount option 2017-03-02 23:13:37 -06:00
smb1ops.c cifs: simple stats should always be enabled 2018-08-07 14:20:22 -05:00
smb2file.c cifs: Fix stack out-of-bounds in smb{2,3}_create_lease_buf() 2018-07-05 13:48:25 -05:00
smb2glob.h cifs: remove struct smb2_hdr 2018-06-01 09:14:30 -05:00
smb2inode.c smb3: Do not send SMB3 SET_INFO if nothing changed 2018-08-07 14:30:59 -05:00
smb2maperror.c cifs: remove struct smb2_hdr 2018-06-01 09:14:30 -05:00
smb2misc.c smb3: simplify code by removing CONFIG_CIFS_SMB311 2018-08-07 14:15:56 -05:00
smb2ops.c cifs: add missing support for ACLs in SMB 3.11 2018-08-10 11:53:32 -05:00
smb2pdu.c smb3: allow previous versions to be mounted with snapshot= mount parm 2018-08-10 11:54:08 -05:00
smb2pdu.h smb3: allow previous versions to be mounted with snapshot= mount parm 2018-08-10 11:54:08 -05:00
smb2proto.h cifs: update smb2_queryfs() to use compounding 2018-08-09 21:19:56 -05:00
smb2status.h CIFS: Add SMB2 status codes 2012-07-24 10:25:13 -05:00
smb2transport.c CIFS: fix uninitialized ptr deref in smb2 signing 2018-08-07 14:30:59 -05:00
smbdirect.c cifs: fix SMB1 breakage 2018-07-05 13:48:24 -05:00
smbdirect.h cifs: fix SMB1 breakage 2018-07-05 13:48:24 -05:00
smbencrypt.c CIFS: refactor crypto shash/sdesc allocation&free 2018-04-01 20:24:39 -05:00
smberr.h cifs: map NT_STATUS_ERROR_WRITE_PROTECTED to -EROFS 2010-08-02 12:40:40 +00:00
smbfsctl.h [SMB3] Send durable handle v2 contexts when use of persistent handles required 2015-11-03 09:26:27 -06:00
trace.c smb3: Add ftrace tracepoints for improved SMB3 debugging 2018-05-27 17:56:35 -05:00
trace.h smb3: add tracepoint for slow responses 2018-08-07 14:28:01 -05:00
transport.c cifs: update receive_encrypted_standard to handle compounded responses 2018-08-09 21:19:45 -05:00
winucase.c [CIFS] quiet sparse compile warning 2013-09-08 14:54:24 -05:00
xattr.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00