From 4891d53956abd4ad9d94127c50d931124319a324 Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 7 Nov 2006 16:31:16 +0000 Subject: [CIFS] NFS stress test generates flood of "close with pending write" messages Informational/debug message was being logged too often. The error case of logging having to send a close with (presumably stuck on buggy server) pending writes is still logged. Signed-off-by: Steve French --- fs/cifs/file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'fs') diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 7e056b9b49e8..4b07a8cc4633 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -492,10 +492,13 @@ int cifs_close(struct inode *inode, struct file *file) the struct would be in each open file, but this should give enough time to clear the socket */ - cERROR(1,("close with pending writes")); +#ifdef CONFIG_CIFS_DEBUG2 + cFYI(1,("close delay, write pending")); +#endif /* DEBUG2 */ msleep(timeout); timeout *= 4; - } + } + cERROR(1,("close with pending writes")); rc = CIFSSMBClose(xid, pTcon, pSMBFile->netfid); } -- cgit v1.2.3 From 5fe14c851efedf95b0e7652a3a7b93ec899d1599 Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 7 Nov 2006 19:26:33 +0000 Subject: [CIFS] Explicitly set stat->blksize CIFS may perform I/O over the network in larger chunks than the page size, so it should explicitly set stat->blksize to ensure optimal I/O bandwidth Signed-off-by: Dave Kleikamp Signed-off-by: Steve French --- fs/cifs/inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs') 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, struct kstat *stat) { int err = cifs_revalidate(dentry); - if (!err) + if (!err) { generic_fillattr(dentry->d_inode, stat); + stat->blksize = CIFS_MAX_MSGSIZE; + } return err; } -- cgit v1.2.3 From 6e659c63998881e8f4a842edbe86ac8c5cdaee41 Mon Sep 17 00:00:00 2001 From: Steve French Date: Wed, 8 Nov 2006 23:10:46 +0000 Subject: [CIFS] Fix mount failure when domain not specified Fixes Samba bugzilla #4176 When users do not specify their domain on mount, 2.6.18 started sending default domain instead of a null domain (which was the only way on some servers to use a default domain). Users of 2.6.18 who did not specify their domain name on mounts to certain common Windows servers that were members of a domain, but not the domain controller, would get mount failures which they did not get in 2.6.18 This fixes that issue and should remove complaints about mount behavior changing. Signed-off-by: Steve French --- fs/cifs/sess.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'fs') 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, } */ /* copy user */ 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 */ bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->userName, 300, nls_cp); @@ -98,10 +100,13 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses, bcc_ptr += 2 * bytes_ret; bcc_ptr += 2; /* account for null termination */ /* copy domain */ - if(ses->domainName == NULL) - bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, - "CIFS_LINUX_DOM", 32, nls_cp); - else + if(ses->domainName == NULL) { + /* Sending null domain better than using a bogus domain name (as + we did briefly in 2.6.18) since server will use its default */ + *bcc_ptr = 0; + *(bcc_ptr+1) = 0; + bytes_ret = 0; + } else bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->domainName, 256, nls_cp); bcc_ptr += 2 * bytes_ret; @@ -144,13 +149,11 @@ static void ascii_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses, /* copy domain */ - if(ses->domainName == NULL) { - strcpy(bcc_ptr, "CIFS_LINUX_DOM"); - bcc_ptr += 14; /* strlen(CIFS_LINUX_DOM) */ - } else { + if(ses->domainName != NULL) { strncpy(bcc_ptr, 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++; -- cgit v1.2.3 From f7b2e8c76b3423a1d2501b9399261e9c9a33e100 Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 9 Nov 2006 21:25:37 +0000 Subject: [CIFS] Fix minor problem with previous patch The patch NFS stress test generates flood of "close with pending write was missing an if Signed-off-by: Steve French --- fs/cifs/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 4b07a8cc4633..2436ed8fc840 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -498,7 +498,8 @@ int cifs_close(struct inode *inode, struct file *file) msleep(timeout); timeout *= 4; } - cERROR(1,("close with pending writes")); + if(atomic_read(&pSMBFile->wrtPending)) + cERROR(1,("close with pending writes")); rc = CIFSSMBClose(xid, pTcon, pSMBFile->netfid); } -- cgit v1.2.3