Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag '5.5-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull cfis fixes from Steve French:
"Three small smb3 fixes: this addresses two recent issues reported in
additional testing during rc1, a refcount underflow and a problem with
an intermittent crash in SMB2_open_init"

* tag '5.5-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
CIFS: Close cached root handle only if it has a lease
SMB3: Fix crash in SMB2_open_init due to uninitialized field in compounding path
smb3: fix refcount underflow warning on unmount when no directory leases

+26 -3
+1 -1
fs/cifs/cifsglob.h
··· 1061 1061 struct cached_fid { 1062 1062 bool is_valid:1; /* Do we have a useable root fid */ 1063 1063 bool file_all_info_is_valid:1; 1064 - 1064 + bool has_lease:1; 1065 1065 struct kref refcount; 1066 1066 struct cifs_fid *fid; 1067 1067 struct mutex fid_mutex;
+3
fs/cifs/cifssmb.c
··· 42 42 #include "cifsproto.h" 43 43 #include "cifs_unicode.h" 44 44 #include "cifs_debug.h" 45 + #include "smb2proto.h" 45 46 #include "fscache.h" 46 47 #include "smbdirect.h" 47 48 #ifdef CONFIG_CIFS_DFS_UPCALL ··· 113 112 114 113 mutex_lock(&tcon->crfid.fid_mutex); 115 114 tcon->crfid.is_valid = false; 115 + /* cached handle is not valid, so SMB2_CLOSE won't be sent below */ 116 + close_shroot_lease_locked(&tcon->crfid); 116 117 memset(tcon->crfid.fid, 0, sizeof(struct cifs_fid)); 117 118 mutex_unlock(&tcon->crfid.fid_mutex); 118 119
+1
fs/cifs/smb2inode.c
··· 95 95 goto finished; 96 96 } 97 97 98 + memset(&oparms, 0, sizeof(struct cifs_open_parms)); 98 99 oparms.tcon = tcon; 99 100 oparms.desired_access = desired_access; 100 101 oparms.disposition = create_disposition;
+18 -1
fs/cifs/smb2ops.c
··· 616 616 cfid->fid->volatile_fid); 617 617 cfid->is_valid = false; 618 618 cfid->file_all_info_is_valid = false; 619 + cfid->has_lease = false; 619 620 } 620 621 } 621 622 ··· 627 626 mutex_unlock(&cfid->fid_mutex); 628 627 } 629 628 629 + void close_shroot_lease_locked(struct cached_fid *cfid) 630 + { 631 + if (cfid->has_lease) { 632 + cfid->has_lease = false; 633 + kref_put(&cfid->refcount, smb2_close_cached_fid); 634 + } 635 + } 636 + 637 + void close_shroot_lease(struct cached_fid *cfid) 638 + { 639 + mutex_lock(&cfid->fid_mutex); 640 + close_shroot_lease_locked(cfid); 641 + mutex_unlock(&cfid->fid_mutex); 642 + } 643 + 630 644 void 631 645 smb2_cached_lease_break(struct work_struct *work) 632 646 { 633 647 struct cached_fid *cfid = container_of(work, 634 648 struct cached_fid, lease_break); 635 649 636 - close_shroot(cfid); 650 + close_shroot_lease(cfid); 637 651 } 638 652 639 653 /* ··· 789 773 /* BB TBD check to see if oplock level check can be removed below */ 790 774 if (o_rsp->OplockLevel == SMB2_OPLOCK_LEVEL_LEASE) { 791 775 kref_get(&tcon->crfid.refcount); 776 + tcon->crfid.has_lease = true; 792 777 smb2_parse_contexts(server, o_rsp, 793 778 &oparms.fid->epoch, 794 779 oparms.fid->lease_key, &oplock, NULL);
+1 -1
fs/cifs/smb2pdu.c
··· 1847 1847 if ((tcon->need_reconnect) || (tcon->ses->need_reconnect)) 1848 1848 return 0; 1849 1849 1850 - close_shroot(&tcon->crfid); 1850 + close_shroot_lease(&tcon->crfid); 1851 1851 1852 1852 rc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, (void **) &req, 1853 1853 &total_len);
+2
fs/cifs/smb2proto.h
··· 70 70 extern int open_shroot(unsigned int xid, struct cifs_tcon *tcon, 71 71 struct cifs_fid *pfid); 72 72 extern void close_shroot(struct cached_fid *cfid); 73 + extern void close_shroot_lease(struct cached_fid *cfid); 74 + extern void close_shroot_lease_locked(struct cached_fid *cfid); 73 75 extern void move_smb2_info_to_cifs(FILE_ALL_INFO *dst, 74 76 struct smb2_file_all_info *src); 75 77 extern int smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,