1. 10 Oct, 2023 22 commits
  2. 09 Oct, 2023 1 commit
  3. 21 Sep, 2023 1 commit
  4. 22 Aug, 2023 1 commit
  5. 21 Jul, 2023 6 commits
    • Gleb Chesnokov's avatar
      scst_lib: Improve scst_put_acg() · c00af8aa
      Gleb Chesnokov authored
      This patch refactors scst_put_acg() to directly call kref_put() with a
      release callback that handles removal of scst_acg from the workqueue.
      This replaces the previous approach of queuing a work item for each
      kref_put() call, improving efficiency by reducing the number of queued
      work items.
      c00af8aa
    • Gleb Chesnokov's avatar
      scst: Do not use WQ_MEM_RECLAIM flag for workqueues · 4b840aee
      Gleb Chesnokov authored
      According to kernel documentation, this flag should be set if the
      workqueue will be involved in the kernel's memory reclamation flow.
      Since it is not, there is no need for the driver's WQ to have this
      flag set so remove it.
      4b840aee
    • Gleb Chesnokov's avatar
      scst: Fix removal of deprecated create_workqueue() · 1f0ce86f
      Gleb Chesnokov authored
      create_workqueue() was replaced with alloc_workqueue() with max_active set
      to 0. However, the original create_workqueue() implicitly set max_active
      to 1.
      
      This change has led to unexpected bugs because previously, work items
      could only be executed one by one. With the change, they can now be
      executed simultaneously.
      
      This patch fixes the issue by restoring max_active to 1.
      
      Fixes: f4686e91 ("scst: Remove deprecated create_workqueue()")
      Fixes: https://github.com/SCST-project/scst/issues/179
      1f0ce86f
    • Gleb Chesnokov's avatar
      scst: Use vmalloc_array() and vcalloc() · 87235dfe
      Gleb Chesnokov authored
      Use vmalloc_array() and vcalloc() to protect against multiplication
      overflows.
      
      The changes were done using the following Coccinelle
      semantic patch:
      
      // <smpl>
      @initialize:ocaml@
      @@
      
      let rename alloc =
        match alloc with
          "vmalloc" -> "vmalloc_array"
        | "vzalloc" -> "vcalloc"
        | _ -> failwith "unknown"
      
      @@
          size_t e1,e2;
          constant C1, C2;
          expression E1, E2, COUNT, x1, x2, x3;
          typedef u8;
          typedef __u8;
          type t = {u8,__u8,char,unsigned char};
          identifier alloc = {vmalloc,vzalloc};
          fresh identifier realloc = script:ocaml(alloc) { rename alloc };
      @@
      
      (
            alloc(x1*x2*x3)
      |
            alloc(C1 * C2)
      |
            alloc((sizeof(t)) * (COUNT), ...)
      |
      -     alloc((e1) * (e2))
      +     realloc(e1, e2)
      |
      -     alloc((e1) * (COUNT))
      +     realloc(COUNT, e1)
      |
      -     alloc((E1) * (E2))
      +     realloc(E1, E2)
      )
      // </smpl>
      87235dfe
    • Gleb Chesnokov's avatar
      qla2x00t-32gbit: Fix error code in qla2x00_start_sp() · ceff753e
      Gleb Chesnokov authored
      
      This should be negative -EAGAIN instead of positive.  The callers treat
      non-zero error codes the same so it doesn't really impact runtime beyond
      some trivial differences to debug output.
      
      Fixes: 80676d054e5a ("scsi: qla2xxx: Fix session cleanup hang")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Link: https://lore.kernel.org/r/49866d28-4cfe-47b0-842b-78f110e61aab@moroto.mountain
      
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      [ commit e579b007eff3f upstream ]
      ceff753e
    • 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
  6. 19 Jul, 2023 9 commits