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.11-rc6-smb3' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Steve French:
"Three small smb3 fixes for stable"

* tag '5.11-rc6-smb3' of git://git.samba.org/sfrench/cifs-2.6:
cifs: report error instead of invalid when revalidating a dentry fails
smb3: fix crediting for compounding when only one request in flight
smb3: Fix out-of-bounds bug in SMB2_negotiate()

+36 -6
+20 -2
fs/cifs/dir.c
··· 737 737 cifs_d_revalidate(struct dentry *direntry, unsigned int flags) 738 738 { 739 739 struct inode *inode; 740 + int rc; 740 741 741 742 if (flags & LOOKUP_RCU) 742 743 return -ECHILD; ··· 747 746 if ((flags & LOOKUP_REVAL) && !CIFS_CACHE_READ(CIFS_I(inode))) 748 747 CIFS_I(inode)->time = 0; /* force reval */ 749 748 750 - if (cifs_revalidate_dentry(direntry)) 751 - return 0; 749 + rc = cifs_revalidate_dentry(direntry); 750 + if (rc) { 751 + cifs_dbg(FYI, "cifs_revalidate_dentry failed with rc=%d", rc); 752 + switch (rc) { 753 + case -ENOENT: 754 + case -ESTALE: 755 + /* 756 + * Those errors mean the dentry is invalid 757 + * (file was deleted or recreated) 758 + */ 759 + return 0; 760 + default: 761 + /* 762 + * Otherwise some unexpected error happened 763 + * report it as-is to VFS layer 764 + */ 765 + return rc; 766 + } 767 + } 752 768 else { 753 769 /* 754 770 * If the inode wasn't known to be a dfs entry when
+1 -1
fs/cifs/smb2pdu.h
··· 286 286 __le32 NegotiateContextOffset; /* SMB3.1.1 only. MBZ earlier */ 287 287 __le16 NegotiateContextCount; /* SMB3.1.1 only. MBZ earlier */ 288 288 __le16 Reserved2; 289 - __le16 Dialects[1]; /* One dialect (vers=) at a time for now */ 289 + __le16 Dialects[4]; /* BB expand this if autonegotiate > 4 dialects */ 290 290 } __packed; 291 291 292 292 /* Dialects */
+15 -3
fs/cifs/transport.c
··· 666 666 667 667 if (*credits < num) { 668 668 /* 669 - * Return immediately if not too many requests in flight since 670 - * we will likely be stuck on waiting for credits. 669 + * If the server is tight on resources or just gives us less 670 + * credits for other reasons (e.g. requests are coming out of 671 + * order and the server delays granting more credits until it 672 + * processes a missing mid) and we exhausted most available 673 + * credits there may be situations when we try to send 674 + * a compound request but we don't have enough credits. At this 675 + * point the client needs to decide if it should wait for 676 + * additional credits or fail the request. If at least one 677 + * request is in flight there is a high probability that the 678 + * server will return enough credits to satisfy this compound 679 + * request. 680 + * 681 + * Return immediately if no requests in flight since we will be 682 + * stuck on waiting for credits. 671 683 */ 672 - if (server->in_flight < num - *credits) { 684 + if (server->in_flight == 0) { 673 685 spin_unlock(&server->req_lock); 674 686 trace_smb3_insufficient_credits(server->CurrentMid, 675 687 server->hostname, scredits, sin_flight);