Commit c18a6659 authored by Pavel Shilovsky's avatar Pavel Shilovsky

Update 3.2 sources from stable (v3.2.81)

parent d77f569f
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#ifndef _H_CIFS_DEBUG #ifndef _H_CIFS_DEBUG
#define _H_CIFS_DEBUG #define _H_CIFS_DEBUG
#include <linux/ratelimit.h>
void cifs_dump_mem(char *label, void *data, int length); void cifs_dump_mem(char *label, void *data, int length);
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
#define DBG2 2 #define DBG2 2
...@@ -48,7 +50,7 @@ extern int cifsFYI; ...@@ -48,7 +50,7 @@ extern int cifsFYI;
#define cifsfyi(fmt, arg...) \ #define cifsfyi(fmt, arg...) \
do { \ do { \
if (cifsFYI & CIFS_INFO) \ if (cifsFYI & CIFS_INFO) \
printk(KERN_DEBUG "%s: " fmt "\n", __FILE__, ##arg); \ pr_debug_ratelimited("%s: " fmt "\n", __FILE__, ##arg); \
} while (0) } while (0)
#define cFYI(set, fmt, arg...) \ #define cFYI(set, fmt, arg...) \
...@@ -58,7 +60,7 @@ do { \ ...@@ -58,7 +60,7 @@ do { \
} while (0) } while (0)
#define cifswarn(fmt, arg...) \ #define cifswarn(fmt, arg...) \
printk(KERN_WARNING fmt "\n", ##arg) pr_warn_ratelimited(fmt "\n", ##arg)
/* debug event message: */ /* debug event message: */
extern int cifsERROR; extern int cifsERROR;
...@@ -73,7 +75,7 @@ do { \ ...@@ -73,7 +75,7 @@ do { \
#define cifserror(fmt, arg...) \ #define cifserror(fmt, arg...) \
do { \ do { \
if (cifsERROR) \ if (cifsERROR) \
printk(KERN_ERR "CIFS VFS: " fmt "\n", ##arg); \ pr_err_ratelimited("CIFS VFS: " fmt "\n", ##arg); \
} while (0) } while (0)
#define cERROR(set, fmt, arg...) \ #define cERROR(set, fmt, arg...) \
......
...@@ -616,7 +616,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp) ...@@ -616,7 +616,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
ses->auth_key.response = kmalloc(baselen + tilen, GFP_KERNEL); ses->auth_key.response = kmalloc(baselen + tilen, GFP_KERNEL);
if (!ses->auth_key.response) { if (!ses->auth_key.response) {
rc = ENOMEM; rc = -ENOMEM;
ses->auth_key.len = 0; ses->auth_key.len = 0;
cERROR(1, "%s: Can't allocate auth blob", __func__); cERROR(1, "%s: Can't allocate auth blob", __func__);
goto setup_ntlmv2_rsp_ret; goto setup_ntlmv2_rsp_ret;
......
...@@ -134,7 +134,6 @@ cifs_reconnect(struct TCP_Server_Info *server) ...@@ -134,7 +134,6 @@ cifs_reconnect(struct TCP_Server_Info *server)
server->session_key.response = NULL; server->session_key.response = NULL;
server->session_key.len = 0; server->session_key.len = 0;
server->lstrp = jiffies; server->lstrp = jiffies;
mutex_unlock(&server->srv_mutex);
/* mark submitted MIDs for retry and issue callback */ /* mark submitted MIDs for retry and issue callback */
INIT_LIST_HEAD(&retry_list); INIT_LIST_HEAD(&retry_list);
...@@ -147,6 +146,7 @@ cifs_reconnect(struct TCP_Server_Info *server) ...@@ -147,6 +146,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
list_move(&mid_entry->qhead, &retry_list); list_move(&mid_entry->qhead, &retry_list);
} }
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
mutex_unlock(&server->srv_mutex);
cFYI(1, "%s: issuing mid callbacks", __func__); cFYI(1, "%s: issuing mid callbacks", __func__);
list_for_each_safe(tmp, tmp2, &retry_list) { list_for_each_safe(tmp, tmp2, &retry_list) {
......
...@@ -823,6 +823,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) ...@@ -823,6 +823,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
} }
/* if buggy server returns . and .. late do /* if buggy server returns . and .. late do
we want to check for that here? */ we want to check for that here? */
*tmp_buf = 0;
rc = cifs_filldir(current_entry, file, rc = cifs_filldir(current_entry, file,
filldir, direntry, tmp_buf, max_len); filldir, direntry, tmp_buf, max_len);
if (rc == -EOVERFLOW) { if (rc == -EOVERFLOW) {
......
...@@ -370,10 +370,8 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, ...@@ -370,10 +370,8 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
rc = cifs_sign_smb2(iov, nvec, server, &mid->sequence_number); rc = cifs_sign_smb2(iov, nvec, server, &mid->sequence_number);
if (rc) { if (rc)
mutex_unlock(&server->srv_mutex); goto out;
goto out_err;
}
mid->receive = receive; mid->receive = receive;
mid->callback = callback; mid->callback = callback;
...@@ -384,14 +382,15 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, ...@@ -384,14 +382,15 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
rc = smb_sendv(server, iov, nvec); rc = smb_sendv(server, iov, nvec);
cifs_in_send_dec(server); cifs_in_send_dec(server);
cifs_save_when_sent(mid); cifs_save_when_sent(mid);
out:
if (rc < 0)
delete_mid(mid);
mutex_unlock(&server->srv_mutex); mutex_unlock(&server->srv_mutex);
if (rc) if (rc == 0)
goto out_err; return 0;
return rc;
out_err:
delete_mid(mid);
atomic_dec(&server->inFlight); atomic_dec(&server->inFlight);
wake_up(&server->request_q); wake_up(&server->request_q);
return rc; return rc;
......
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