24 Aug, 2020
1 commit
-
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva
26 Apr, 2020
1 commit
-
Signed-off-by: Al Viro
03 Jan, 2020
1 commit
-
In order to move the compat handling for SCSI ioctl commands out of
fs/compat_ioctl.c into the individual drivers, we need a helper function
first to match the native ioctl handler called by sd, sr, st, etc.Reviewed-by: Ben Hutchings
Signed-off-by: Arnd Bergmann
21 May, 2019
1 commit
-
Add SPDX license identifiers to all files which:
- Have no license information of any form
- Have EXPORT_.*_SYMBOL_GPL inside which was used in the
initial scan/conversion to ignore the fileThese files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:GPL-2.0-only
Signed-off-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
04 Jan, 2019
1 commit
-
Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
of the user address range verification function since we got rid of the
old racy i386-only code to walk page tables by hand.It existed because the original 80386 would not honor the write protect
bit when in kernel mode, so you had to do COW by hand before doing any
user access. But we haven't supported that in a long time, and these
days the 'type' argument is a purely historical artifact.A discussion about extending 'user_access_begin()' to do the range
checking resulted this patch, because there is no way we're going to
move the old VERIFY_xyz interface to that model. And it's best done at
the end of the merge window when I've done most of my merges, so let's
just get this done once and for all.This patch was mostly done with a sed-script, with manual fix-ups for
the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.There were a couple of notable cases:
- csky still had the old "verify_area()" name as an alias.
- the iter_iov code had magical hardcoded knowledge of the actual
values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
really used it)- microblaze used the type argument for a debug printout
but other than those oddities this should be a total no-op patch.
I tried to fix up all architectures, did fairly extensive grepping for
access_ok() uses, and the changes are trivial, but I may have missed
something. Any missed conversion should be trivially fixable, though.Signed-off-by: Linus Torvalds
27 Jun, 2018
1 commit
-
When evaluating a SCSI command's result using the field access macros,
check for equality of the fields and not if a specific bit is set.This is a preparation patch, for reworking the results field in the
SCSI command.Signed-off-by: Johannes Thumshirn
Reviewed-by: Christoph Hellwig
Reviewed-by: Bart Van Assche
Signed-off-by: Martin K. Petersen
26 Aug, 2017
1 commit
-
The conclusion of a recent discussion about the new warnings
reported by gcc 7 is that the new warnings reported when building
with W=1 should be suppressed. However, gcc 7 still warns about
fall-through in switch statements when building with W=1. Suppress
these warnings by annotating the SCSI core properly.See also Linus Torvalds, Lots of new warnings with gcc-7.1.1, 11
July 2017 (https://www.mail-archive.com/linux-media@vger.kernel.org/msg115428.html).References: commit bd664f6b3e37 ("disable new gcc-7.1.1 warnings for now")
Signed-off-by: Bart Van Assche
Reviewed-by: Christoph Hellwig
Cc: Hannes Reinecke
Cc: Johannes Thumshirn
Signed-off-by: Martin K. Petersen
23 Feb, 2017
1 commit
-
It's a tiny structure that can be allocated on the stack, don't
complicate the code by making it optional.Signed-off-by: Christoph Hellwig
Signed-off-by: Martin K. Petersen
25 Dec, 2016
1 commit
-
This was entirely automated, using the script by Al:
PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*'
sed -i -e "s!$PATT!#include !" \
$(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)to do the replacement at the end of the merge window.
Requested-by: Al Viro
Signed-off-by: Linus Torvalds
12 Nov, 2014
5 commits
-
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
Reviewed-by: Hannes Reinecke -
The calling conventions for this function are bad as it could return
-ENODEV both for a device not currently online and a not recognized ioctl.Add a new scsi_ioctl_block_when_processing_errors function that wraps
scsi_block_when_processing_errors with the a special case for the
SG_SCSI_RESET ioctl command, and handle the SG_SCSI_RESET case itself
in scsi_ioctl. All callers of scsi_ioctl now must call the above helper
to check for the EH state, so that the ioctl handler itself doesn't
have to.Reported-by: Robert Elliott
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
Reviewed-by: Hannes Reinecke -
Pull the common code from the two callers into the function,
and rename it to scsi_ioctl_reset.Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
Reviewed-by: Hannes Reinecke -
We should be using the standard dev_printk() variants for
sense code printing.[hch: remove __scsi_print_sense call in xen-scsiback, Acked by Juergen]
[hch: folded bracing fix from Dan Carpenter]
Signed-off-by: Hannes Reinecke
Reviewed-by: Robert Elliott
Signed-off-by: Christoph Hellwig -
Further to a January 2013 thread titled: "[PATCH] SG_SCSI_RESET ioctl
should only perform requested operation" by Jeremy Linton a patch (v3)
is presented that expands the existing ioctl to include "no_escalate"
versions to the existing resets. This requires no changes to SCSI low
level drivers (LLDs); it adds several more finely tuned reset options
to the user space. For example:/* This call remains the same, with the same escalating semantics
* if the device (LU) reset fail. That is: on failure to try a
* target reset and if that fails, try a bus reset, and if that fails
* try a host (i.e. LLD) reset. */
val = SG_SCSI_RESET_DEVICE;
res = ioctl(, SG_SCSI_RESET, &val);/* What follows is a new option introduced by this patch series. Only
* a device reset is attempted. If that fails then an appropriate
* error code is provided. N.B. There is no reset escalation. */
val = SG_SCSI_RESET_DEVICE | SG_SCSI_RESET_NO_ESCALATE;
res = ioctl(, SG_SCSI_RESET, &val);Signed-off-by: Douglas Gilbert
Reviewed-by: Jeremy Linton
Reviewed-by: Hannes Reinecke
Signed-off-by: Christoph Hellwig
18 Jul, 2014
1 commit
-
Signed-off-by: Hannes Reinecke
Reviewed-by: Martin K. Petersen
Reviewed-by: Christoph Hellwig
Signed-off-by: Christoph Hellwig
05 Dec, 2009
1 commit
-
The scsi ioctl code path was missing scsi target reset
support. This patch just adds it.Signed-off-by: Mike Christie
Signed-off-by: James Bottomley
03 Jan, 2009
1 commit
-
[jejb: limit ioctl to returning 20 characters to avoid overrun
on long device names and add a few more conversions]
Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: James Bottomley
30 Dec, 2008
2 commits
-
scsi_execute() and scsi_execute_req() discard the residual length
information. Some callers need it. This adds residual argument
(optional) to scsi_execute and scsi_execute_req.Signed-off-by: FUJITA Tomonori
Signed-off-by: James Bottomley -
Fix kernel-doc parameter warning and correct the function name:
Warning(linux-next-20081022//drivers/scsi/scsi_ioctl.c:281): No description found for parameter 'ndelay'
Signed-off-by: Randy Dunlap
Signed-off-by: James Bottomley
21 Oct, 2008
2 commits
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
12 Jan, 2008
2 commits
-
The current scsi_test_unit_ready() is updated to return sense code
information (in struct scsi_sense_hdr). The sd and sr drivers are
changed to interpret the sense code return asc 0x3a as no media and
adjust the device status accordingly.Signed-off-by: James Bottomley
-
Add Documentation/DocBook/scsi_midlayer.tmpl, add to Makefile, and update
lots of kerneldoc comments in drivers/scsi/*.Updated with comments from Stefan Richter, Stephen M. Cameron,
James Bottomley and Randy Dunlap.Signed-off-by: Rob Landley
Signed-off-by: James Bottomley
28 Jul, 2006
1 commit
-
HAL and friends have a tendency to trigger this one all the time.
It's not really interesting, so kill it. The vendor kernels all do
anyways.Signed-off-by: Jens Axboe
11 Jun, 2006
1 commit
-
With Achim patch the last user (gdth) is switched away from scsi_request
so we an kill it now. Also disables some code in i2o_scsi that was
broken since the sg driver stopped using scsi_requests.Signed-off-by: Christoph Hellwig
Signed-off-by: James Bottomley
13 Apr, 2006
1 commit
-
We currently have two implementations of this obsolete ioctl, one in
the block layer and one in the scsi code. Both of them have drawbacks.This patch kills the scsi layer version after updating the block version
with the missing bits:- argument checking
- use scatterlist I/O
- set number of retries based on the submitted commandThis is the last user of non-S/G I/O except for the gdth driver, so
getting this in ASAP and through the scsi tree would be nie to kill
the non-S/G I/O path. Jens, what do you think about adding a check
for non-S/G I/O in the midlayer?Thanks to Or Gerlitz for testing this patch.
Signed-off-by: Christoph Hellwig
Signed-off-by: James Bottomley
28 Feb, 2006
1 commit
-
Change the core SCSI code to use kzalloc rather than kmalloc+memset
where possible.Signed-off-by: Jes Sorensen
Signed-off-by: James Bottomley
29 Oct, 2005
2 commits
-
This patch attempts to fix an issue found in drivers/scsi/scsi_ioctl.c by Coverity.
Error reported:
CID: 3437
Checker: FORWARD_NULL (help)
File: /export2/p4-coverity/mc2/linux26/drivers/scsi/scsi_ioctl.c
Function: scsi_ioctl_send_command
Description: Variable "buf" tracked as NULL was passed to a function that dereferences it.Patch description:
buf can be NULL if inlen and outlen are both 0. This patch adds check if the
length is non-zero before calling copy from/to user.Signed-off-by: Jayachandran C.
Signed-off-by: James Bottomley -
This should eliminate (at least in the mid layer) to make numeric
assumptions about any of the enumeration variables. As a side effect,
it will also make all the messages consistent and line us up nicely for
the error logging strategy (if it ever shows itself again).Signed-off-by: James Bottomley
28 Oct, 2005
1 commit
-
Signed-off-by: Al Viro
Signed-off-by: Linus Torvalds
19 Sep, 2005
1 commit
-
We fix the oops by enforcing the host state model. There have also
been two extra states added: SHOST_CANCEL_RECOVERY and
SHOST_DEL_RECOVERY so we can take the model through host removal while
the recovery thread is active.Signed-off-by: James Bottomley
07 Sep, 2005
2 commits
-
This returns always false with new-style drivers right now. Make it
return always true instead, as a host must be present if we are able
to call the ioctl (without a host attached there would be no device
node to call on..)Signed-off-by: James Bottomley
29 Aug, 2005
2 commits
-
This one removes struct scsi_request entirely from sd. In the process,
I noticed we have no callers of scsi_wait_req who don't immediately
normalise the sense, so I updated the API to make it take a struct
scsi_sense_hdr instead of simply a big sense buffer.Signed-off-by: James Bottomley
-
After this, we just have some drivers, all the ULDs and the SPI
transport class using scsi_wait_req().Signed-off-by: James Bottomley
31 Jul, 2005
1 commit
-
Migrate the current SCSI host state model to a model like SCSI
device is using.Signed-off-by: Mike Anderson
Rejections fixed up and
Signed-off-by: James Bottomley
19 Apr, 2005
1 commit
-
Adapted from a patch in SuSE's kernel SRPM.
Signed-off-by: James Bottomley
17 Apr, 2005
1 commit
-
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.Let it rip!