1. 02 3月, 2022 3 次提交
  2. 23 2月, 2022 1 次提交
  3. 22 1月, 2022 1 次提交
    • X
      scsi/sg: move sg-big-buff sysctl to scsi/sg.c · 26d1c80f
      Xiaoming Ni 提交于
      kernel/sysctl.c is a kitchen sink where everyone leaves their dirty
      dishes, this makes it very difficult to maintain.
      
      To help with this maintenance let's start by moving sysctls to places
      where they actually belong.  The proc sysctl maintainers do not want to
      know what sysctl knobs you wish to add for your own piece of code, we
      just care about the core logic.
      
      So move the sg-big-buff sysctl from kernel/sysctl.c to drivers/scsi/sg.c
      and use register_sysctl() to register the sysctl interface.
      
      [mcgrof@kernel.org: commit log update]
      
      Link: https://lkml.kernel.org/r/20211124231435.1445213-7-mcgrof@kernel.orgSigned-off-by: NXiaoming Ni <nixiaoming@huawei.com>
      Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Amir Goldstein <amir73il@gmail.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: James E.J. Bottomley <jejb@linux.ibm.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: John Ogness <john.ogness@linutronix.de>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Julia Lawall <julia.lawall@inria.fr>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Lukas Middendorf <kernel@tuxforce.de>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Phillip Potter <phil@philpotter.co.uk>
      Cc: Qing Wang <wangqing@vivo.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Sebastian Reichel <sre@kernel.org>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Stephen Kitt <steve@sk2.org>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26d1c80f
  4. 29 11月, 2021 2 次提交
  5. 29 10月, 2021 1 次提交
  6. 22 10月, 2021 1 次提交
  7. 18 10月, 2021 1 次提交
  8. 25 8月, 2021 1 次提交
  9. 24 8月, 2021 1 次提交
  10. 29 7月, 2021 5 次提交
  11. 01 7月, 2021 1 次提交
  12. 01 6月, 2021 2 次提交
  13. 06 4月, 2021 1 次提交
  14. 05 3月, 2021 1 次提交
  15. 25 1月, 2021 1 次提交
  16. 03 10月, 2020 1 次提交
  17. 15 4月, 2020 1 次提交
  18. 14 4月, 2020 1 次提交
  19. 04 2月, 2020 1 次提交
  20. 03 1月, 2020 2 次提交
    • A
      compat_ioctl: scsi: move ioctl handling into drivers · d320a955
      Arnd Bergmann 提交于
      Each driver calling scsi_ioctl() gets an equivalent compat_ioctl()
      handler that implements the same commands by calling scsi_compat_ioctl().
      
      The scsi_cmd_ioctl() and scsi_cmd_blk_ioctl() functions are compatible
      at this point, so any driver that calls those can do so for both native
      and compat mode, with the argument passed through compat_ptr().
      
      With this, we can remove the entries from fs/compat_ioctl.c.  The new
      code is larger, but should be easier to maintain and keep updated with
      newly added commands.
      Reviewed-by: NBen Hutchings <ben.hutchings@codethink.co.uk>
      Acked-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      d320a955
    • A
      compat: scsi: sg: fix v3 compat read/write interface · 78ed001d
      Arnd Bergmann 提交于
      In the v5.4 merge window, a cleanup patch from Al Viro conflicted
      with my rework of the compat handling for sg.c read(). Linus Torvalds
      did a correct merge but pointed out that the resulting code is still
      unsatisfactory.
      
      I later noticed that the sg_new_read() function still gets the compat
      mode wrong, when the 'count' argument is large enough to pass a
      compat_sg_io_hdr object, but not a nativ sg_io_hdr.
      
      To address both of these, move the definition of compat_sg_io_hdr
      into a scsi/sg.h to make it visible to sg.c and rewrite the logic
      for reading req_pack_id as well as the size check to a simpler
      version that gets the expected results.
      
      Fixes: c35a5cfb ("scsi: sg: sg_read(): simplify reading ->pack_id of userland sg_io_hdr_t")
      Fixes: 98aaaec4 ("compat_ioctl: reimplement SG_IO handling")
      Reviewed-by: NBen Hutchings <ben.hutchings@codethink.co.uk>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      78ed001d
  21. 06 11月, 2019 8 次提交
  22. 23 10月, 2019 2 次提交
    • A
      compat_ioctl: move SG_GET_REQUEST_TABLE handling · fd6c3d5a
      Arnd Bergmann 提交于
      SG_GET_REQUEST_TABLE is now the last ioctl command that needs a conversion
      handler. This is only used in a single file, so the implementation should
      be there.
      
      I'm trying to simplify it in the process, to get rid of
      the compat_alloc_user_space() and extra copy, by adding a
      put_compat_request_table() function instead, which copies the data in
      the right format to user space.
      
      Cc: linux-scsi@vger.kernel.org
      Cc: Doug Gilbert <dgilbert@interlog.com>
      Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      fd6c3d5a
    • A
      compat_ioctl: reimplement SG_IO handling · 98aaaec4
      Arnd Bergmann 提交于
      There are two code locations that implement the SG_IO ioctl: the old
      sg.c driver, and the generic scsi_ioctl helper that is in turn used by
      multiple drivers.
      
      To eradicate the old compat_ioctl conversion handler for the SG_IO
      command, I implement a readable pair of put_sg_io_hdr() /get_sg_io_hdr()
      helper functions that can be used for both compat and native mode,
      and then I call this from both drivers.
      
      For the iovec handling, there is already a compat_import_iovec() function
      that can simply be called in place of import_iovec().
      
      To avoid having to pass the compat/native state through multiple
      indirections, I mark the SG_IO command itself as compatible in
      fs/compat_ioctl.c and use in_compat_syscall() to figure out where
      we are called from.
      
      As a side-effect of this, the sg.c driver now also accepts the 32-bit
      sg_io_hdr format in compat mode using the read/write interface, not
      just ioctl. This should improve compatiblity with old 32-bit binaries,
      but it would break if any application intentionally passes the 64-bit
      data structure in compat mode here.
      
      Steffen Maier helped debug an issue in an earlier version of this patch.
      
      Cc: Steffen Maier <maier@linux.ibm.com>
      Cc: linux-scsi@vger.kernel.org
      Cc: Doug Gilbert <dgilbert@interlog.com>
      Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      98aaaec4
  23. 24 5月, 2019 1 次提交