aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/cifsfs.c94
-rw-r--r--fs/cifs/cifsfs.h22
-rw-r--r--fs/cifs/cifsglob.h8
-rw-r--r--fs/cifs/connect.c5
-rw-r--r--fs/cifs/file.c16
-rw-r--r--fs/cifs/inode.c71
-rw-r--r--fs/cifs/ioctl.c2
-rw-r--r--fs/cifs/netmisc.c9
-rw-r--r--fs/cifs/smb2ops.c2
-rw-r--r--fs/cifs/smb2pdu.c19
-rw-r--r--fs/cifs/smb2pdu.h8
11 files changed, 158 insertions, 98 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 5be1f997ecde..6aaa8112c538 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -87,10 +87,6 @@ extern mempool_t *cifs_mid_poolp;
87 87
88struct workqueue_struct *cifsiod_wq; 88struct workqueue_struct *cifsiod_wq;
89 89
90#ifdef CONFIG_CIFS_SMB2
91__u8 cifs_client_guid[SMB2_CLIENT_GUID_SIZE];
92#endif
93
94/* 90/*
95 * Bumps refcount for cifs super block. 91 * Bumps refcount for cifs super block.
96 * Note that it should be only called if a referece to VFS super block is 92 * Note that it should be only called if a referece to VFS super block is
@@ -251,11 +247,7 @@ cifs_alloc_inode(struct super_block *sb)
251 * server, can not assume caching of file data or metadata. 247 * server, can not assume caching of file data or metadata.
252 */ 248 */
253 cifs_set_oplock_level(cifs_inode, 0); 249 cifs_set_oplock_level(cifs_inode, 0);
254 cifs_inode->delete_pending = false; 250 cifs_inode->flags = 0;
255 cifs_inode->invalid_mapping = false;
256 clear_bit(CIFS_INODE_PENDING_OPLOCK_BREAK, &cifs_inode->flags);
257 clear_bit(CIFS_INODE_PENDING_WRITERS, &cifs_inode->flags);
258 clear_bit(CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2, &cifs_inode->flags);
259 spin_lock_init(&cifs_inode->writers_lock); 251 spin_lock_init(&cifs_inode->writers_lock);
260 cifs_inode->writers = 0; 252 cifs_inode->writers = 0;
261 cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ 253 cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */
@@ -302,7 +294,7 @@ cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server)
302 struct sockaddr_in *sa = (struct sockaddr_in *) &server->dstaddr; 294 struct sockaddr_in *sa = (struct sockaddr_in *) &server->dstaddr;
303 struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &server->dstaddr; 295 struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &server->dstaddr;
304 296
305 seq_printf(s, ",addr="); 297 seq_puts(s, ",addr=");
306 298
307 switch (server->dstaddr.ss_family) { 299 switch (server->dstaddr.ss_family) {
308 case AF_INET: 300 case AF_INET:
@@ -314,7 +306,7 @@ cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server)
314 seq_printf(s, "%%%u", sa6->sin6_scope_id); 306 seq_printf(s, "%%%u", sa6->sin6_scope_id);
315 break; 307 break;
316 default: 308 default:
317 seq_printf(s, "(unknown)"); 309 seq_puts(s, "(unknown)");
318 } 310 }
319} 311}
320 312
@@ -324,45 +316,45 @@ cifs_show_security(struct seq_file *s, struct cifs_ses *ses)
324 if (ses->sectype == Unspecified) 316 if (ses->sectype == Unspecified)
325 return; 317 return;
326 318
327 seq_printf(s, ",sec="); 319 seq_puts(s, ",sec=");
328 320
329 switch (ses->sectype) { 321 switch (ses->sectype) {
330 case LANMAN: 322 case LANMAN:
331 seq_printf(s, "lanman"); 323 seq_puts(s, "lanman");
332 break; 324 break;
333 case NTLMv2: 325 case NTLMv2:
334 seq_printf(s, "ntlmv2"); 326 seq_puts(s, "ntlmv2");
335 break; 327 break;
336 case NTLM: 328 case NTLM:
337 seq_printf(s, "ntlm"); 329 seq_puts(s, "ntlm");
338 break; 330 break;
339 case Kerberos: 331 case Kerberos:
340 seq_printf(s, "krb5"); 332 seq_puts(s, "krb5");
341 break; 333 break;
342 case RawNTLMSSP: 334 case RawNTLMSSP:
343 seq_printf(s, "ntlmssp"); 335 seq_puts(s, "ntlmssp");
344 break; 336 break;
345 default: 337 default:
346 /* shouldn't ever happen */ 338 /* shouldn't ever happen */
347 seq_printf(s, "unknown"); 339 seq_puts(s, "unknown");
348 break; 340 break;
349 } 341 }
350 342
351 if (ses->sign) 343 if (ses->sign)
352 seq_printf(s, "i"); 344 seq_puts(s, "i");
353} 345}
354 346
355static void 347static void
356cifs_show_cache_flavor(struct seq_file *s, struct cifs_sb_info *cifs_sb) 348cifs_show_cache_flavor(struct seq_file *s, struct cifs_sb_info *cifs_sb)
357{ 349{
358 seq_printf(s, ",cache="); 350 seq_puts(s, ",cache=");
359 351
360 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) 352 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
361 seq_printf(s, "strict"); 353 seq_puts(s, "strict");
362 else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) 354 else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO)
363 seq_printf(s, "none"); 355 seq_puts(s, "none");
364 else 356 else
365 seq_printf(s, "loose"); 357 seq_puts(s, "loose");
366} 358}
367 359
368static void 360static void
@@ -395,7 +387,7 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
395 cifs_show_cache_flavor(s, cifs_sb); 387 cifs_show_cache_flavor(s, cifs_sb);
396 388
397 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) 389 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER)
398 seq_printf(s, ",multiuser"); 390 seq_puts(s, ",multiuser");
399 else if (tcon->ses->user_name) 391 else if (tcon->ses->user_name)
400 seq_printf(s, ",username=%s", tcon->ses->user_name); 392 seq_printf(s, ",username=%s", tcon->ses->user_name);
401 393
@@ -421,16 +413,16 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
421 seq_printf(s, ",uid=%u", 413 seq_printf(s, ",uid=%u",
422 from_kuid_munged(&init_user_ns, cifs_sb->mnt_uid)); 414 from_kuid_munged(&init_user_ns, cifs_sb->mnt_uid));
423 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) 415 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)
424 seq_printf(s, ",forceuid"); 416 seq_puts(s, ",forceuid");
425 else 417 else
426 seq_printf(s, ",noforceuid"); 418 seq_puts(s, ",noforceuid");
427 419
428 seq_printf(s, ",gid=%u", 420 seq_printf(s, ",gid=%u",
429 from_kgid_munged(&init_user_ns, cifs_sb->mnt_gid)); 421 from_kgid_munged(&init_user_ns, cifs_sb->mnt_gid));
430 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) 422 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID)
431 seq_printf(s, ",forcegid"); 423 seq_puts(s, ",forcegid");
432 else 424 else
433 seq_printf(s, ",noforcegid"); 425 seq_puts(s, ",noforcegid");
434 426
435 cifs_show_address(s, tcon->ses->server); 427 cifs_show_address(s, tcon->ses->server);
436 428
@@ -442,47 +434,47 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
442 cifs_show_nls(s, cifs_sb->local_nls); 434 cifs_show_nls(s, cifs_sb->local_nls);
443 435
444 if (tcon->seal) 436 if (tcon->seal)
445 seq_printf(s, ",seal"); 437 seq_puts(s, ",seal");
446 if (tcon->nocase) 438 if (tcon->nocase)
447 seq_printf(s, ",nocase"); 439 seq_puts(s, ",nocase");
448 if (tcon->retry) 440 if (tcon->retry)
449 seq_printf(s, ",hard"); 441 seq_puts(s, ",hard");
450 if (tcon->unix_ext) 442 if (tcon->unix_ext)
451 seq_printf(s, ",unix"); 443 seq_puts(s, ",unix");
452 else 444 else
453 seq_printf(s, ",nounix"); 445 seq_puts(s, ",nounix");
454 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) 446 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
455 seq_printf(s, ",posixpaths"); 447 seq_puts(s, ",posixpaths");
456 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) 448 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID)
457 seq_printf(s, ",setuids"); 449 seq_puts(s, ",setuids");
458 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) 450 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
459 seq_printf(s, ",serverino"); 451 seq_puts(s, ",serverino");
460 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) 452 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
461 seq_printf(s, ",rwpidforward"); 453 seq_puts(s, ",rwpidforward");
462 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) 454 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL)
463 seq_printf(s, ",forcemand"); 455 seq_puts(s, ",forcemand");
464 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) 456 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
465 seq_printf(s, ",nouser_xattr"); 457 seq_puts(s, ",nouser_xattr");
466 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR) 458 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR)
467 seq_printf(s, ",mapchars"); 459 seq_puts(s, ",mapchars");
468 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) 460 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
469 seq_printf(s, ",sfu"); 461 seq_puts(s, ",sfu");
470 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) 462 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
471 seq_printf(s, ",nobrl"); 463 seq_puts(s, ",nobrl");
472 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) 464 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
473 seq_printf(s, ",cifsacl"); 465 seq_puts(s, ",cifsacl");
474 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) 466 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
475 seq_printf(s, ",dynperm"); 467 seq_puts(s, ",dynperm");
476 if (root->d_sb->s_flags & MS_POSIXACL) 468 if (root->d_sb->s_flags & MS_POSIXACL)
477 seq_printf(s, ",acl"); 469 seq_puts(s, ",acl");
478 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) 470 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS)
479 seq_printf(s, ",mfsymlinks"); 471 seq_puts(s, ",mfsymlinks");
480 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) 472 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE)
481 seq_printf(s, ",fsc"); 473 seq_puts(s, ",fsc");
482 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC) 474 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)
483 seq_printf(s, ",nostrictsync"); 475 seq_puts(s, ",nostrictsync");
484 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) 476 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
485 seq_printf(s, ",noperm"); 477 seq_puts(s, ",noperm");
486 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPUID) 478 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPUID)
487 seq_printf(s, ",backupuid=%u", 479 seq_printf(s, ",backupuid=%u",
488 from_kuid_munged(&init_user_ns, 480 from_kuid_munged(&init_user_ns,
@@ -1192,10 +1184,6 @@ init_cifs(void)
1192 spin_lock_init(&cifs_file_list_lock); 1184 spin_lock_init(&cifs_file_list_lock);
1193 spin_lock_init(&GlobalMid_Lock); 1185 spin_lock_init(&GlobalMid_Lock);
1194 1186
1195#ifdef CONFIG_CIFS_SMB2
1196 get_random_bytes(cifs_client_guid, SMB2_CLIENT_GUID_SIZE);
1197#endif
1198
1199 if (cifs_max_pending < 2) { 1187 if (cifs_max_pending < 2) {
1200 cifs_max_pending = 2; 1188 cifs_max_pending = 2;
1201 cifs_dbg(FYI, "cifs_max_pending set to min of 2\n"); 1189 cifs_dbg(FYI, "cifs_max_pending set to min of 2\n");
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 26a754f49ba1..8fe51166d6e3 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -22,20 +22,28 @@
22#ifndef _CIFSFS_H 22#ifndef _CIFSFS_H
23#define _CIFSFS_H 23#define _CIFSFS_H
24 24
25#include <linux/hash.h>
26
25#define ROOT_I 2 27#define ROOT_I 2
26 28
27/* 29/*
28 * ino_t is 32-bits on 32-bit arch. We have to squash the 64-bit value down 30 * ino_t is 32-bits on 32-bit arch. We have to squash the 64-bit value down
29 * so that it will fit. 31 * so that it will fit. We use hash_64 to convert the value to 31 bits, and
32 * then add 1, to ensure that we don't end up with a 0 as the value.
30 */ 33 */
34#if BITS_PER_LONG == 64
31static inline ino_t 35static inline ino_t
32cifs_uniqueid_to_ino_t(u64 fileid) 36cifs_uniqueid_to_ino_t(u64 fileid)
33{ 37{
34 ino_t ino = (ino_t) fileid; 38 return (ino_t)fileid;
35 if (sizeof(ino_t) < sizeof(u64))
36 ino ^= fileid >> (sizeof(u64)-sizeof(ino_t)) * 8;
37 return ino;
38} 39}
40#else
41static inline ino_t
42cifs_uniqueid_to_ino_t(u64 fileid)
43{
44 return (ino_t)hash_64(fileid, (sizeof(ino_t) * 8) - 1) + 1;
45}
46#endif
39 47
40extern struct file_system_type cifs_fs_type; 48extern struct file_system_type cifs_fs_type;
41extern const struct address_space_operations cifs_addr_ops; 49extern const struct address_space_operations cifs_addr_ops;
@@ -67,6 +75,8 @@ extern int cifs_revalidate_dentry_attr(struct dentry *);
67extern int cifs_revalidate_file(struct file *filp); 75extern int cifs_revalidate_file(struct file *filp);
68extern int cifs_revalidate_dentry(struct dentry *); 76extern int cifs_revalidate_dentry(struct dentry *);
69extern int cifs_invalidate_mapping(struct inode *inode); 77extern int cifs_invalidate_mapping(struct inode *inode);
78extern int cifs_revalidate_mapping(struct inode *inode);
79extern int cifs_zap_mapping(struct inode *inode);
70extern int cifs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 80extern int cifs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
71extern int cifs_setattr(struct dentry *, struct iattr *); 81extern int cifs_setattr(struct dentry *, struct iattr *);
72 82
@@ -130,5 +140,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
130extern const struct export_operations cifs_export_ops; 140extern const struct export_operations cifs_export_ops;
131#endif /* CONFIG_CIFS_NFSD_EXPORT */ 141#endif /* CONFIG_CIFS_NFSD_EXPORT */
132 142
133#define CIFS_VERSION "2.02" 143#define CIFS_VERSION "2.03"
134#endif /* _CIFSFS_H */ 144#endif /* _CIFSFS_H */
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 30f6e9251a4a..de6aed8c78e5 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -559,6 +559,7 @@ struct TCP_Server_Info {
559 int echo_credits; /* echo reserved slots */ 559 int echo_credits; /* echo reserved slots */
560 int oplock_credits; /* oplock break reserved slots */ 560 int oplock_credits; /* oplock break reserved slots */
561 bool echoes:1; /* enable echoes */ 561 bool echoes:1; /* enable echoes */
562 __u8 client_guid[SMB2_CLIENT_GUID_SIZE]; /* Client GUID */
562#endif 563#endif
563 u16 dialect; /* dialect index that server chose */ 564 u16 dialect; /* dialect index that server chose */
564 bool oplocks:1; /* enable oplocks */ 565 bool oplocks:1; /* enable oplocks */
@@ -1113,12 +1114,13 @@ struct cifsInodeInfo {
1113 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */ 1114 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */
1114 unsigned int oplock; /* oplock/lease level we have */ 1115 unsigned int oplock; /* oplock/lease level we have */
1115 unsigned int epoch; /* used to track lease state changes */ 1116 unsigned int epoch; /* used to track lease state changes */
1116 bool delete_pending; /* DELETE_ON_CLOSE is set */
1117 bool invalid_mapping; /* pagecache is invalid */
1118 unsigned long flags;
1119#define CIFS_INODE_PENDING_OPLOCK_BREAK (0) /* oplock break in progress */ 1117#define CIFS_INODE_PENDING_OPLOCK_BREAK (0) /* oplock break in progress */
1120#define CIFS_INODE_PENDING_WRITERS (1) /* Writes in progress */ 1118#define CIFS_INODE_PENDING_WRITERS (1) /* Writes in progress */
1121#define CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 (2) /* Downgrade oplock to L2 */ 1119#define CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 (2) /* Downgrade oplock to L2 */
1120#define CIFS_INO_DELETE_PENDING (3) /* delete pending on server */
1121#define CIFS_INO_INVALID_MAPPING (4) /* pagecache is invalid */
1122#define CIFS_INO_LOCK (5) /* lock bit for synchronization */
1123 unsigned long flags;
1122 spinlock_t writers_lock; 1124 spinlock_t writers_lock;
1123 unsigned int writers; /* Number of writers on this inode */ 1125 unsigned int writers; /* Number of writers on this inode */
1124 unsigned long time; /* jiffies of last update of inode */ 1126 unsigned long time; /* jiffies of last update of inode */
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 8813ff776ba3..20d75b8ddb26 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2144,6 +2144,9 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
2144 sizeof(tcp_ses->srcaddr)); 2144 sizeof(tcp_ses->srcaddr));
2145 memcpy(&tcp_ses->dstaddr, &volume_info->dstaddr, 2145 memcpy(&tcp_ses->dstaddr, &volume_info->dstaddr,
2146 sizeof(tcp_ses->dstaddr)); 2146 sizeof(tcp_ses->dstaddr));
2147#ifdef CONFIG_CIFS_SMB2
2148 get_random_bytes(tcp_ses->client_guid, SMB2_CLIENT_GUID_SIZE);
2149#endif
2147 /* 2150 /*
2148 * at this point we are the only ones with the pointer 2151 * at this point we are the only ones with the pointer
2149 * to the struct since the kernel thread not created yet 2152 * to the struct since the kernel thread not created yet
@@ -2225,7 +2228,7 @@ static int match_session(struct cifs_ses *ses, struct smb_vol *vol)
2225 vol->username ? vol->username : "", 2228 vol->username ? vol->username : "",
2226 CIFS_MAX_USERNAME_LEN)) 2229 CIFS_MAX_USERNAME_LEN))
2227 return 0; 2230 return 0;
2228 if (strlen(vol->username) != 0 && 2231 if ((vol->username && strlen(vol->username) != 0) &&
2229 ses->password != NULL && 2232 ses->password != NULL &&
2230 strncmp(ses->password, 2233 strncmp(ses->password,
2231 vol->password ? vol->password : "", 2234 vol->password ? vol->password : "",
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 5ed03e0b8b40..208f56eca4bf 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -335,7 +335,7 @@ cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
335 spin_unlock(&cifs_file_list_lock); 335 spin_unlock(&cifs_file_list_lock);
336 336
337 if (fid->purge_cache) 337 if (fid->purge_cache)
338 cifs_invalidate_mapping(inode); 338 cifs_zap_mapping(inode);
339 339
340 file->private_data = cfile; 340 file->private_data = cfile;
341 return cfile; 341 return cfile;
@@ -392,7 +392,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
392 * again and get at least level II oplock. 392 * again and get at least level II oplock.
393 */ 393 */
394 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) 394 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
395 CIFS_I(inode)->invalid_mapping = true; 395 set_bit(CIFS_INO_INVALID_MAPPING, &cifsi->flags);
396 cifs_set_oplock_level(cifsi, 0); 396 cifs_set_oplock_level(cifsi, 0);
397 } 397 }
398 spin_unlock(&cifs_file_list_lock); 398 spin_unlock(&cifs_file_list_lock);
@@ -1529,7 +1529,7 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1529 */ 1529 */
1530 if (!CIFS_CACHE_WRITE(CIFS_I(inode)) && 1530 if (!CIFS_CACHE_WRITE(CIFS_I(inode)) &&
1531 CIFS_CACHE_READ(CIFS_I(inode))) { 1531 CIFS_CACHE_READ(CIFS_I(inode))) {
1532 cifs_invalidate_mapping(inode); 1532 cifs_zap_mapping(inode);
1533 cifs_dbg(FYI, "Set no oplock for inode=%p due to mand locks\n", 1533 cifs_dbg(FYI, "Set no oplock for inode=%p due to mand locks\n",
1534 inode); 1534 inode);
1535 CIFS_I(inode)->oplock = 0; 1535 CIFS_I(inode)->oplock = 0;
@@ -2218,7 +2218,7 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
2218 file->f_path.dentry->d_name.name, datasync); 2218 file->f_path.dentry->d_name.name, datasync);
2219 2219
2220 if (!CIFS_CACHE_READ(CIFS_I(inode))) { 2220 if (!CIFS_CACHE_READ(CIFS_I(inode))) {
2221 rc = cifs_invalidate_mapping(inode); 2221 rc = cifs_zap_mapping(inode);
2222 if (rc) { 2222 if (rc) {
2223 cifs_dbg(FYI, "rc: %d during invalidate phase\n", rc); 2223 cifs_dbg(FYI, "rc: %d during invalidate phase\n", rc);
2224 rc = 0; /* don't care about it in fsync */ 2224 rc = 0; /* don't care about it in fsync */
@@ -2562,7 +2562,7 @@ ssize_t cifs_user_writev(struct kiocb *iocb, const struct iovec *iov,
2562 2562
2563 written = cifs_iovec_write(iocb->ki_filp, iov, nr_segs, &pos); 2563 written = cifs_iovec_write(iocb->ki_filp, iov, nr_segs, &pos);
2564 if (written > 0) { 2564 if (written > 0) {
2565 CIFS_I(inode)->invalid_mapping = true; 2565 set_bit(CIFS_INO_INVALID_MAPPING, &CIFS_I(inode)->flags);
2566 iocb->ki_pos = pos; 2566 iocb->ki_pos = pos;
2567 } 2567 }
2568 2568
@@ -2649,7 +2649,7 @@ cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov,
2649 * request comes - break it on the client to prevent reading 2649 * request comes - break it on the client to prevent reading
2650 * an old data. 2650 * an old data.
2651 */ 2651 */
2652 cifs_invalidate_mapping(inode); 2652 cifs_zap_mapping(inode);
2653 cifs_dbg(FYI, "Set no oplock for inode=%p after a write operation\n", 2653 cifs_dbg(FYI, "Set no oplock for inode=%p after a write operation\n",
2654 inode); 2654 inode);
2655 cinode->oplock = 0; 2655 cinode->oplock = 0;
@@ -3112,7 +3112,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
3112 xid = get_xid(); 3112 xid = get_xid();
3113 3113
3114 if (!CIFS_CACHE_READ(CIFS_I(inode))) { 3114 if (!CIFS_CACHE_READ(CIFS_I(inode))) {
3115 rc = cifs_invalidate_mapping(inode); 3115 rc = cifs_zap_mapping(inode);
3116 if (rc) 3116 if (rc)
3117 return rc; 3117 return rc;
3118 } 3118 }
@@ -3670,7 +3670,7 @@ void cifs_oplock_break(struct work_struct *work)
3670 if (!CIFS_CACHE_READ(cinode)) { 3670 if (!CIFS_CACHE_READ(cinode)) {
3671 rc = filemap_fdatawait(inode->i_mapping); 3671 rc = filemap_fdatawait(inode->i_mapping);
3672 mapping_set_error(inode->i_mapping, rc); 3672 mapping_set_error(inode->i_mapping, rc);
3673 cifs_invalidate_mapping(inode); 3673 cifs_zap_mapping(inode);
3674 } 3674 }
3675 cifs_dbg(FYI, "Oplock flush inode %p rc %d\n", inode, rc); 3675 cifs_dbg(FYI, "Oplock flush inode %p rc %d\n", inode, rc);
3676 } 3676 }
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index a22d667f1069..a174605f6afa 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -22,6 +22,7 @@
22#include <linux/stat.h> 22#include <linux/stat.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/pagemap.h> 24#include <linux/pagemap.h>
25#include <linux/freezer.h>
25#include <asm/div64.h> 26#include <asm/div64.h>
26#include "cifsfs.h" 27#include "cifsfs.h"
27#include "cifspdu.h" 28#include "cifspdu.h"
@@ -117,7 +118,7 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr)
117 118
118 cifs_dbg(FYI, "%s: invalidating inode %llu mapping\n", 119 cifs_dbg(FYI, "%s: invalidating inode %llu mapping\n",
119 __func__, cifs_i->uniqueid); 120 __func__, cifs_i->uniqueid);
120 cifs_i->invalid_mapping = true; 121 set_bit(CIFS_INO_INVALID_MAPPING, &cifs_i->flags);
121} 122}
122 123
123/* 124/*
@@ -177,7 +178,10 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr)
177 else 178 else
178 cifs_i->time = jiffies; 179 cifs_i->time = jiffies;
179 180
180 cifs_i->delete_pending = fattr->cf_flags & CIFS_FATTR_DELETE_PENDING; 181 if (fattr->cf_flags & CIFS_FATTR_DELETE_PENDING)
182 set_bit(CIFS_INO_DELETE_PENDING, &cifs_i->flags);
183 else
184 clear_bit(CIFS_INO_DELETE_PENDING, &cifs_i->flags);
181 185
182 cifs_i->server_eof = fattr->cf_eof; 186 cifs_i->server_eof = fattr->cf_eof;
183 /* 187 /*
@@ -1121,7 +1125,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
1121 } 1125 }
1122 1126
1123 /* try to set DELETE_ON_CLOSE */ 1127 /* try to set DELETE_ON_CLOSE */
1124 if (!cifsInode->delete_pending) { 1128 if (!test_bit(CIFS_INO_DELETE_PENDING, &cifsInode->flags)) {
1125 rc = CIFSSMBSetFileDisposition(xid, tcon, true, fid.netfid, 1129 rc = CIFSSMBSetFileDisposition(xid, tcon, true, fid.netfid,
1126 current->tgid); 1130 current->tgid);
1127 /* 1131 /*
@@ -1138,7 +1142,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
1138 rc = -EBUSY; 1142 rc = -EBUSY;
1139 goto undo_rename; 1143 goto undo_rename;
1140 } 1144 }
1141 cifsInode->delete_pending = true; 1145 set_bit(CIFS_INO_DELETE_PENDING, &cifsInode->flags);
1142 } 1146 }
1143 1147
1144out_close: 1148out_close:
@@ -1759,23 +1763,62 @@ int
1759cifs_invalidate_mapping(struct inode *inode) 1763cifs_invalidate_mapping(struct inode *inode)
1760{ 1764{
1761 int rc = 0; 1765 int rc = 0;
1762 struct cifsInodeInfo *cifs_i = CIFS_I(inode);
1763
1764 cifs_i->invalid_mapping = false;
1765 1766
1766 if (inode->i_mapping && inode->i_mapping->nrpages != 0) { 1767 if (inode->i_mapping && inode->i_mapping->nrpages != 0) {
1767 rc = invalidate_inode_pages2(inode->i_mapping); 1768 rc = invalidate_inode_pages2(inode->i_mapping);
1768 if (rc) { 1769 if (rc)
1769 cifs_dbg(VFS, "%s: could not invalidate inode %p\n", 1770 cifs_dbg(VFS, "%s: could not invalidate inode %p\n",
1770 __func__, inode); 1771 __func__, inode);
1771 cifs_i->invalid_mapping = true;
1772 }
1773 } 1772 }
1774 1773
1775 cifs_fscache_reset_inode_cookie(inode); 1774 cifs_fscache_reset_inode_cookie(inode);
1776 return rc; 1775 return rc;
1777} 1776}
1778 1777
1778/**
1779 * cifs_wait_bit_killable - helper for functions that are sleeping on bit locks
1780 * @word: long word containing the bit lock
1781 */
1782static int
1783cifs_wait_bit_killable(void *word)
1784{
1785 if (fatal_signal_pending(current))
1786 return -ERESTARTSYS;
1787 freezable_schedule_unsafe();
1788 return 0;
1789}
1790
1791int
1792cifs_revalidate_mapping(struct inode *inode)
1793{
1794 int rc;
1795 unsigned long *flags = &CIFS_I(inode)->flags;
1796
1797 rc = wait_on_bit_lock(flags, CIFS_INO_LOCK, cifs_wait_bit_killable,
1798 TASK_KILLABLE);
1799 if (rc)
1800 return rc;
1801
1802 if (test_and_clear_bit(CIFS_INO_INVALID_MAPPING, flags)) {
1803 rc = cifs_invalidate_mapping(inode);
1804 if (rc)
1805 set_bit(CIFS_INO_INVALID_MAPPING, flags);
1806 }
1807
1808 clear_bit_unlock(CIFS_INO_LOCK, flags);
1809 smp_mb__after_atomic();
1810 wake_up_bit(flags, CIFS_INO_LOCK);
1811
1812 return rc;
1813}
1814
1815int
1816cifs_zap_mapping(struct inode *inode)
1817{
1818 set_bit(CIFS_INO_INVALID_MAPPING, &CIFS_I(inode)->flags);
1819 return cifs_revalidate_mapping(inode);
1820}
1821
1779int cifs_revalidate_file_attr(struct file *filp) 1822int cifs_revalidate_file_attr(struct file *filp)
1780{ 1823{
1781 int rc = 0; 1824 int rc = 0;
@@ -1842,9 +1885,7 @@ int cifs_revalidate_file(struct file *filp)
1842 if (rc) 1885 if (rc)
1843 return rc; 1886 return rc;
1844 1887
1845 if (CIFS_I(inode)->invalid_mapping) 1888 return cifs_revalidate_mapping(inode);
1846 rc = cifs_invalidate_mapping(inode);
1847 return rc;
1848} 1889}
1849 1890
1850/* revalidate a dentry's inode attributes */ 1891/* revalidate a dentry's inode attributes */
@@ -1857,9 +1898,7 @@ int cifs_revalidate_dentry(struct dentry *dentry)
1857 if (rc) 1898 if (rc)
1858 return rc; 1899 return rc;
1859 1900
1860 if (CIFS_I(inode)->invalid_mapping) 1901 return cifs_revalidate_mapping(inode);
1861 rc = cifs_invalidate_mapping(inode);
1862 return rc;
1863} 1902}
1864 1903
1865int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, 1904int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index 77492301cc2b..45cb59bcc791 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -85,7 +85,7 @@ static long cifs_ioctl_clone(unsigned int xid, struct file *dst_file,
85 goto out_fput; 85 goto out_fput;
86 } 86 }
87 87
88 src_inode = src_file.file->f_dentry->d_inode; 88 src_inode = file_inode(src_file.file);
89 89
90 /* 90 /*
91 * Note: cifs case is easier than btrfs since server responsible for 91 * Note: cifs case is easier than btrfs since server responsible for
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index 049884552e76..6834b9c3bec1 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -795,8 +795,8 @@ cifs_print_status(__u32 status_code)
795 while (nt_errs[idx].nt_errstr != NULL) { 795 while (nt_errs[idx].nt_errstr != NULL) {
796 if (((nt_errs[idx].nt_errcode) & 0xFFFFFF) == 796 if (((nt_errs[idx].nt_errcode) & 0xFFFFFF) ==
797 (status_code & 0xFFFFFF)) { 797 (status_code & 0xFFFFFF)) {
798 printk(KERN_NOTICE "Status code returned 0x%08x %s\n", 798 pr_notice("Status code returned 0x%08x %s\n",
799 status_code, nt_errs[idx].nt_errstr); 799 status_code, nt_errs[idx].nt_errstr);
800 } 800 }
801 idx++; 801 idx++;
802 } 802 }
@@ -941,8 +941,9 @@ cifs_UnixTimeToNT(struct timespec t)
941 return (u64) t.tv_sec * 10000000 + t.tv_nsec/100 + NTFS_TIME_OFFSET; 941 return (u64) t.tv_sec * 10000000 + t.tv_nsec/100 + NTFS_TIME_OFFSET;
942} 942}
943 943
944static int total_days_of_prev_months[] = 944static const int total_days_of_prev_months[] = {
945{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; 945 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
946};
946 947
947struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset) 948struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
948{ 949{
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 35ddc3ed119d..787844bde384 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -1047,6 +1047,7 @@ smb2_create_lease_buf(u8 *lease_key, u8 oplock)
1047 buf->ccontext.NameOffset = cpu_to_le16(offsetof 1047 buf->ccontext.NameOffset = cpu_to_le16(offsetof
1048 (struct create_lease, Name)); 1048 (struct create_lease, Name));
1049 buf->ccontext.NameLength = cpu_to_le16(4); 1049 buf->ccontext.NameLength = cpu_to_le16(4);
1050 /* SMB2_CREATE_REQUEST_LEASE is "RqLs" */
1050 buf->Name[0] = 'R'; 1051 buf->Name[0] = 'R';
1051 buf->Name[1] = 'q'; 1052 buf->Name[1] = 'q';
1052 buf->Name[2] = 'L'; 1053 buf->Name[2] = 'L';
@@ -1073,6 +1074,7 @@ smb3_create_lease_buf(u8 *lease_key, u8 oplock)
1073 buf->ccontext.NameOffset = cpu_to_le16(offsetof 1074 buf->ccontext.NameOffset = cpu_to_le16(offsetof
1074 (struct create_lease_v2, Name)); 1075 (struct create_lease_v2, Name));
1075 buf->ccontext.NameLength = cpu_to_le16(4); 1076 buf->ccontext.NameLength = cpu_to_le16(4);
1077 /* SMB2_CREATE_REQUEST_LEASE is "RqLs" */
1076 buf->Name[0] = 'R'; 1078 buf->Name[0] = 'R';
1077 buf->Name[1] = 'q'; 1079 buf->Name[1] = 'q';
1078 buf->Name[2] = 'L'; 1080 buf->Name[2] = 'L';
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 3802f8c94acc..b0b260dbb19d 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -375,7 +375,12 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
375 375
376 req->Capabilities = cpu_to_le32(ses->server->vals->req_capabilities); 376 req->Capabilities = cpu_to_le32(ses->server->vals->req_capabilities);
377 377
378 memcpy(req->ClientGUID, cifs_client_guid, SMB2_CLIENT_GUID_SIZE); 378 /* ClientGUID must be zero for SMB2.02 dialect */
379 if (ses->server->vals->protocol_id == SMB20_PROT_ID)
380 memset(req->ClientGUID, 0, SMB2_CLIENT_GUID_SIZE);
381 else
382 memcpy(req->ClientGUID, server->client_guid,
383 SMB2_CLIENT_GUID_SIZE);
379 384
380 iov[0].iov_base = (char *)req; 385 iov[0].iov_base = (char *)req;
381 /* 4 for rfc1002 length field */ 386 /* 4 for rfc1002 length field */
@@ -478,7 +483,8 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
478 483
479 vneg_inbuf.Capabilities = 484 vneg_inbuf.Capabilities =
480 cpu_to_le32(tcon->ses->server->vals->req_capabilities); 485 cpu_to_le32(tcon->ses->server->vals->req_capabilities);
481 memcpy(vneg_inbuf.Guid, cifs_client_guid, SMB2_CLIENT_GUID_SIZE); 486 memcpy(vneg_inbuf.Guid, tcon->ses->server->client_guid,
487 SMB2_CLIENT_GUID_SIZE);
482 488
483 if (tcon->ses->sign) 489 if (tcon->ses->sign)
484 vneg_inbuf.SecurityMode = 490 vneg_inbuf.SecurityMode =
@@ -966,6 +972,7 @@ create_durable_buf(void)
966 buf->ccontext.NameOffset = cpu_to_le16(offsetof 972 buf->ccontext.NameOffset = cpu_to_le16(offsetof
967 (struct create_durable, Name)); 973 (struct create_durable, Name));
968 buf->ccontext.NameLength = cpu_to_le16(4); 974 buf->ccontext.NameLength = cpu_to_le16(4);
975 /* SMB2_CREATE_DURABLE_HANDLE_REQUEST is "DHnQ" */
969 buf->Name[0] = 'D'; 976 buf->Name[0] = 'D';
970 buf->Name[1] = 'H'; 977 buf->Name[1] = 'H';
971 buf->Name[2] = 'n'; 978 buf->Name[2] = 'n';
@@ -990,6 +997,7 @@ create_reconnect_durable_buf(struct cifs_fid *fid)
990 buf->ccontext.NameLength = cpu_to_le16(4); 997 buf->ccontext.NameLength = cpu_to_le16(4);
991 buf->Data.Fid.PersistentFileId = fid->persistent_fid; 998 buf->Data.Fid.PersistentFileId = fid->persistent_fid;
992 buf->Data.Fid.VolatileFileId = fid->volatile_fid; 999 buf->Data.Fid.VolatileFileId = fid->volatile_fid;
1000 /* SMB2_CREATE_DURABLE_HANDLE_RECONNECT is "DHnC" */
993 buf->Name[0] = 'D'; 1001 buf->Name[0] = 'D';
994 buf->Name[1] = 'H'; 1002 buf->Name[1] = 'H';
995 buf->Name[2] = 'n'; 1003 buf->Name[2] = 'n';
@@ -1089,6 +1097,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
1089 int rc = 0; 1097 int rc = 0;
1090 unsigned int num_iovecs = 2; 1098 unsigned int num_iovecs = 2;
1091 __u32 file_attributes = 0; 1099 __u32 file_attributes = 0;
1100 char *dhc_buf = NULL, *lc_buf = NULL;
1092 1101
1093 cifs_dbg(FYI, "create/open\n"); 1102 cifs_dbg(FYI, "create/open\n");
1094 1103
@@ -1155,6 +1164,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
1155 kfree(copy_path); 1164 kfree(copy_path);
1156 return rc; 1165 return rc;
1157 } 1166 }
1167 lc_buf = iov[num_iovecs-1].iov_base;
1158 } 1168 }
1159 1169
1160 if (*oplock == SMB2_OPLOCK_LEVEL_BATCH) { 1170 if (*oplock == SMB2_OPLOCK_LEVEL_BATCH) {
@@ -1169,9 +1179,10 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
1169 if (rc) { 1179 if (rc) {
1170 cifs_small_buf_release(req); 1180 cifs_small_buf_release(req);
1171 kfree(copy_path); 1181 kfree(copy_path);
1172 kfree(iov[num_iovecs-1].iov_base); 1182 kfree(lc_buf);
1173 return rc; 1183 return rc;
1174 } 1184 }
1185 dhc_buf = iov[num_iovecs-1].iov_base;
1175 } 1186 }
1176 1187
1177 rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buftype, 0); 1188 rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buftype, 0);
@@ -1203,6 +1214,8 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
1203 *oplock = rsp->OplockLevel; 1214 *oplock = rsp->OplockLevel;
1204creat_exit: 1215creat_exit:
1205 kfree(copy_path); 1216 kfree(copy_path);
1217 kfree(lc_buf);
1218 kfree(dhc_buf);
1206 free_rsp_buf(resp_buftype, rsp); 1219 free_rsp_buf(resp_buftype, rsp);
1207 return rc; 1220 return rc;
1208} 1221}
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
index 2022c542ea3a..69f3595d3952 100644
--- a/fs/cifs/smb2pdu.h
+++ b/fs/cifs/smb2pdu.h
@@ -183,8 +183,6 @@ struct smb2_symlink_err_rsp {
183 183
184#define SMB2_CLIENT_GUID_SIZE 16 184#define SMB2_CLIENT_GUID_SIZE 16
185 185
186extern __u8 cifs_client_guid[SMB2_CLIENT_GUID_SIZE];
187
188struct smb2_negotiate_req { 186struct smb2_negotiate_req {
189 struct smb2_hdr hdr; 187 struct smb2_hdr hdr;
190 __le16 StructureSize; /* Must be 36 */ 188 __le16 StructureSize; /* Must be 36 */
@@ -437,11 +435,15 @@ struct smb2_tree_disconnect_rsp {
437#define SMB2_CREATE_SD_BUFFER "SecD" /* security descriptor */ 435#define SMB2_CREATE_SD_BUFFER "SecD" /* security descriptor */
438#define SMB2_CREATE_DURABLE_HANDLE_REQUEST "DHnQ" 436#define SMB2_CREATE_DURABLE_HANDLE_REQUEST "DHnQ"
439#define SMB2_CREATE_DURABLE_HANDLE_RECONNECT "DHnC" 437#define SMB2_CREATE_DURABLE_HANDLE_RECONNECT "DHnC"
440#define SMB2_CREATE_ALLOCATION_SIZE "AlSi" 438#define SMB2_CREATE_ALLOCATION_SIZE "AISi"
441#define SMB2_CREATE_QUERY_MAXIMAL_ACCESS_REQUEST "MxAc" 439#define SMB2_CREATE_QUERY_MAXIMAL_ACCESS_REQUEST "MxAc"
442#define SMB2_CREATE_TIMEWARP_REQUEST "TWrp" 440#define SMB2_CREATE_TIMEWARP_REQUEST "TWrp"
443#define SMB2_CREATE_QUERY_ON_DISK_ID "QFid" 441#define SMB2_CREATE_QUERY_ON_DISK_ID "QFid"
444#define SMB2_CREATE_REQUEST_LEASE "RqLs" 442#define SMB2_CREATE_REQUEST_LEASE "RqLs"
443#define SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2 "DH2Q"
444#define SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 "DH2C"
445#define SMB2_CREATE_APP_INSTANCE_ID 0x45BCA66AEFA7F74A9008FA462E144D74
446#define SVHDX_OPEN_DEVICE_CONTEXT 0x83CE6F1AD851E0986E34401CC9BCFCE9
445 447
446struct smb2_create_req { 448struct smb2_create_req {
447 struct smb2_hdr hdr; 449 struct smb2_hdr hdr;