Commit d9773cea authored by Linus Torvalds's avatar Linus Torvalds

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)
parents 33d31d34 364d4293
...@@ -136,5 +136,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); ...@@ -136,5 +136,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
extern const struct export_operations cifs_export_ops; extern const struct export_operations cifs_export_ops;
#endif /* CONFIG_CIFS_NFSD_EXPORT */ #endif /* CONFIG_CIFS_NFSD_EXPORT */
#define CIFS_VERSION "2.04" #define CIFS_VERSION "2.05"
#endif /* _CIFSFS_H */ #endif /* _CIFSFS_H */
...@@ -837,6 +837,7 @@ cifs_demultiplex_thread(void *p) ...@@ -837,6 +837,7 @@ cifs_demultiplex_thread(void *p)
struct TCP_Server_Info *server = p; struct TCP_Server_Info *server = p;
unsigned int pdu_length; unsigned int pdu_length;
char *buf = NULL; char *buf = NULL;
struct task_struct *task_to_wake = NULL;
struct mid_q_entry *mid_entry; struct mid_q_entry *mid_entry;
current->flags |= PF_MEMALLOC; current->flags |= PF_MEMALLOC;
...@@ -927,7 +928,19 @@ cifs_demultiplex_thread(void *p) ...@@ -927,7 +928,19 @@ cifs_demultiplex_thread(void *p)
if (server->smallbuf) /* no sense logging a debug message if NULL */ if (server->smallbuf) /* no sense logging a debug message if NULL */
cifs_small_buf_release(server->smallbuf); cifs_small_buf_release(server->smallbuf);
task_to_wake = xchg(&server->tsk, NULL);
clean_demultiplex_info(server); clean_demultiplex_info(server);
/* if server->tsk was NULL then wait for a signal before exiting */
if (!task_to_wake) {
set_current_state(TASK_INTERRUPTIBLE);
while (!signal_pending(current)) {
schedule();
set_current_state(TASK_INTERRUPTIBLE);
}
set_current_state(TASK_RUNNING);
}
module_put_and_exit(0); module_put_and_exit(0);
} }
...@@ -2050,6 +2063,8 @@ cifs_find_tcp_session(struct smb_vol *vol) ...@@ -2050,6 +2063,8 @@ cifs_find_tcp_session(struct smb_vol *vol)
static void static void
cifs_put_tcp_session(struct TCP_Server_Info *server) cifs_put_tcp_session(struct TCP_Server_Info *server)
{ {
struct task_struct *task;
spin_lock(&cifs_tcp_ses_lock); spin_lock(&cifs_tcp_ses_lock);
if (--server->srv_count > 0) { if (--server->srv_count > 0) {
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
...@@ -2073,6 +2088,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server) ...@@ -2073,6 +2088,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server)
kfree(server->session_key.response); kfree(server->session_key.response);
server->session_key.response = NULL; server->session_key.response = NULL;
server->session_key.len = 0; server->session_key.len = 0;
task = xchg(&server->tsk, NULL);
if (task)
force_sig(SIGKILL, task);
} }
static struct TCP_Server_Info * static struct TCP_Server_Info *
......
...@@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct cifs_tcon *tcon,
if (rc) if (rc)
goto out; goto out;
rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb, if (tcon->ses->server->ops->create_mf_symlink)
fromName, buf, &bytes_written); rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon,
cifs_sb, fromName, buf, &bytes_written);
else
rc = -EOPNOTSUPP;
if (rc) if (rc)
goto out; goto out;
...@@ -339,9 +343,11 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon, ...@@ -339,9 +343,11 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
if (rc) if (rc)
return rc; return rc;
if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) {
rc = -ENOENT;
/* it's not a symlink */ /* it's not a symlink */
goto out; goto out;
}
io_parms.netfid = fid.netfid; io_parms.netfid = fid.netfid;
io_parms.pid = current->tgid; io_parms.pid = current->tgid;
......
...@@ -925,11 +925,23 @@ cifs_NTtimeToUnix(__le64 ntutc) ...@@ -925,11 +925,23 @@ cifs_NTtimeToUnix(__le64 ntutc)
/* BB what about the timezone? BB */ /* BB what about the timezone? BB */
/* Subtract the NTFS time offset, then convert to 1s intervals. */ /* Subtract the NTFS time offset, then convert to 1s intervals. */
u64 t; s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET;
t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET; /*
ts.tv_nsec = do_div(t, 10000000) * 100; * Unfortunately can not use normal 64 bit division on 32 bit arch, but
* the alternative, do_div, does not work with negative numbers so have
* to special case them
*/
if (t < 0) {
t = -t;
ts.tv_nsec = (long)(do_div(t, 10000000) * 100);
ts.tv_nsec = -ts.tv_nsec;
ts.tv_sec = -t;
} else {
ts.tv_nsec = (long)do_div(t, 10000000) * 100;
ts.tv_sec = t; ts.tv_sec = t;
}
return ts; return ts;
} }
......
...@@ -745,14 +745,6 @@ sess_auth_lanman(struct sess_data *sess_data) ...@@ -745,14 +745,6 @@ sess_auth_lanman(struct sess_data *sess_data)
sess_free_buffer(sess_data); sess_free_buffer(sess_data);
} }
#else
static void
sess_auth_lanman(struct sess_data *sess_data)
{
sess_data->result = -EOPNOTSUPP;
sess_data->func = NULL;
}
#endif #endif
static void static void
...@@ -1103,15 +1095,6 @@ sess_auth_kerberos(struct sess_data *sess_data) ...@@ -1103,15 +1095,6 @@ sess_auth_kerberos(struct sess_data *sess_data)
ses->auth_key.response = NULL; ses->auth_key.response = NULL;
} }
#else
static void
sess_auth_kerberos(struct sess_data *sess_data)
{
cifs_dbg(VFS, "Kerberos negotiated but upcall support disabled!\n");
sess_data->result = -ENOSYS;
sess_data->func = NULL;
}
#endif /* ! CONFIG_CIFS_UPCALL */ #endif /* ! CONFIG_CIFS_UPCALL */
/* /*
......
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