aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastryyy@gmail.com>2011-01-17 12:15:44 -0500
committerSteve French <sfrench@us.ibm.com>2011-01-19 12:52:29 -0500
commit12fed00de963433128b5366a21a55808fab2f756 (patch)
tree2898690f5853027b70eda1bd7f3aeb78fe9af74d /fs/cifs/cifssmb.c
parentc56eb8fb6dccb83d9fe62fd4dc00c834de9bc470 (diff)
CIFS: Fix oplock break handling (try #2)
When we get oplock break notification we should set the appropriate value of OplockLevel field in oplock break acknowledge according to the oplock level held by the client in this time. As we only can have level II oplock or no oplock in the case of oplock break, we should be aware only about clientCanCacheRead field in cifsInodeInfo structure. Also fix bug connected with wrong interpretation of OplockLevel field during oplock break notification processing. Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Cc: <stable@kernel.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 2f6795e524d3..3652cc60314c 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1663,7 +1663,8 @@ int
1663CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, 1663CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
1664 const __u16 smb_file_id, const __u64 len, 1664 const __u16 smb_file_id, const __u64 len,
1665 const __u64 offset, const __u32 numUnlock, 1665 const __u64 offset, const __u32 numUnlock,
1666 const __u32 numLock, const __u8 lockType, const bool waitFlag) 1666 const __u32 numLock, const __u8 lockType,
1667 const bool waitFlag, const __u8 oplock_level)
1667{ 1668{
1668 int rc = 0; 1669 int rc = 0;
1669 LOCK_REQ *pSMB = NULL; 1670 LOCK_REQ *pSMB = NULL;
@@ -1691,6 +1692,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
1691 pSMB->NumberOfLocks = cpu_to_le16(numLock); 1692 pSMB->NumberOfLocks = cpu_to_le16(numLock);
1692 pSMB->NumberOfUnlocks = cpu_to_le16(numUnlock); 1693 pSMB->NumberOfUnlocks = cpu_to_le16(numUnlock);
1693 pSMB->LockType = lockType; 1694 pSMB->LockType = lockType;
1695 pSMB->OplockLevel = oplock_level;
1694 pSMB->AndXCommand = 0xFF; /* none */ 1696 pSMB->AndXCommand = 0xFF; /* none */
1695 pSMB->Fid = smb_file_id; /* netfid stays le */ 1697 pSMB->Fid = smb_file_id; /* netfid stays le */
1696 1698