Merge master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[CIFS] Fix minor problem with previous patch
[CIFS] Fix mount failure when domain not specified
[CIFS] Explicitly set stat->blksize
[CIFS] NFS stress test generates flood of "close with pending write" messages

+22 -13
+6 -2
fs/cifs/file.c
··· 492 the struct would be in each open file, 493 but this should give enough time to 494 clear the socket */ 495 - cERROR(1,("close with pending writes")); 496 msleep(timeout); 497 timeout *= 4; 498 - } 499 rc = CIFSSMBClose(xid, pTcon, 500 pSMBFile->netfid); 501 }
··· 492 the struct would be in each open file, 493 but this should give enough time to 494 clear the socket */ 495 + #ifdef CONFIG_CIFS_DEBUG2 496 + cFYI(1,("close delay, write pending")); 497 + #endif /* DEBUG2 */ 498 msleep(timeout); 499 timeout *= 4; 500 + } 501 + if(atomic_read(&pSMBFile->wrtPending)) 502 + cERROR(1,("close with pending writes")); 503 rc = CIFSSMBClose(xid, pTcon, 504 pSMBFile->netfid); 505 }
+3 -1
fs/cifs/inode.c
··· 1089 struct kstat *stat) 1090 { 1091 int err = cifs_revalidate(dentry); 1092 - if (!err) 1093 generic_fillattr(dentry->d_inode, stat); 1094 return err; 1095 } 1096
··· 1089 struct kstat *stat) 1090 { 1091 int err = cifs_revalidate(dentry); 1092 + if (!err) { 1093 generic_fillattr(dentry->d_inode, stat); 1094 + stat->blksize = CIFS_MAX_MSGSIZE; 1095 + } 1096 return err; 1097 } 1098
+13 -10
fs/cifs/sess.c
··· 90 } */ 91 /* copy user */ 92 if(ses->userName == NULL) { 93 - /* BB what about null user mounts - check that we do this BB */ 94 } else { /* 300 should be long enough for any conceivable user name */ 95 bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->userName, 96 300, nls_cp); ··· 100 bcc_ptr += 2 * bytes_ret; 101 bcc_ptr += 2; /* account for null termination */ 102 /* copy domain */ 103 - if(ses->domainName == NULL) 104 - bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, 105 - "CIFS_LINUX_DOM", 32, nls_cp); 106 - else 107 bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->domainName, 108 256, nls_cp); 109 bcc_ptr += 2 * bytes_ret; ··· 149 150 /* copy domain */ 151 152 - if(ses->domainName == NULL) { 153 - strcpy(bcc_ptr, "CIFS_LINUX_DOM"); 154 - bcc_ptr += 14; /* strlen(CIFS_LINUX_DOM) */ 155 - } else { 156 strncpy(bcc_ptr, ses->domainName, 256); 157 bcc_ptr += strnlen(ses->domainName, 256); 158 - } 159 *bcc_ptr = 0; 160 bcc_ptr++; 161
··· 90 } */ 91 /* copy user */ 92 if(ses->userName == NULL) { 93 + /* null user mount */ 94 + *bcc_ptr = 0; 95 + *(bcc_ptr+1) = 0; 96 } else { /* 300 should be long enough for any conceivable user name */ 97 bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->userName, 98 300, nls_cp); ··· 98 bcc_ptr += 2 * bytes_ret; 99 bcc_ptr += 2; /* account for null termination */ 100 /* copy domain */ 101 + if(ses->domainName == NULL) { 102 + /* Sending null domain better than using a bogus domain name (as 103 + we did briefly in 2.6.18) since server will use its default */ 104 + *bcc_ptr = 0; 105 + *(bcc_ptr+1) = 0; 106 + bytes_ret = 0; 107 + } else 108 bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->domainName, 109 256, nls_cp); 110 bcc_ptr += 2 * bytes_ret; ··· 144 145 /* copy domain */ 146 147 + if(ses->domainName != NULL) { 148 strncpy(bcc_ptr, ses->domainName, 256); 149 bcc_ptr += strnlen(ses->domainName, 256); 150 + } /* else we will send a null domain name 151 + so the server will default to its own domain */ 152 *bcc_ptr = 0; 153 bcc_ptr++; 154