1. 19 Jul, 2023 2 commits
  2. 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
  3. 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
  4. 28 Jun, 2023 1 commit
  5. 27 Jun, 2023 2 commits
  6. 20 Jun, 2023 5 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
    • Gleb Chesnokov's avatar
      scst.h: Refactor wait_event_locked() to enhance usability and clarity · d8894cbd
      Gleb Chesnokov authored
      1. Set the default process state to TASK_UNINTERRUPTIBLE during sleep.
         This change is made because our current code does not check whether a
         process was interrupted by a signal.
      
      2. Prefix all SCST wait_event-related macros with 'scst_'. This helps to
         distinguish SCST-specific macros from those provided by the Linux
         kernel itself.
      
      3. Add the capability to return an error code when a process in a
         non-TASK_UNINTERRUPTIBLE state is interrupted by a signal.
      
      4. Divide the wait_event_locked function based on each lock type,
         resulting in the following new functions: scst_wait_event_lock(),
         scst_wait_event_lock_bh(), and scst_wait_event_lock_irq().
      d8894cbd
    • Gleb Chesnokov's avatar
      scst.h: Unify names in prepare_to_wait_exclusive_head() · 334d29c9
      Gleb Chesnokov authored
      Use the standardized version of the name for wait_queue_head and
      wait_queue_entry variables.
      
      This patch doesn't change any functionality.
      334d29c9
  7. 16 Jun, 2023 1 commit
    • Gleb Chesnokov's avatar
      scst: Unbreak the non-DLM build · 7881162b
      Gleb Chesnokov authored
      Fix the following compiler error:
      
          ERROR: modpost: "scst_dlm_cluster_name" [...] undefined!
      
      The error occurs because the declaration of scst_dlm_cluster_name is
      located in the scst_dlm.c file, but it's used in the scst_sysfs.c file.
      As a result, when building without DLM, this variable lacks a declaration.
      
      To resolve this, the declaration is moved to the scst_main.c file, and the
      variable scst_dlm_cluster_name is renamed to scst_cluster_name.
      
      Fixes: 00f31004 ("scst_sysfs: Add support for cluster_name")
      7881162b
  8. 14 Jun, 2023 3 commits
    • Gleb Chesnokov's avatar
      scst/src/Makefile: Fix depmod warnings during installation process · a6e09670
      Gleb Chesnokov authored
      This patch fixes the following warnings:
      
        /lib/.../scst_cdrom.ko needs unknown symbol scst_obtain_device_parameters
        /lib/.../scst_cdrom.ko needs unknown symbol scst_unregister_dev_driver
        ...
      
      These warnings were caused by an incorrect module installation order:
      the SCST module was being installed after the device handler modules
      on which they depend. This patch rectifies the issue by altering the
      order in which the modules are installed.
      
      Additionally, this patch fixes the missing signatures for the device
      handler modules.
      a6e09670
    • Gleb Chesnokov's avatar
      Makefile: Specify the installation directory for SCST modules explicitly · 6c2771ba
      Gleb Chesnokov authored
      This patch fixes the installation process for Linux kernels where the
      default value of INSTALL_MOD_DIR differs from `extra`.
      
      For instance, it unbreaks `make rpm` against Fedora's kernels, where
      INSTALL_MOD_DIR is set to `updates`.
      6c2771ba
    • Gleb Chesnokov's avatar
      Makefile: Implement several improvements to SCST Makefiles · 85e8086a
      Gleb Chesnokov authored
      1. Correct a typo, changing `make release` to `make 2release`.
      2. Add information about package-related targets to the help section.
      3. Remove `dev_handler` directory during the uninstall process.
      4. Eliminate the non-existent `tgt` target from the PHONY targets.
      5. Introduce SCST_MOD_DIR and SCST_DH_MOD_DIR as helper variables.
      85e8086a
  9. 13 Jun, 2023 1 commit
  10. 09 Jun, 2023 1 commit
  11. 05 Jun, 2023 4 commits
  12. 10 May, 2023 3 commits
    • Gleb Chesnokov's avatar
      scst: Remove support for RHEL5/6 · 68461f58
      Gleb Chesnokov authored
      The SCST has dropped support for RHEL5/6 since v3.6.
      68461f58
    • Brian Meagher's avatar
      scst_pres,scst_dlm: Fix broken UNIT ATTENTION for remote PR registrants · 92db6a9f
      Brian Meagher authored
      Previously, when scst_pr_send_ua_reg attempted to deliver a UNIT ATTENTION
      to a registrant that was on another node in a dlm-based HA cluster, the
      unit attention was dropped.
      
      Rectify by adding a pr_reg_queue_rem_ua function to struct scst_cl_ops and
      calling it from scst_pr_send_ua_reg.
      
      Each registrant will maintain an incoming 'queue' of unit attentions by
      adding next_rem_ua_idx to the registrant data maintained in the DLM.  This
      will tell the other nodes which PR_REG_UA_LOCK lock to create in the
      lockspace in order to 'send' a unit attention to the registrant.
      
      Further, each node will also maintain two lists (pending and sent) for the
      outgoing unit attentions from this node to a registrant.  When the
      recipient has read all the sent unit attentions (and cleared
      next_rem_ua_idx), then the sent list may be cleared.
      92db6a9f
    • Brian Meagher's avatar
      scsi-scstd: Check initiator name provided during login · e34a4e09
      Brian Meagher authored
      The iSCSI specification has rules wrt what constitutes  a valid initiator
      name.  Perform some checks and reject LOGINs with an invalid initiator
      name.
      e34a4e09
  13. 02 May, 2023 1 commit
    • Gleb Chesnokov's avatar
      scst: Unbreak the build for kernel versions <= 6.3 · 3dad1e95
      Gleb Chesnokov authored
      The previous series of patches introduced the use of a const pointer to
      scsi_host_template. However, scsi_host_alloc() uses a non-const pointer
      prior to kernel version 6.4, causing the build to throw the following
      error:
      
          passing argument 1 of ‘scsi_host_alloc’ discards ‘const’
          qualifier from pointer target type
      
      Hence, cast away the constness to resolve the error.
      3dad1e95
  14. 28 Apr, 2023 6 commits