1. 21 Jul, 2023 1 commit
    • Gleb Chesnokov's avatar
      qla2x00t-32gbit: Silence a static checker warning · 1d37f637
      Gleb Chesnokov authored
      
      Smatch and Clang both complain that LOGIN_TEMPLATE_SIZE is more than
      sizeof(ha->plogi_els_payld.fl_csp).
      
      Smatch warning:
          drivers/scsi/qla2xxx/qla_iocb.c:3075 qla24xx_els_dcmd2_iocb()
          warn: '&ha->plogi_els_payld.fl_csp' sometimes too small '16' size = 112
      
      Clang warning:
          include/linux/fortify-string.h:592:4: error: call to
          '__read_overflow2_field' declared with 'warning' attribute: detected
          read beyond size of field (2nd parameter); maybe use struct_group()?
          [-Werror,-Wattribute-warning]
                              __read_overflow2_field(q_size_field, size);
      
      When I was reading this code I assumed the "- 4" meant that we were
      skipping the last 4 bytes but actually it turned out that we are
      skipping the first four bytes.
      
      I have re-written it remove the magic numbers, be more clear and
      silence the static checker warnings.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Link: https://lore.kernel.org/r/4aa0485e-766f-4b02-8d5d-c6781ea8f511@moroto.mountain
      
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      [ commit 134f66959cd0b upstream ]
      1d37f637
  2. 19 Jul, 2023 23 commits
  3. 10 Jul, 2023 8 commits
    • Gleb Chesnokov's avatar
      iscsi-scst: Port to Linux kernel v6.5 · 16a17c25
      Gleb Chesnokov authored
      Use sendmsg() conditionally with MSG_SPLICE_PAGES in write_data()
      rather than calling sendpage().
      
      Support for the following net layer changes in the Linux kernel v6.5:
      
      - dc97391e6610 ("sock: Remove ->sendpage*() in favour of
        sendmsg(MSG_SPLICE_PAGES)")
      16a17c25
    • Gleb Chesnokov's avatar
      iscsi-scst: Refactor sendpage functionality in write_data() · 324bf62e
      Gleb Chesnokov authored
      This patch carries out a refactoring of the sendpage functionality in
      the write_data() function:
      
      1. Reorganize the logic used to select the sock_sendpage function.
      2. Streamline the data sending loop by reducing conditional branches and
         eliminating labels.
      3. Adjust the error handling for -EINTR and -EAGAIN to make the code
         cleaner and easier to follow.
      
      This patch doesn't change any functionality.
      324bf62e
    • Gleb Chesnokov's avatar
      iscsi-scst: Improve 'write iop loop' in write_data() · c1f7510d
      Gleb Chesnokov authored
      This patch introduces several improvements to the 'write iop loop' in
      the write_data() function:
      
      1. Move iop-related variables under the scope of the 'write iop loop'.
      2. Eliminate the 'retry' label, use 'continue' instead for simplicity.
      3. Remove the redundant 'rest' variable, use just 'res' instead.
      
      This patch doesn't change any functionality.
      c1f7510d
    • Gleb Chesnokov's avatar
      iscsi-scst: Improve write_data() · b5294cbf
      Gleb Chesnokov authored
      This patch introduces several improvements to the write_data() function:
      
      1. Remove the redundant 'sendpage' function pointer variable.
      2. Update variables related to size to use the size_t type for better
         type correctness and safety.
      3. Introduce a new variable, 'parent_req', to store the
         'write_cmnd->parent_req' pointer and reduce redundant accesses.
      4. Fix several checkpatch warnings.
      
      This patch doesn't change any functionality.
      b5294cbf
    • Gleb Chesnokov's avatar
      scst_user: Port to Linux kernel v6.5 · a62b094f
      Gleb Chesnokov authored
      Support for the following mm layer changes in the Linux kernel v6.5:
      
      - 54d020692b34 ("mm/gup: remove unused vmas parameter from
        get_user_pages()")
      a62b094f
    • Gleb Chesnokov's avatar
      scst_tape: Port to Linux kernel v6.5 · 7a1ea234
      Gleb Chesnokov authored
      Support for the following scsi core changes in the Linux kernel v6.5:
      
      - a6cdc35fab0d ("scsi: core: Support retrieving sub-pages of mode
        pages")
      7a1ea234
    • Gleb Chesnokov's avatar
      scst: Port to Linux kernel v6.5 · 76750f33
      Gleb Chesnokov authored
      Support for the following block layer changes in the Linux kernel v6.5:
      
      - 05bdb9965305 ("block: replace fmode_t with a block-specific type for
        block open flags")
      - 0718afd47f70 ("block: introduce holder ops")
      - 2736e8eeb0cc ("block: use the holder as indication for exclusive opens")
      76750f33
    • Gleb Chesnokov's avatar
      scst_vdisk: Open block devices exclusively · 5c14b16f
      Gleb Chesnokov authored
      Enable exclusive opening of block devices to prevent concurrent usage.
      
      Additionally, remove the redundant 'holder' argument for
      'blkdev_get_by_path()' where exclusive opening isn't utilized.
      5c14b16f
  4. 30 Jun, 2023 2 commits
    • Gleb Chesnokov's avatar
      scst_targ: Check prepare_to_wait_exclusive_head() return value · 86d5b218
      Gleb Chesnokov authored
      The prepare_to_wait_exclusive_head() function was modified in
      commit d8894cbd ("scst.h: Refactor wait_event_locked() to enhance
      usability and clarity"). It now returns an error if the current
      interruptible thread has pending signals.
      
      This patch introduces the scst_wait_for_cmd() helper function for the
      scst_cmd_thread(). This new function handles the return value of the
      prepare_to_wait_exclusive_head() appropriately.
      
      This patch fixes the following Coverity complaint:
      
          CID 321410 (#1 of 1): Unchecked return value (CHECKED_RETURN)
          check_return: Calling prepare_to_wait_exclusive_head without
          checking return value.
      86d5b218
    • Gleb Chesnokov's avatar
      scst_user: Simplify signal pending check · 057224f6
      Gleb Chesnokov authored
      The scst_wait_event_interruptible_lock_irq() function now implicitly
      checks for pending signals. Therefore, there is no need to check for
      these signals explicitly. This patch replaces the explicit check with a
      simple evaluation of the function's return value.
      
      This patch doesn't change any functionality.
      057224f6
  5. 28 Jun, 2023 1 commit
  6. 27 Jun, 2023 2 commits
  7. 20 Jun, 2023 3 commits
    • Gleb Chesnokov's avatar
      scst_lib: Make __scst_ext_blocking_done() static · be1574d8
      Gleb Chesnokov authored
      Since __scst_ext_blocking_done() is only called from inside scst_lib.c,
      declare that function static.
      
      This patch doesn't change any functionality.
      be1574d8
    • Gleb Chesnokov's avatar
      scst_lib: Enable scst_sync_ext_block_dev() to handle signals · 2c5c12c0
      Gleb Chesnokov authored
      This patch modifies scst_sync_ext_block_dev() to support INTERRUPTIBLE
      waiting and handle signal-induced waiting cancellation. To achieve this,
      the waitqueue head is moved from the stack and allocated with the blocker.
      Additionally, reference counting and its management are added to the
      blocker to handle memory freeing from multiple contexts.
      
      Fixes: https://github.com/SCST-project/scst/issues/164
      2c5c12c0
    • Gleb Chesnokov's avatar
      scst_lib: Split scst_ext_block_dev() for clarity and easier maintenance · b13b580d
      Gleb Chesnokov authored
      This patch divides the scst_ext_block_dev() function into two separate
      functions to improve code readability and simplify maintenance:
      
      1. scst_sync_ext_block_dev() - This function is for synchronous blocking
         and serves as the equivalent of calling the old scst_ext_block_dev()
         function with the SCST_EXT_BLOCK_SYNC flag.
      
      2. scst_ext_block_dev() - This function is for asynchronous blocking.
      
      Additionally, the patch introduces the helper function
      scst_dev_ext_block() to reduce code duplication between the
      scst_sync_ext_block_dev() and scst_ext_block_dev() functions.
      
      This patch doesn't change any functionality.
      b13b580d