Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
fb2036d8
Commit
fb2036d8
authored
Nov 23, 2016
by
Pavel Shilovsky
Committed by
Steve French
Feb 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CIFS: Make send_cancel take rqst as argument
Signed-off-by:
Pavel Shilovsky
<
pshilov@microsoft.com
>
parent
da502f7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
17 deletions
+22
-17
fs/cifs/cifsglob.h
fs/cifs/cifsglob.h
+1
-1
fs/cifs/smb1ops.c
fs/cifs/smb1ops.c
+2
-2
fs/cifs/transport.c
fs/cifs/transport.c
+19
-14
No files found.
fs/cifs/cifsglob.h
View file @
fb2036d8
...
...
@@ -208,7 +208,7 @@ struct cifsInodeInfo;
struct
cifs_open_parms
;
struct
smb_version_operations
{
int
(
*
send_cancel
)(
struct
TCP_Server_Info
*
,
void
*
,
int
(
*
send_cancel
)(
struct
TCP_Server_Info
*
,
struct
smb_rqst
*
,
struct
mid_q_entry
*
);
bool
(
*
compare_fids
)(
struct
cifsFileInfo
*
,
struct
cifsFileInfo
*
);
/* setup request: allocate mid, sign message */
...
...
fs/cifs/smb1ops.c
View file @
fb2036d8
...
...
@@ -36,11 +36,11 @@
* SMB_COM_NT_CANCEL request and then sends it.
*/
static
int
send_nt_cancel
(
struct
TCP_Server_Info
*
server
,
void
*
buf
,
send_nt_cancel
(
struct
TCP_Server_Info
*
server
,
struct
smb_rqst
*
rqst
,
struct
mid_q_entry
*
mid
)
{
int
rc
=
0
;
struct
smb_hdr
*
in_buf
=
(
struct
smb_hdr
*
)
buf
;
struct
smb_hdr
*
in_buf
=
(
struct
smb_hdr
*
)
rqst
->
rq_iov
[
0
].
iov_base
;
/* -4 for RFC1001 length and +2 for BCC field */
in_buf
->
smb_buf_length
=
cpu_to_be32
(
sizeof
(
struct
smb_hdr
)
-
4
+
2
);
...
...
fs/cifs/transport.c
View file @
fb2036d8
...
...
@@ -596,10 +596,11 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
}
static
inline
int
send_cancel
(
struct
TCP_Server_Info
*
server
,
void
*
buf
,
struct
mid_q_entry
*
mid
)
send_cancel
(
struct
TCP_Server_Info
*
server
,
struct
smb_rqst
*
rqst
,
struct
mid_q_entry
*
mid
)
{
return
server
->
ops
->
send_cancel
?
server
->
ops
->
send_cancel
(
server
,
buf
,
mid
)
:
0
;
server
->
ops
->
send_cancel
(
server
,
rqst
,
mid
)
:
0
;
}
int
...
...
@@ -719,7 +720,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
rc
=
wait_for_response
(
ses
->
server
,
midQ
);
if
(
rc
!=
0
)
{
send_cancel
(
ses
->
server
,
buf
,
midQ
);
send_cancel
(
ses
->
server
,
&
rqst
,
midQ
);
spin_lock
(
&
GlobalMid_Lock
);
if
(
midQ
->
mid_state
==
MID_REQUEST_SUBMITTED
)
{
midQ
->
callback
=
DeleteMidQEntry
;
...
...
@@ -772,6 +773,9 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
{
int
rc
=
0
;
struct
mid_q_entry
*
midQ
;
unsigned
int
len
=
be32_to_cpu
(
in_buf
->
smb_buf_length
);
struct
kvec
iov
=
{
.
iov_base
=
in_buf
,
.
iov_len
=
len
};
struct
smb_rqst
rqst
=
{
.
rq_iov
=
&
iov
,
.
rq_nvec
=
1
};
if
(
ses
==
NULL
)
{
cifs_dbg
(
VFS
,
"Null smb session
\n
"
);
...
...
@@ -789,10 +793,9 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
to the same server. We may make this configurable later or
use ses->maxReq */
if
(
be32_to_cpu
(
in_buf
->
smb_buf_length
)
>
CIFSMaxBufSize
+
MAX_CIFS_HDR_SIZE
-
4
)
{
if
(
len
>
CIFSMaxBufSize
+
MAX_CIFS_HDR_SIZE
-
4
)
{
cifs_dbg
(
VFS
,
"Illegal length, greater than maximum frame, %d
\n
"
,
be32_to_cpu
(
in_buf
->
smb_buf_length
)
);
len
);
return
-
EIO
;
}
...
...
@@ -823,7 +826,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
midQ
->
mid_state
=
MID_REQUEST_SUBMITTED
;
cifs_in_send_inc
(
ses
->
server
);
rc
=
smb_send
(
ses
->
server
,
in_buf
,
be32_to_cpu
(
in_buf
->
smb_buf_length
)
);
rc
=
smb_send
(
ses
->
server
,
in_buf
,
len
);
cifs_in_send_dec
(
ses
->
server
);
cifs_save_when_sent
(
midQ
);
...
...
@@ -840,7 +843,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
rc
=
wait_for_response
(
ses
->
server
,
midQ
);
if
(
rc
!=
0
)
{
send_cancel
(
ses
->
server
,
in_buf
,
midQ
);
send_cancel
(
ses
->
server
,
&
rqst
,
midQ
);
spin_lock
(
&
GlobalMid_Lock
);
if
(
midQ
->
mid_state
==
MID_REQUEST_SUBMITTED
)
{
/* no longer considered to be "in-flight" */
...
...
@@ -909,6 +912,9 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
int
rstart
=
0
;
struct
mid_q_entry
*
midQ
;
struct
cifs_ses
*
ses
;
unsigned
int
len
=
be32_to_cpu
(
in_buf
->
smb_buf_length
);
struct
kvec
iov
=
{
.
iov_base
=
in_buf
,
.
iov_len
=
len
};
struct
smb_rqst
rqst
=
{
.
rq_iov
=
&
iov
,
.
rq_nvec
=
1
};
if
(
tcon
==
NULL
||
tcon
->
ses
==
NULL
)
{
cifs_dbg
(
VFS
,
"Null smb session
\n
"
);
...
...
@@ -928,10 +934,9 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
to the same server. We may make this configurable later or
use ses->maxReq */
if
(
be32_to_cpu
(
in_buf
->
smb_buf_length
)
>
CIFSMaxBufSize
+
MAX_CIFS_HDR_SIZE
-
4
)
{
if
(
len
>
CIFSMaxBufSize
+
MAX_CIFS_HDR_SIZE
-
4
)
{
cifs_dbg
(
VFS
,
"Illegal length, greater than maximum frame, %d
\n
"
,
be32_to_cpu
(
in_buf
->
smb_buf_length
)
);
len
);
return
-
EIO
;
}
...
...
@@ -960,7 +965,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
midQ
->
mid_state
=
MID_REQUEST_SUBMITTED
;
cifs_in_send_inc
(
ses
->
server
);
rc
=
smb_send
(
ses
->
server
,
in_buf
,
be32_to_cpu
(
in_buf
->
smb_buf_length
)
);
rc
=
smb_send
(
ses
->
server
,
in_buf
,
len
);
cifs_in_send_dec
(
ses
->
server
);
cifs_save_when_sent
(
midQ
);
...
...
@@ -989,7 +994,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
if
(
in_buf
->
Command
==
SMB_COM_TRANSACTION2
)
{
/* POSIX lock. We send a NT_CANCEL SMB to cause the
blocking lock to return. */
rc
=
send_cancel
(
ses
->
server
,
in_buf
,
midQ
);
rc
=
send_cancel
(
ses
->
server
,
&
rqst
,
midQ
);
if
(
rc
)
{
cifs_delete_mid
(
midQ
);
return
rc
;
...
...
@@ -1010,7 +1015,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
rc
=
wait_for_response
(
ses
->
server
,
midQ
);
if
(
rc
)
{
send_cancel
(
ses
->
server
,
in_buf
,
midQ
);
send_cancel
(
ses
->
server
,
&
rqst
,
midQ
);
spin_lock
(
&
GlobalMid_Lock
);
if
(
midQ
->
mid_state
==
MID_REQUEST_SUBMITTED
)
{
/* no longer considered to be "in-flight" */
...
...
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