Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41bc3982 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6-stable

* master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6-stable:
  [CIFS] Fix typo in previous
  [CIFS] Readdir fixes to allow search to start at arbitrary position
  [CIFS] Use the kthread_ API instead of opencoding lots of hairy code for kernel
  [CIFS] Don't allow a backslash in a path component
  [CIFS] [CIFS] Do not take rename sem on most path based calls (during
parents a580e5b9 b66ac3ea
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
Version 1.42
------------
Fix slow oplock break when mounted to different servers at the same time and
the tids match and we try to find matching fid on wrong server.
the tids match and we try to find matching fid on wrong server. Fix read
looping when signing required by server (2.6.16 kernel only). Fix readdir
vs. rename race which could cause each to hang. Return . and .. even
if server does not.  Allow searches to skip first three entries and
begin at any location. Fix oops in find_writeable_file.

Version 1.41
------------
+8 −0
Original line number Diff line number Diff line
@@ -511,6 +511,14 @@ LinuxExtensionsEnabled If set to one then the client will attempt to
			support and want to map the uid and gid fields 
			to values supplied at mount (rather than the 
			actual values, then set this to zero. (default 1)
Experimental            When set to 1 used to enable certain experimental
			features (currently enables multipage writes
			when signing is enabled, the multipage write
			performance enhancement was disabled when
			signing turned on in case buffer was modified
			just before it was sent, also this flag will
			be used to use the new experimental sessionsetup
			code).

These experimental features and tracing can be enabled by changing flags in 
/proc/fs/cifs (after the cifs module has been installed or built into the 
+50 −49
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include <linux/vfs.h>
#include <linux/mempool.h>
#include <linux/delay.h>
#include <linux/kthread.h>
#include "cifsfs.h"
#include "cifspdu.h"
#define DECLARE_GLOBALS_HERE
@@ -75,9 +76,6 @@ unsigned int cifs_max_pending = CIFS_MAX_REQ;
module_param(cifs_max_pending, int, 0);
MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256");

static DECLARE_COMPLETION(cifs_oplock_exited);
static DECLARE_COMPLETION(cifs_dnotify_exited);

extern mempool_t *cifs_sm_req_poolp;
extern mempool_t *cifs_req_poolp;
extern mempool_t *cifs_mid_poolp;
@@ -841,10 +839,6 @@ static int cifs_oplock_thread(void * dummyarg)
	__u16  netfid;
	int rc;

	daemonize("cifsoplockd");
	allow_signal(SIGTERM);

	oplockThread = current;
	do {
		if (try_to_freeze()) 
			continue;
@@ -900,9 +894,9 @@ static int cifs_oplock_thread(void * dummyarg)
			set_current_state(TASK_INTERRUPTIBLE);
			schedule_timeout(1);  /* yield in case q were corrupt */
		}
	} while(!signal_pending(current));
	oplockThread = NULL;
	complete_and_exit (&cifs_oplock_exited, 0);
	} while (!kthread_should_stop());

	return 0;
}

static int cifs_dnotify_thread(void * dummyarg)
@@ -910,10 +904,6 @@ static int cifs_dnotify_thread(void * dummyarg)
	struct list_head *tmp;
	struct cifsSesInfo *ses;

	daemonize("cifsdnotifyd");
	allow_signal(SIGTERM);

	dnotifyThread = current;
	do {
		if(try_to_freeze())
			continue;
@@ -931,8 +921,9 @@ static int cifs_dnotify_thread(void * dummyarg)
				wake_up_all(&ses->server->response_q);
		}
		read_unlock(&GlobalSMBSeslock);
	} while(!signal_pending(current));
	complete_and_exit (&cifs_dnotify_exited, 0);
	} while (!kthread_should_stop());

	return 0;
}

static int __init
@@ -982,32 +973,48 @@ init_cifs(void)
	}

	rc = cifs_init_inodecache();
	if (!rc) {
	if (rc)
		goto out_clean_proc;

	rc = cifs_init_mids();
		if (!rc) {
	if (rc)
		goto out_destroy_inodecache;

	rc = cifs_init_request_bufs();
			if (!rc) {
	if (rc)
		goto out_destroy_mids;

	rc = register_filesystem(&cifs_fs_type);
				if (!rc) {                
					rc = (int)kernel_thread(cifs_oplock_thread, NULL, 
						CLONE_FS | CLONE_FILES | CLONE_VM);
					if(rc > 0) {
						rc = (int)kernel_thread(cifs_dnotify_thread, NULL,
							CLONE_FS | CLONE_FILES | CLONE_VM);
						if(rc > 0)
							return 0;
						else
							cERROR(1,("error %d create dnotify thread", rc));
					} else {
	if (rc)
		goto out_destroy_request_bufs;

	oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd");
	if (IS_ERR(oplockThread)) {
		rc = PTR_ERR(oplockThread);
		cERROR(1,("error %d create oplock thread", rc));
		goto out_unregister_filesystem;
	}

	dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd");
	if (IS_ERR(dnotifyThread)) {
		rc = PTR_ERR(dnotifyThread);
		cERROR(1,("error %d create dnotify thread", rc));
		goto out_stop_oplock_thread;
	}

	return 0;

 out_stop_oplock_thread:
	kthread_stop(oplockThread);
 out_unregister_filesystem:
	unregister_filesystem(&cifs_fs_type);
 out_destroy_request_bufs:
	cifs_destroy_request_bufs();
			}
 out_destroy_mids:
	cifs_destroy_mids();
		}
 out_destroy_inodecache:
	cifs_destroy_inodecache();
	}
 out_clean_proc:
#ifdef CONFIG_PROC_FS
	cifs_proc_clean();
#endif
@@ -1025,14 +1032,8 @@ exit_cifs(void)
	cifs_destroy_inodecache();
	cifs_destroy_mids();
	cifs_destroy_request_bufs();
	if(oplockThread) {
		send_sig(SIGTERM, oplockThread, 1);
		wait_for_completion(&cifs_oplock_exited);
	}
	if(dnotifyThread) {
		send_sig(SIGTERM, dnotifyThread, 1);
		wait_for_completion(&cifs_dnotify_exited);
	}
	kthread_stop(oplockThread);
	kthread_stop(dnotifyThread);
}

MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>");
+1 −1
Original line number Diff line number Diff line
@@ -3119,7 +3119,7 @@ CIFSFindFirst(const int xid, struct cifsTconInfo *tcon,
				psrch_inf->endOfSearch = FALSE;

			psrch_inf->entries_in_buffer  = le16_to_cpu(parms->SearchCount);
			psrch_inf->index_of_last_entry = 
			psrch_inf->index_of_last_entry = 2 /* skip . and .. */ +
				psrch_inf->entries_in_buffer;
			*pnetfid = parms->SearchHandle;
		} else {
+4 −1
Original line number Diff line number Diff line
@@ -3447,7 +3447,10 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
			pSesInfo->server->secMode,
			pSesInfo->server->capabilities,
			pSesInfo->server->timeZone));
		if (extended_security
		if(experimEnabled > 1)
			rc = CIFS_SessSetup(xid, pSesInfo, CIFS_NTLM /* type */,
					    &ntlmv2_flag, nls_info);	
		else if (extended_security
				&& (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)
				&& (pSesInfo->server->secType == NTLMSSP)) {
			cFYI(1, ("New style sesssetup"));
Loading