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

    Gustavo A. R. Silva
     

26 Apr, 2020

1 commit


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

    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 file

    These 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

    Thomas Gleixner
     

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

    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

    Johannes Thumshirn
     

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

    Bart Van Assche
     

23 Feb, 2017

1 commit


25 Dec, 2016

1 commit


12 Nov, 2014

5 commits

  • Signed-off-by: Christoph Hellwig
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke

    Christoph Hellwig
     
  • 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

    Christoph Hellwig
     
  • 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

    Christoph Hellwig
     
  • 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

    Hannes Reinecke
     
  • 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

    Douglas Gilbert
     

18 Jul, 2014

1 commit


05 Dec, 2009

1 commit


03 Jan, 2009

1 commit


30 Dec, 2008

2 commits


21 Oct, 2008

2 commits


12 Jan, 2008

2 commits


28 Jul, 2006

1 commit


11 Jun, 2006

1 commit


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 command

    This 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

    Christoph Hellwig
     

28 Feb, 2006

1 commit


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

    Jayachandran C
     
  • 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

    James Bottomley
     

28 Oct, 2005

1 commit


19 Sep, 2005

1 commit


07 Sep, 2005

2 commits


29 Aug, 2005

2 commits


31 Jul, 2005

1 commit


19 Apr, 2005

1 commit


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!

    Linus Torvalds