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

Commit 60808233 authored by Steve French's avatar Steve French
Browse files

[CIFS] Readdir fixes to allow search to start at arbitrary position


in directory

Also includes first part of fix to compensate for servers which forget
to return . and .. as well as updates to changelog and cifs readme.

Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 45af7a0f
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 
+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"));
+20 −12
Original line number Diff line number Diff line
@@ -904,8 +904,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
				if (rc != 0)
					break;
			}
			/* BB FIXME We can not sign across two buffers yet */
			if((pTcon->ses->server->secMode & 
			if(experimEnabled || (pTcon->ses->server->secMode & 
			 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) {
				struct kvec iov[2];
				unsigned int len;
@@ -921,13 +920,13 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
						*poffset, &bytes_written,
						iov, 1, long_op);
			} else
			/* BB FIXME fixup indentation of line below */
				rc = CIFSSMBWrite(xid, pTcon,
					 open_file->netfid,
					 min_t(const int, cifs_sb->wsize,
					       write_size - total_written),
					 *poffset, &bytes_written,
				 write_data + total_written, NULL, long_op);
					 write_data + total_written,
					 NULL, long_op);
		}
		if (rc || (bytes_written == 0)) {
			if (total_written)
@@ -966,6 +965,16 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode)
	struct cifsFileInfo *open_file;
	int rc;

	/* Having a null inode here (because mapping->host was set to zero by
	the VFS or MM) should not happen but we had reports of on oops (due to
	it being zero) during stress testcases so we need to check for it */

	if(cifs_inode == NULL) {
		cERROR(1,("Null inode passed to cifs_writeable_file"));
		dump_stack();
		return NULL;
	}

	read_lock(&GlobalSMBSeslock);
	list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
		if (open_file->closePend)
@@ -1091,11 +1100,10 @@ static int cifs_writepages(struct address_space *mapping,
	if (cifs_sb->wsize < PAGE_CACHE_SIZE)
		return generic_writepages(mapping, wbc);

	/* BB FIXME we do not have code to sign across multiple buffers yet,
	   so go to older writepage style write which we can sign if needed */
	if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server))
		if(cifs_sb->tcon->ses->server->secMode &
                          (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
			if(!experimEnabled)
				return generic_writepages(mapping, wbc);

	/*
Loading