Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
83ff6fe8
Commit
83ff6fe8
authored
Mar 02, 2008
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] don't mess with file in scsi_nonblockable_ioctl()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
633a08b8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
6 deletions
+9
-6
drivers/scsi/scsi_ioctl.c
drivers/scsi/scsi_ioctl.c
+2
-2
drivers/scsi/sd.c
drivers/scsi/sd.c
+2
-1
drivers/scsi/sr.c
drivers/scsi/sr.c
+2
-1
drivers/scsi/st.c
drivers/scsi/st.c
+2
-1
include/scsi/scsi_ioctl.h
include/scsi/scsi_ioctl.h
+1
-1
No files found.
drivers/scsi/scsi_ioctl.c
View file @
83ff6fe8
...
@@ -277,14 +277,14 @@ EXPORT_SYMBOL(scsi_ioctl);
...
@@ -277,14 +277,14 @@ EXPORT_SYMBOL(scsi_ioctl);
* @filp: either NULL or a &struct file which must have the O_NONBLOCK flag.
* @filp: either NULL or a &struct file which must have the O_NONBLOCK flag.
*/
*/
int
scsi_nonblockable_ioctl
(
struct
scsi_device
*
sdev
,
int
cmd
,
int
scsi_nonblockable_ioctl
(
struct
scsi_device
*
sdev
,
int
cmd
,
void
__user
*
arg
,
struct
file
*
filp
)
void
__user
*
arg
,
int
ndelay
)
{
{
int
val
,
result
;
int
val
,
result
;
/* The first set of iocts may be executed even if we're doing
/* The first set of iocts may be executed even if we're doing
* error processing, as long as the device was opened
* error processing, as long as the device was opened
* non-blocking */
* non-blocking */
if
(
filp
&&
(
filp
->
f_flags
&
O_NONBLOCK
)
)
{
if
(
ndelay
)
{
if
(
scsi_host_in_recovery
(
sdev
->
host
))
if
(
scsi_host_in_recovery
(
sdev
->
host
))
return
-
ENODEV
;
return
-
ENODEV
;
}
else
if
(
!
scsi_block_when_processing_errors
(
sdev
))
}
else
if
(
!
scsi_block_when_processing_errors
(
sdev
))
...
...
drivers/scsi/sd.c
View file @
83ff6fe8
...
@@ -761,7 +761,8 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
...
@@ -761,7 +761,8 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
* may try and take the device offline, in which case all further
* may try and take the device offline, in which case all further
* access to the device is prohibited.
* access to the device is prohibited.
*/
*/
error
=
scsi_nonblockable_ioctl
(
sdp
,
cmd
,
p
,
filp
);
error
=
scsi_nonblockable_ioctl
(
sdp
,
cmd
,
p
,
filp
?
filp
->
f_flags
&
O_NDELAY
:
0
);
if
(
!
scsi_block_when_processing_errors
(
sdp
)
||
!
error
)
if
(
!
scsi_block_when_processing_errors
(
sdp
)
||
!
error
)
return
error
;
return
error
;
...
...
drivers/scsi/sr.c
View file @
83ff6fe8
...
@@ -524,7 +524,8 @@ static int sr_block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
...
@@ -524,7 +524,8 @@ static int sr_block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
* case fall through to scsi_ioctl, which will return ENDOEV again
* case fall through to scsi_ioctl, which will return ENDOEV again
* if it doesn't recognise the ioctl
* if it doesn't recognise the ioctl
*/
*/
ret
=
scsi_nonblockable_ioctl
(
sdev
,
cmd
,
argp
,
NULL
);
ret
=
scsi_nonblockable_ioctl
(
sdev
,
cmd
,
argp
,
file
?
file
->
f_flags
&
O_NDELAY
:
0
);
if
(
ret
!=
-
ENODEV
)
if
(
ret
!=
-
ENODEV
)
return
ret
;
return
ret
;
return
scsi_ioctl
(
sdev
,
cmd
,
argp
);
return
scsi_ioctl
(
sdev
,
cmd
,
argp
);
...
...
drivers/scsi/st.c
View file @
83ff6fe8
...
@@ -3263,7 +3263,8 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
...
@@ -3263,7 +3263,8 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
* may try and take the device offline, in which case all further
* may try and take the device offline, in which case all further
* access to the device is prohibited.
* access to the device is prohibited.
*/
*/
retval
=
scsi_nonblockable_ioctl
(
STp
->
device
,
cmd_in
,
p
,
file
);
retval
=
scsi_nonblockable_ioctl
(
STp
->
device
,
cmd_in
,
p
,
file
->
f_flags
&
O_NDELAY
);
if
(
!
scsi_block_when_processing_errors
(
STp
->
device
)
||
retval
!=
-
ENODEV
)
if
(
!
scsi_block_when_processing_errors
(
STp
->
device
)
||
retval
!=
-
ENODEV
)
goto
out
;
goto
out
;
retval
=
0
;
retval
=
0
;
...
...
include/scsi/scsi_ioctl.h
View file @
83ff6fe8
...
@@ -42,7 +42,7 @@ typedef struct scsi_fctargaddress {
...
@@ -42,7 +42,7 @@ typedef struct scsi_fctargaddress {
extern
int
scsi_ioctl
(
struct
scsi_device
*
,
int
,
void
__user
*
);
extern
int
scsi_ioctl
(
struct
scsi_device
*
,
int
,
void
__user
*
);
extern
int
scsi_nonblockable_ioctl
(
struct
scsi_device
*
sdev
,
int
cmd
,
extern
int
scsi_nonblockable_ioctl
(
struct
scsi_device
*
sdev
,
int
cmd
,
void
__user
*
arg
,
struct
file
*
filp
);
void
__user
*
arg
,
int
ndelay
);
#endif
/* __KERNEL__ */
#endif
/* __KERNEL__ */
#endif
/* _SCSI_IOCTL_H */
#endif
/* _SCSI_IOCTL_H */
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