1. 30 Oct, 2020 3 commits
    • Arnd Bergmann's avatar
      scsi: libfc: Fix enum-conversion warning · 3fb52041
      Arnd Bergmann authored
      gcc -Wextra points out an assignment between two different enum types:
      
      drivers/scsi/libfc/fc_exch.c: In function 'fc_exch_setup_hdr':
      ../drivers/scsi/libfc/fc_exch.c:275:26: warning: implicit conversion from 'enum fc_class' to 'enum fc_sof' [-Wenum-conversion]
      
      This seems to be intentional, as the same numeric values are used here, so
      shut up the warning by adding an explicit cast.
      
      Link: https://lore.kernel.org/r/20201026214911.3892701-1-arnd@kernel.org
      Fixes: 42e9a92f ("[SCSI] libfc: A modular Fibre Channel library")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      3fb52041
    • Arnd Bergmann's avatar
      scsi: libfc: Work around -Warray-bounds warning · 8fd9efca
      Arnd Bergmann authored
      Building libfc with gcc -Warray-bounds identifies a number of cases in one
      file where a strncpy() is performed into a single-byte character array:
      
      In file included from include/linux/bitmap.h:9,
                       from include/linux/cpumask.h:12,
                       from include/linux/smp.h:13,
                       from include/linux/lockdep.h:14,
                       from include/linux/spinlock.h:59,
                       from include/linux/debugobjects.h:6,
                       from include/linux/timer.h:8,
                       from include/scsi/libfc.h:11,
                       from drivers/scsi/libfc/fc_elsct.c:17:
      In function 'strncpy',
          inlined from 'fc_ct_ms_fill.constprop' at drivers/scsi/libfc/fc_encode.h:235:3:
      include/linux/string.h:290:30: warning: '__builtin_strncpy' offset [56, 135] from the object at 'pp' is out of the bounds of referenced subobject 'value' with type '__u8[1]' {aka 'unsigned char[1]'} at offset 56 [-Warray-bounds]
        290 | #define __underlying_strncpy __builtin_strncpy
            |                              ^
      include/linux/string.h:300:9: note: in expansion of macro '__underlying_strncpy'
        300 |  return __underlying_strncpy(p, q, size);
            |         ^~~~~~~~~~~~~~~~~~~~
      
      This is not a bug because the 1-byte array is used as an odd way to express
      a variable-length data field here. I tried to convert it to a
      flexible-array member, but in the end could not figure out why the
      sizeof(struct fc_fdmi_???) are used the way they are, and how to properly
      convert those.
      
      Work around this instead by abstracting the string copy in a slightly
      higher-level function fc_ct_hdr_fill() helper that strscpy() and memset()
      to achieve the same result as strncpy() but does not require a
      zero-terminated input and does not get checked for the array overflow
      because gcc (so far) does not understand the behavior of strscpy().
      
      Link: https://lore.kernel.org/r/20201026160705.3706396-2-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      8fd9efca
    • Arnd Bergmann's avatar
      scsi: libfc: Move scsi/fc_encode.h to libfc · e31ac898
      Arnd Bergmann authored
      Most of this file is only used inside of libfc, so move it to where it is
      actually used, with only fc_fill_fc_hdr() left inside of the header.
      
      Link: https://lore.kernel.org/r/20201026160705.3706396-1-arnd@kernel.orgReported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      e31ac898
  2. 27 Oct, 2020 10 commits
  3. 26 Oct, 2020 8 commits
  4. 25 Oct, 2020 17 commits
  5. 24 Oct, 2020 2 commits
    • Linus Torvalds's avatar
      Merge tag 'block-5.10-2020-10-24' of git://git.kernel.dk/linux-block · d7691390
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request from Christoph
           - rdma error handling fixes (Chao Leng)
           - fc error handling and reconnect fixes (James Smart)
           - fix the qid displace when tracing ioctl command (Keith Busch)
           - don't use BLK_MQ_REQ_NOWAIT for passthru (Chaitanya Kulkarni)
           - fix MTDT for passthru (Logan Gunthorpe)
           - blacklist Write Same on more devices (Kai-Heng Feng)
           - fix an uninitialized work struct (zhenwei pi)"
      
       - lightnvm out-of-bounds fix (Colin)
      
       - SG allocation leak fix (Doug)
      
       - rnbd fixes (Gioh, Guoqing, Jack)
      
       - zone error translation fixes (Keith)
      
       - kerneldoc markup fix (Mauro)
      
       - zram lockdep fix (Peter)
      
       - Kill unused io_context members (Yufen)
      
       - NUMA memory allocation cleanup (Xianting)
      
       - NBD config wakeup fix (Xiubo)
      
      * tag 'block-5.10-2020-10-24' of git://git.kernel.dk/linux-block: (27 commits)
        block: blk-mq: fix a kernel-doc markup
        nvme-fc: shorten reconnect delay if possible for FC
        nvme-fc: wait for queues to freeze before calling update_hr_hw_queues
        nvme-fc: fix error loop in create_hw_io_queues
        nvme-fc: fix io timeout to abort I/O
        null_blk: use zone status for max active/open
        nvmet: don't use BLK_MQ_REQ_NOWAIT for passthru
        nvmet: cleanup nvmet_passthru_map_sg()
        nvmet: limit passthru MTDS by BIO_MAX_PAGES
        nvmet: fix uninitialized work for zero kato
        nvme-pci: disable Write Zeroes on Sandisk Skyhawk
        nvme: use queuedata for nvme_req_qid
        nvme-rdma: fix crash due to incorrect cqe
        nvme-rdma: fix crash when connect rejected
        block: remove unused members for io_context
        blk-mq: remove the calling of local_memory_node()
        zram: Fix __zram_bvec_{read,write}() locking order
        skd_main: remove unused including <linux/version.h>
        sgl_alloc_order: fix memory leak
        lightnvm: fix out-of-bounds write to array devices->info[]
        ...
      d7691390
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.10-2020-10-24' of git://git.kernel.dk/linux-block · af004187
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
      
       - fsize was missed in previous unification of work flags
      
       - Few fixes cleaning up the flags unification creds cases (Pavel)
      
       - Fix NUMA affinities for completely unplugged/replugged node for io-wq
      
       - Two fallout fixes from the set_fs changes. One local to io_uring, one
         for the splice entry point that io_uring uses.
      
       - Linked timeout fixes (Pavel)
      
       - Removal of ->flush() ->files work-around that we don't need anymore
         with referenced files (Pavel)
      
       - Various cleanups (Pavel)
      
      * tag 'io_uring-5.10-2020-10-24' of git://git.kernel.dk/linux-block:
        splice: change exported internal do_splice() helper to take kernel offset
        io_uring: make loop_rw_iter() use original user supplied pointers
        io_uring: remove req cancel in ->flush()
        io-wq: re-set NUMA node affinities if CPUs come online
        io_uring: don't reuse linked_timeout
        io_uring: unify fsize with def->work_flags
        io_uring: fix racy REQ_F_LINK_TIMEOUT clearing
        io_uring: do poll's hash_node init in common code
        io_uring: inline io_poll_task_handler()
        io_uring: remove extra ->file check in poll prep
        io_uring: make cached_cq_overflow non atomic_t
        io_uring: inline io_fail_links()
        io_uring: kill ref get/drop in personality init
        io_uring: flags-based creds init in queue
      af004187