Commit 5221ad8c authored by Steve French's avatar Steve French Committed by Steve French

fix create/open/lookup to use namei intent flags. Enable oplock and packet signing

parent f280895e
Version 0.84
------------
Finish support for Linux 2.5 open/create changes, which removes the
redundant NTCreate/QPathInfo/close that was sent during file create.
Enable oplock by default. Enable packet signing by default (needed to
access many recent Windows servers)
Version 0.83 Version 0.83
------------ ------------
Fix oops when mounting to long server names caused by inverted parms to kmalloc. Fix oops when mounting to long server names caused by inverted parms to kmalloc.
......
...@@ -150,7 +150,10 @@ Configuration pseudo-files: ...@@ -150,7 +150,10 @@ Configuration pseudo-files:
point and if the uids user/password mapping point and if the uids user/password mapping
information is available. (default is 0) information is available. (default is 0)
PacketSigningEnabled If set to one, cifs packet signing is enabled PacketSigningEnabled If set to one, cifs packet signing is enabled
(default 0) and will be used if the server requires
it. If set to two, cifs packet signing is
required even if the server considers packet
signing optional. (default 1)
cifsFYI If set to one, additional debug information is cifsFYI If set to one, additional debug information is
logged to the system error log. (default 0) logged to the system error log. (default 0)
ExtendedSecurity If set to one, SPNEGO session establishment ExtendedSecurity If set to one, SPNEGO session establishment
...@@ -166,6 +169,7 @@ Configuration pseudo-files: ...@@ -166,6 +169,7 @@ Configuration pseudo-files:
for one second improving performance of lookups for one second improving performance of lookups
(default 1) (default 1)
OplockEnabled If set to one, safe distributed caching enabled. OplockEnabled If set to one, safe distributed caching enabled.
(default 1)
These experimental features and tracing can be enabled by changing flags in /proc/fs/cifs 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 kernel, e.g. insmod cifs). (after the cifs module has been installed or built into the kernel, e.g. insmod cifs).
......
...@@ -47,12 +47,12 @@ extern struct file_system_type cifs_fs_type; ...@@ -47,12 +47,12 @@ extern struct file_system_type cifs_fs_type;
int cifsFYI = 0; int cifsFYI = 0;
int cifsERROR = 1; int cifsERROR = 1;
int traceSMB = 0; int traceSMB = 0;
unsigned int oplockEnabled = 0; unsigned int oplockEnabled = 1;
unsigned int lookupCacheEnabled = 1; unsigned int lookupCacheEnabled = 1;
unsigned int multiuser_mount = 0; unsigned int multiuser_mount = 0;
unsigned int extended_security = 0; unsigned int extended_security = 0;
unsigned int ntlmv2_support = 0; unsigned int ntlmv2_support = 0;
unsigned int sign_CIFS_PDUs = 0; unsigned int sign_CIFS_PDUs = 1;
unsigned int CIFSMaximumBufferSize = CIFS_MAX_MSGSIZE; unsigned int CIFSMaximumBufferSize = CIFS_MAX_MSGSIZE;
struct task_struct * oplockThread = NULL; struct task_struct * oplockThread = NULL;
...@@ -439,7 +439,6 @@ static int cifs_oplock_thread(void * dummyarg) ...@@ -439,7 +439,6 @@ static int cifs_oplock_thread(void * dummyarg)
struct list_head * tmp; struct list_head * tmp;
struct list_head * tmp1; struct list_head * tmp1;
struct oplock_q_entry * oplock_item; struct oplock_q_entry * oplock_item;
struct file * pfile;
struct cifsTconInfo *pTcon; struct cifsTconInfo *pTcon;
int rc; int rc;
...@@ -457,23 +456,19 @@ static int cifs_oplock_thread(void * dummyarg) ...@@ -457,23 +456,19 @@ static int cifs_oplock_thread(void * dummyarg)
qhead); qhead);
if(oplock_item) { if(oplock_item) {
pTcon = oplock_item->tcon; pTcon = oplock_item->tcon;
pfile = oplock_item->file_to_flush;
cFYI(1,("process item on queue"));/* BB remove */
DeleteOplockQEntry(oplock_item); DeleteOplockQEntry(oplock_item);
write_unlock(&GlobalMid_Lock); write_unlock(&GlobalMid_Lock);
rc = filemap_fdatawrite(pfile->f_dentry->d_inode->i_mapping); rc = filemap_fdatawrite(oplock_item->pinode->i_mapping);
if(rc) if(rc)
CIFS_I(pfile->f_dentry->d_inode)->write_behind_rc CIFS_I(oplock_item->pinode)->write_behind_rc
= rc; = rc;
cFYI(1,("Oplock flush file %p rc %d",pfile,rc)); cFYI(1,("Oplock flush inode %p rc %d",oplock_item->pinode,rc));
if(pfile->private_data) { rc = CIFSSMBLock(0, pTcon,
rc = CIFSSMBLock(0, pTcon, oplock_item->netfid,
((struct cifsFileInfo *) pfile->private_data)->netfid, 0 /* len */ , 0 /* offset */, 0,
0 /* len */ , 0 /* offset */, 0, 0, LOCKING_ANDX_OPLOCK_RELEASE,
0, LOCKING_ANDX_OPLOCK_RELEASE, 0 /* wait flag */);
0 /* wait flag */); cFYI(1,("Oplock release rc = %d ",rc));
cFYI(1,("Oplock release rc = %d ",rc));
}
write_lock(&GlobalMid_Lock); write_lock(&GlobalMid_Lock);
} else } else
break; break;
......
...@@ -390,12 +390,12 @@ is_valid_oplock_break(struct smb_hdr *buf) ...@@ -390,12 +390,12 @@ is_valid_oplock_break(struct smb_hdr *buf)
read_unlock(&GlobalSMBSeslock); read_unlock(&GlobalSMBSeslock);
cFYI(1,("Matching file id, processing oplock break")); cFYI(1,("Matching file id, processing oplock break"));
pCifsInode = pCifsInode =
CIFS_I(netfile->pfile->f_dentry->d_inode); CIFS_I(netfile->pInode);
pCifsInode->clientCanCacheAll = FALSE; pCifsInode->clientCanCacheAll = FALSE;
if(pSMB->OplockLevel == 0) if(pSMB->OplockLevel == 0)
pCifsInode->clientCanCacheRead = FALSE; pCifsInode->clientCanCacheRead = FALSE;
pCifsInode->oplockPending = TRUE; pCifsInode->oplockPending = TRUE;
AllocOplockQEntry(netfile->pfile, tcon); AllocOplockQEntry(netfile->pInode, netfile->netfid, tcon);
cFYI(1,("about to wake up oplock thd")); cFYI(1,("about to wake up oplock thd"));
wake_up_process(oplockThread); wake_up_process(oplockThread);
return TRUE; return TRUE;
......
...@@ -101,10 +101,10 @@ DeleteMidQEntry(struct mid_q_entry *midEntry) ...@@ -101,10 +101,10 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
} }
struct oplock_q_entry * struct oplock_q_entry *
AllocOplockQEntry(struct file * file, struct cifsTconInfo * tcon) AllocOplockQEntry(struct inode * pinode, __u16 fid, struct cifsTconInfo * tcon)
{ {
struct oplock_q_entry *temp; struct oplock_q_entry *temp;
if ((file == NULL) || (tcon == NULL)) { if ((pinode== NULL) || (tcon == NULL)) {
cERROR(1, ("Null parms passed to AllocOplockQEntry")); cERROR(1, ("Null parms passed to AllocOplockQEntry"));
return NULL; return NULL;
} }
...@@ -113,8 +113,9 @@ AllocOplockQEntry(struct file * file, struct cifsTconInfo * tcon) ...@@ -113,8 +113,9 @@ AllocOplockQEntry(struct file * file, struct cifsTconInfo * tcon)
if (temp == NULL) if (temp == NULL)
return temp; return temp;
else { else {
temp->file_to_flush = file; temp->pinode = pinode;
temp->tcon = tcon; temp->tcon = tcon;
temp->netfid = fid;
write_lock(&GlobalMid_Lock); write_lock(&GlobalMid_Lock);
list_add_tail(&temp->qhead, &GlobalOplock_Q); list_add_tail(&temp->qhead, &GlobalOplock_Q);
write_unlock(&GlobalMid_Lock); write_unlock(&GlobalMid_Lock);
......
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