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