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
2b448c6b
Commit
2b448c6b
authored
Oct 26, 2002
by
James Bottomley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCSI] fix memory etc. leak caused by double preparing requeued commands
parent
30b010d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
13 deletions
+6
-13
drivers/scsi/scsi.c
drivers/scsi/scsi.c
+1
-1
drivers/scsi/scsi.h
drivers/scsi/scsi.h
+1
-0
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_lib.c
+4
-12
No files found.
drivers/scsi/scsi.c
View file @
2b448c6b
...
...
@@ -658,7 +658,7 @@ inline void __scsi_release_command(Scsi_Cmnd * SCpnt)
* Notes: This could be called either from an interrupt context or a
* normal process context.
*/
static
int
scsi_mlqueue_insert
(
Scsi_Cmnd
*
cmd
,
int
reason
)
int
scsi_mlqueue_insert
(
Scsi_Cmnd
*
cmd
,
int
reason
)
{
struct
Scsi_Host
*
host
=
cmd
->
host
;
unsigned
long
flags
;
...
...
drivers/scsi/scsi.h
View file @
2b448c6b
...
...
@@ -480,6 +480,7 @@ extern void scsi_do_cmd(Scsi_Cmnd *, const void *cmnd,
void
(
*
done
)
(
struct
scsi_cmnd
*
),
int
timeout
,
int
retries
);
extern
int
scsi_dev_init
(
void
);
extern
int
scsi_mlqueue_insert
(
struct
scsi_cmnd
*
,
int
);
/*
* Newer request-based interfaces.
...
...
drivers/scsi/scsi_lib.c
View file @
2b448c6b
...
...
@@ -1005,7 +1005,8 @@ void scsi_request_fn(request_queue_t * q)
req
=
NULL
;
spin_unlock_irq
(
q
->
queue_lock
);
if
(
SCpnt
->
request
->
flags
&
(
REQ_CMD
|
REQ_BLOCK_PC
))
{
if
(
!
(
SCpnt
->
request
->
flags
&
REQ_DONTPREP
)
&&
(
SCpnt
->
request
->
flags
&
(
REQ_CMD
|
REQ_BLOCK_PC
)))
{
/*
* This will do a couple of things:
* 1) Fill in the actual SCSI command.
...
...
@@ -1026,18 +1027,8 @@ void scsi_request_fn(request_queue_t * q)
* required).
*/
if
(
!
scsi_init_io
(
SCpnt
))
{
scsi_mlqueue_insert
(
SCpnt
,
SCSI_MLQUEUE_DEVICE_BUSY
);
spin_lock_irq
(
q
->
queue_lock
);
SHpnt
->
host_busy
--
;
SDpnt
->
device_busy
--
;
if
(
SDpnt
->
device_busy
==
0
)
{
SDpnt
->
starved
=
1
;
SHpnt
->
some_device_starved
=
1
;
}
SCpnt
->
request
->
special
=
SCpnt
;
SCpnt
->
request
->
flags
|=
REQ_SPECIAL
;
if
(
blk_rq_tagged
(
SCpnt
->
request
))
blk_queue_end_tag
(
q
,
SCpnt
->
request
);
_elv_add_request
(
q
,
SCpnt
->
request
,
0
,
0
);
break
;
}
...
...
@@ -1058,6 +1049,7 @@ void scsi_request_fn(request_queue_t * q)
continue
;
}
}
SCpnt
->
request
->
flags
|=
REQ_DONTPREP
;
/*
* Finally, initialize any error handling parameters, and set up
* the timers for timeouts.
...
...
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