- 19 Jul, 2023 2 commits
-
-
Gleb Chesnokov authored
This was detected by smatch.
-
Gleb Chesnokov authored
strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NULL-terminated [1]. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
-
- 10 Jul, 2023 8 commits
-
-
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)")
-
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.
-
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.
-
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.
-
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()")
-
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")
-
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")
-
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.
-
- 30 Jun, 2023 2 commits
-
-
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.
-
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.
-
- 28 Jun, 2023 1 commit
-
-
Gleb Chesnokov authored
This patch replaces percpu_ref_kill() with percpu_ref_kill_and_confirm() to guarantee safe usage of references in atomic mode immediately afterwards. This change ensures accurate checking of active commands following the initial reference killing. Reported-by:
Lev Vainblat <lev@zadarastorage.com>
-
- 27 Jun, 2023 2 commits
-
-
Gleb Chesnokov authored
This patch changes the processing threads to use INTERRUPTIBLE sleep states in the scst_wait_event_...() functions. This aims to avoid warnings from the hung task detection checker and to prevent unnecessary load counting. Fixes: d8894cbd ("scst.h: Refactor wait_event_locked() to enhance usability and clarity")
-
Gleb Chesnokov authored
Another kernel versions update following the 6.4 release.
-
- 20 Jun, 2023 5 commits
-
-
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.
-
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
-
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.
-
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().
-
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.
-
- 16 Jun, 2023 1 commit
-
-
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")
-
- 14 Jun, 2023 3 commits
-
-
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.
-
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`.
-
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.
-
- 13 Jun, 2023 1 commit
-
-
Gleb Chesnokov authored
Fixes: https://github.com/SCST-project/scst/issues/167
-
- 09 Jun, 2023 1 commit
-
-
Gleb Chesnokov authored
Fixes: https://github.com/SCST-project/scst/issues/167
-
- 05 Jun, 2023 4 commits
-
-
Gleb Chesnokov authored
The scstadmin.spec.in file contained a custom Requires line that generated dependencies based on the full paths of the killall and rm commands. This approach is unconventional and could cause issues with dependency resolution. This patch replaces the custom Requires line with the package names providing the required commands, namely 'psmisc' for killall and 'coreutils' for rm. This change ensures proper dependency resolution and adheres to recommended practices for specifying dependencies in spec files. Fixes: https://github.com/SCST-project/scst/issues/152
-
Gleb Chesnokov authored
When target mode is enabled, the pci_irq_get_affinity() function may return a NULL value in qla_mapq_init_qp_cpu_map() due to the qla24xx_enable_msix() code that handles IRQ settings for target mode. This leads to a crash due to a NULL pointer dereference. This patch fixes the issue by adding a check for the NULL value returned by pci_irq_get_affinity() and introducing a 'cpu_mapped' boolean flag to the qla_qpair structure, ensuring that the qpair's CPU affinity is updated when it has not been mapped to a CPU. Fixes: 1d201c81d4cc ("scsi: qla2xxx: Select qpair depending on which CPU post_cmd() gets called") Signed-off-by:
Gleb Chesnokov <gleb.chesnokov@scst.dev> Link: https://lore.kernel.org/r/56b416f2-4e0f-b6cf-d6d5-b7c372e3c6a2@scst.dev Reviewed-by:
Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com> [ commit d54820b22e40 upstream ] Fixes: https://github.com/SCST-project/scst/issues/156
-
Gleb Chesnokov authored
Backport the change from a previous commit to kernel versions prior to v6.0, where commit f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native") hasn't been introduced.
-
Gleb Chesnokov authored
pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since commit f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by:
Bjorn Helgaas <bhelgaas@google.com> Link: https://lore.kernel.org/r/20230307182842.870378-10-helgaas@kernel.org Cc: Nilesh Javali <njavali@marvell.com> Cc: GR-QLogic-Storage-Upstream@marvell.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com> [ commit c5c440bbff86 upstream ]
-
- 10 May, 2023 3 commits
-
-
Gleb Chesnokov authored
The SCST has dropped support for RHEL5/6 since v3.6.
-
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.
-
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.
-
- 02 May, 2023 1 commit
-
-
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.
-
- 28 Apr, 2023 6 commits
-
-
Gleb Chesnokov authored
Add an error variable to track errors during the loop in checkpatch_pull.yml, allowing the workflow to run checkpatch for all commits before exiting with the appropriate status. Additionally, add COMMIT_LOG_USE_LINK to the ignore list for both pull and push workflows
-
Gleb Chesnokov authored
Make it explicit that the SCSI host template is not modified.
-
Gleb Chesnokov authored
Make it explicit that the SCSI host template is not modified.
-
Gleb Chesnokov authored
Make it explicit that the SCSI host template is not modified. Signed-off-by:
Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230322195515.1267197-68-bvanassche@acm.org Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com> [ commit 421c20b7668e upstream ]
-
Gleb Chesnokov authored
Access the qla2xxx_driver_template data structure directly instead of via the host pointer. This patch prepares for declaring the 'hostt' pointer const. Cc: Nilesh Javali <njavali@marvell.com> Signed-off-by:
Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230322195515.1267197-2-bvanassche@acm.org Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com> [ commit a07be936d923 upstream ]
-
Gleb Chesnokov authored
Support for the following driver core changes in the Linux kernel v6.4: - 1aaba11da9aa ("driver core: class: remove module * from class_create()") - 2243acd50ac4 ("driver core: class: remove struct class_interface * from callbacks")
-