Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etercifs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etercifs
Commits
ff50f3f4
Commit
ff50f3f4
authored
Feb 19, 2011
by
Pavel Shilovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes in 2.6.27
- oplock handling - update from longterm tree
parent
dde59e40
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
20 deletions
+33
-20
cifsfs.c
sources/2.6.27/cifsfs.c
+5
-3
cifsproto.h
sources/2.6.27/cifsproto.h
+1
-1
cifssmb.c
sources/2.6.27/cifssmb.c
+19
-1
file.c
sources/2.6.27/file.c
+7
-6
sess.c
sources/2.6.27/sess.c
+1
-9
No files found.
sources/2.6.27/cifsfs.c
View file @
ff50f3f4
...
...
@@ -1025,9 +1025,11 @@ static int cifs_oplock_thread(void *dummyarg)
already released by the server in that case */
if
(
!
pTcon
->
need_reconnect
)
{
rc
=
CIFSSMBLock
(
0
,
pTcon
,
netfid
,
netpid
,
0
/* len */
,
0
/* offset */
,
0
,
0
,
LOCKING_ANDX_OPLOCK_RELEASE
,
false
/* wait flag */
);
0
/* len */
,
0
/* offset */
,
0
,
0
,
LOCKING_ANDX_OPLOCK_RELEASE
,
false
/* wait flag */
,
CIFS_I
(
inode
)
->
clientCanCacheRead
?
1
:
0
);
cFYI
(
1
,
(
"Oplock release rc = %d"
,
rc
));
}
set_current_state
(
TASK_INTERRUPTIBLE
);
...
...
sources/2.6.27/cifsproto.h
View file @
ff50f3f4
...
...
@@ -304,7 +304,7 @@ extern int CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
const
__u16
netfid
,
const
__u32
netpid
,
const
__u64
len
,
const
__u64
offset
,
const
__u32
numUnlock
,
const
__u32
numLock
,
const
__u8
lockType
,
const
bool
waitFlag
);
const
bool
waitFlag
,
const
__u8
oplock_level
);
extern
int
CIFSSMBPosixLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
smb_file_id
,
const
__u32
netpid
,
const
int
get_flag
,
const
__u64
len
,
struct
file_lock
*
,
...
...
sources/2.6.27/cifssmb.c
View file @
ff50f3f4
...
...
@@ -1606,6 +1606,14 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon,
*
nbytes
=
le16_to_cpu
(
pSMBr
->
CountHigh
);
*
nbytes
=
(
*
nbytes
)
<<
16
;
*
nbytes
+=
le16_to_cpu
(
pSMBr
->
Count
);
/*
* Mask off high 16 bits when bytes written as returned by the
* server is greater than bytes requested by the client. Some
* OS/2 servers are known to set incorrect CountHigh values.
*/
if
(
*
nbytes
>
count
)
*
nbytes
&=
0xFFFF
;
}
cifs_buf_release
(
pSMB
);
...
...
@@ -1695,6 +1703,14 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
*
nbytes
=
le16_to_cpu
(
pSMBr
->
CountHigh
);
*
nbytes
=
(
*
nbytes
)
<<
16
;
*
nbytes
+=
le16_to_cpu
(
pSMBr
->
Count
);
/*
* Mask off high 16 bits when bytes written as returned by the
* server is greater than bytes requested by the client. OS/2
* servers are known to set incorrect CountHigh values.
*/
if
(
*
nbytes
>
count
)
*
nbytes
&=
0xFFFF
;
}
/* cifs_small_buf_release(pSMB); */
/* Freed earlier now in SendReceive2 */
...
...
@@ -1714,7 +1730,8 @@ int
CIFSSMBLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
smb_file_id
,
const
__u32
net_pid
,
const
__u64
len
,
const
__u64
offset
,
const
__u32
numUnlock
,
const
__u32
numLock
,
const
__u8
lockType
,
const
bool
waitFlag
)
const
__u32
numLock
,
const
__u8
lockType
,
const
bool
waitFlag
,
const
__u8
oplock_level
)
{
int
rc
=
0
;
LOCK_REQ
*
pSMB
=
NULL
;
...
...
@@ -1742,6 +1759,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
pSMB
->
NumberOfLocks
=
cpu_to_le16
(
numLock
);
pSMB
->
NumberOfUnlocks
=
cpu_to_le16
(
numUnlock
);
pSMB
->
LockType
=
lockType
;
pSMB
->
OplockLevel
=
oplock_level
;
pSMB
->
AndXCommand
=
0xFF
;
/* none */
pSMB
->
Fid
=
smb_file_id
;
/* netfid stays le */
...
...
sources/2.6.27/file.c
View file @
ff50f3f4
...
...
@@ -740,12 +740,12 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
/* BB we could chain these into one lock request BB */
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
length
,
pfLock
->
fl_start
,
0
,
1
,
lockType
,
0
/* wait flag */
);
0
,
1
,
lockType
,
0
/* wait flag */
,
0
);
if
(
rc
==
0
)
{
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
length
,
pfLock
->
fl_start
,
1
/* numUnlock */
,
0
/* numLock */
,
lockType
,
0
/* wait flag */
);
0
/* wait flag */
,
0
);
pfLock
->
fl_type
=
F_UNLCK
;
if
(
rc
!=
0
)
cERROR
(
1
,
(
"Error unlocking previously locked "
...
...
@@ -762,13 +762,13 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
length
,
pfLock
->
fl_start
,
0
,
1
,
lockType
|
LOCKING_ANDX_SHARED_LOCK
,
0
/* wait flag */
);
0
/* wait flag */
,
0
);
if
(
rc
==
0
)
{
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
length
,
pfLock
->
fl_start
,
1
,
0
,
lockType
|
LOCKING_ANDX_SHARED_LOCK
,
0
/* wait flag */
);
0
/* wait flag */
,
0
);
pfLock
->
fl_type
=
F_RDLCK
;
if
(
rc
!=
0
)
cERROR
(
1
,
(
"Error unlocking "
...
...
@@ -813,7 +813,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
if
(
numLock
)
{
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
length
,
pfLock
->
fl_start
,
0
,
numLock
,
lockType
,
wait_flag
);
0
,
numLock
,
lockType
,
wait_flag
,
0
);
if
(
rc
==
0
)
{
/* For Windows locks we must store them. */
...
...
@@ -835,7 +835,8 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
stored_rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
li
->
length
,
li
->
offset
,
1
,
0
,
li
->
type
,
false
);
1
,
0
,
li
->
type
,
false
,
0
);
if
(
stored_rc
)
rc
=
stored_rc
;
else
{
...
...
sources/2.6.27/sess.c
View file @
ff50f3f4
...
...
@@ -482,15 +482,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
/* calculate session key */
setup_ntlmv2_rsp
(
ses
,
v2_sess_key
,
nls_cp
);
if
(
first_time
)
/* should this be moved into common code
with similar ntlmv2 path? */
/* cifs_calculate_ntlmv2_mac_key(ses->server->mac_signing_key,
response BB FIXME, v2_sess_key); */
/* copy session key */
/* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE);
bcc_ptr += LM2_SESS_KEY_SIZE; */
/* FIXME: calculate MAC key */
memcpy
(
bcc_ptr
,
(
char
*
)
v2_sess_key
,
sizeof
(
struct
ntlmv2_resp
));
bcc_ptr
+=
sizeof
(
struct
ntlmv2_resp
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment