aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-09-18 14:10:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-09-18 14:10:35 -0400
commitd9773ceabfaf3f27b8a36fac035b74ee599df900 (patch)
tree259e6f633bd287b95b39491ac9759a6e5561d55d
parent33d31d34769a67609d12753af7e57743b934ca8e (diff)
parent364d42930d96a872b2076deeb9c24f9ff132de34 (diff)
Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs/smb3 fixes from Steve French: "Fixes for problems found during testing and debugging at the SMB3 storage test event (plugfest) this week" * 'for-linus' of git://git.samba.org/sfrench/cifs-2.6: Fix mfsymlinks file size check Update version number displayed by modinfo for cifs.ko cifs: remove dead code Revert "cifs: No need to send SIGKILL to demux_thread during umount" [SMB3] Fix oops when creating symlinks on smb3 [CIFS] Fix setting time before epoch (negative time values)
-rw-r--r--fs/cifs/cifsfs.h2
-rw-r--r--fs/cifs/connect.c19
-rw-r--r--fs/cifs/link.c12
-rw-r--r--fs/cifs/netmisc.c20
-rw-r--r--fs/cifs/sess.c17
5 files changed, 45 insertions, 25 deletions
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index b0fafa499505..002e0c173939 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -136,5 +136,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
136extern const struct export_operations cifs_export_ops; 136extern const struct export_operations cifs_export_ops;
137#endif /* CONFIG_CIFS_NFSD_EXPORT */ 137#endif /* CONFIG_CIFS_NFSD_EXPORT */
138 138
139#define CIFS_VERSION "2.04" 139#define CIFS_VERSION "2.05"
140#endif /* _CIFSFS_H */ 140#endif /* _CIFSFS_H */
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 8a9fded7c135..36ca2045009b 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -837,6 +837,7 @@ cifs_demultiplex_thread(void *p)
837 struct TCP_Server_Info *server = p; 837 struct TCP_Server_Info *server = p;
838 unsigned int pdu_length; 838 unsigned int pdu_length;
839 char *buf = NULL; 839 char *buf = NULL;
840 struct task_struct *task_to_wake = NULL;
840 struct mid_q_entry *mid_entry; 841 struct mid_q_entry *mid_entry;
841 842
842 current->flags |= PF_MEMALLOC; 843 current->flags |= PF_MEMALLOC;
@@ -927,7 +928,19 @@ cifs_demultiplex_thread(void *p)
927 if (server->smallbuf) /* no sense logging a debug message if NULL */ 928 if (server->smallbuf) /* no sense logging a debug message if NULL */
928 cifs_small_buf_release(server->smallbuf); 929 cifs_small_buf_release(server->smallbuf);
929 930
931 task_to_wake = xchg(&server->tsk, NULL);
930 clean_demultiplex_info(server); 932 clean_demultiplex_info(server);
933
934 /* if server->tsk was NULL then wait for a signal before exiting */
935 if (!task_to_wake) {
936 set_current_state(TASK_INTERRUPTIBLE);
937 while (!signal_pending(current)) {
938 schedule();
939 set_current_state(TASK_INTERRUPTIBLE);
940 }
941 set_current_state(TASK_RUNNING);
942 }
943
931 module_put_and_exit(0); 944 module_put_and_exit(0);
932} 945}
933 946
@@ -2050,6 +2063,8 @@ cifs_find_tcp_session(struct smb_vol *vol)
2050static void 2063static void
2051cifs_put_tcp_session(struct TCP_Server_Info *server) 2064cifs_put_tcp_session(struct TCP_Server_Info *server)
2052{ 2065{
2066 struct task_struct *task;
2067
2053 spin_lock(&cifs_tcp_ses_lock); 2068 spin_lock(&cifs_tcp_ses_lock);
2054 if (--server->srv_count > 0) { 2069 if (--server->srv_count > 0) {
2055 spin_unlock(&cifs_tcp_ses_lock); 2070 spin_unlock(&cifs_tcp_ses_lock);
@@ -2073,6 +2088,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server)
2073 kfree(server->session_key.response); 2088 kfree(server->session_key.response);
2074 server->session_key.response = NULL; 2089 server->session_key.response = NULL;
2075 server->session_key.len = 0; 2090 server->session_key.len = 0;
2091
2092 task = xchg(&server->tsk, NULL);
2093 if (task)
2094 force_sig(SIGKILL, task);
2076} 2095}
2077 2096
2078static struct TCP_Server_Info * 2097static struct TCP_Server_Info *
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 68559fd557fb..5657416d3483 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct cifs_tcon *tcon,
213 if (rc) 213 if (rc)
214 goto out; 214 goto out;
215 215
216 rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb, 216 if (tcon->ses->server->ops->create_mf_symlink)
217 fromName, buf, &bytes_written); 217 rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon,
218 cifs_sb, fromName, buf, &bytes_written);
219 else
220 rc = -EOPNOTSUPP;
221
218 if (rc) 222 if (rc)
219 goto out; 223 goto out;
220 224
@@ -339,9 +343,11 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
339 if (rc) 343 if (rc)
340 return rc; 344 return rc;
341 345
342 if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) 346 if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) {
347 rc = -ENOENT;
343 /* it's not a symlink */ 348 /* it's not a symlink */
344 goto out; 349 goto out;
350 }
345 351
346 io_parms.netfid = fid.netfid; 352 io_parms.netfid = fid.netfid;
347 io_parms.pid = current->tgid; 353 io_parms.pid = current->tgid;
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index 6834b9c3bec1..b333ff60781d 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -925,11 +925,23 @@ cifs_NTtimeToUnix(__le64 ntutc)
925 /* BB what about the timezone? BB */ 925 /* BB what about the timezone? BB */
926 926
927 /* Subtract the NTFS time offset, then convert to 1s intervals. */ 927 /* Subtract the NTFS time offset, then convert to 1s intervals. */
928 u64 t; 928 s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET;
929
930 /*
931 * Unfortunately can not use normal 64 bit division on 32 bit arch, but
932 * the alternative, do_div, does not work with negative numbers so have
933 * to special case them
934 */
935 if (t < 0) {
936 t = -t;
937 ts.tv_nsec = (long)(do_div(t, 10000000) * 100);
938 ts.tv_nsec = -ts.tv_nsec;
939 ts.tv_sec = -t;
940 } else {
941 ts.tv_nsec = (long)do_div(t, 10000000) * 100;
942 ts.tv_sec = t;
943 }
929 944
930 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET;
931 ts.tv_nsec = do_div(t, 10000000) * 100;
932 ts.tv_sec = t;
933 return ts; 945 return ts;
934} 946}
935 947
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 3a5e83317683..57db63ff88da 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -745,14 +745,6 @@ out:
745 sess_free_buffer(sess_data); 745 sess_free_buffer(sess_data);
746} 746}
747 747
748#else
749
750static void
751sess_auth_lanman(struct sess_data *sess_data)
752{
753 sess_data->result = -EOPNOTSUPP;
754 sess_data->func = NULL;
755}
756#endif 748#endif
757 749
758static void 750static void
@@ -1103,15 +1095,6 @@ out:
1103 ses->auth_key.response = NULL; 1095 ses->auth_key.response = NULL;
1104} 1096}
1105 1097
1106#else
1107
1108static void
1109sess_auth_kerberos(struct sess_data *sess_data)
1110{
1111 cifs_dbg(VFS, "Kerberos negotiated but upcall support disabled!\n");
1112 sess_data->result = -ENOSYS;
1113 sess_data->func = NULL;
1114}
1115#endif /* ! CONFIG_CIFS_UPCALL */ 1098#endif /* ! CONFIG_CIFS_UPCALL */
1116 1099
1117/* 1100/*