Commit 17092699 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 189e7cc1 f7b2e8c7
...@@ -492,10 +492,14 @@ int cifs_close(struct inode *inode, struct file *file) ...@@ -492,10 +492,14 @@ int cifs_close(struct inode *inode, struct file *file)
the struct would be in each open file, the struct would be in each open file,
but this should give enough time to but this should give enough time to
clear the socket */ clear the socket */
cERROR(1,("close with pending writes")); #ifdef CONFIG_CIFS_DEBUG2
cFYI(1,("close delay, write pending"));
#endif /* DEBUG2 */
msleep(timeout); msleep(timeout);
timeout *= 4; timeout *= 4;
} }
if(atomic_read(&pSMBFile->wrtPending))
cERROR(1,("close with pending writes"));
rc = CIFSSMBClose(xid, pTcon, rc = CIFSSMBClose(xid, pTcon,
pSMBFile->netfid); pSMBFile->netfid);
} }
......
...@@ -1089,8 +1089,10 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, ...@@ -1089,8 +1089,10 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat) struct kstat *stat)
{ {
int err = cifs_revalidate(dentry); int err = cifs_revalidate(dentry);
if (!err) if (!err) {
generic_fillattr(dentry->d_inode, stat); generic_fillattr(dentry->d_inode, stat);
stat->blksize = CIFS_MAX_MSGSIZE;
}
return err; return err;
} }
......
...@@ -90,7 +90,9 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses, ...@@ -90,7 +90,9 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses,
} */ } */
/* copy user */ /* copy user */
if(ses->userName == NULL) { if(ses->userName == NULL) {
/* BB what about null user mounts - check that we do this BB */ /* null user mount */
*bcc_ptr = 0;
*(bcc_ptr+1) = 0;
} else { /* 300 should be long enough for any conceivable user name */ } else { /* 300 should be long enough for any conceivable user name */
bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->userName, bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->userName,
300, nls_cp); 300, nls_cp);
...@@ -98,10 +100,13 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses, ...@@ -98,10 +100,13 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses,
bcc_ptr += 2 * bytes_ret; bcc_ptr += 2 * bytes_ret;
bcc_ptr += 2; /* account for null termination */ bcc_ptr += 2; /* account for null termination */
/* copy domain */ /* copy domain */
if(ses->domainName == NULL) if(ses->domainName == NULL) {
bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, /* Sending null domain better than using a bogus domain name (as
"CIFS_LINUX_DOM", 32, nls_cp); we did briefly in 2.6.18) since server will use its default */
else *bcc_ptr = 0;
*(bcc_ptr+1) = 0;
bytes_ret = 0;
} else
bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->domainName, bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->domainName,
256, nls_cp); 256, nls_cp);
bcc_ptr += 2 * bytes_ret; bcc_ptr += 2 * bytes_ret;
...@@ -144,13 +149,11 @@ static void ascii_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses, ...@@ -144,13 +149,11 @@ static void ascii_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses,
/* copy domain */ /* copy domain */
if(ses->domainName == NULL) { if(ses->domainName != NULL) {
strcpy(bcc_ptr, "CIFS_LINUX_DOM");
bcc_ptr += 14; /* strlen(CIFS_LINUX_DOM) */
} else {
strncpy(bcc_ptr, ses->domainName, 256); strncpy(bcc_ptr, ses->domainName, 256);
bcc_ptr += strnlen(ses->domainName, 256); bcc_ptr += strnlen(ses->domainName, 256);
} } /* else we will send a null domain name
so the server will default to its own domain */
*bcc_ptr = 0; *bcc_ptr = 0;
bcc_ptr++; bcc_ptr++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment