You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(19) |
Nov
(18) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(14) |
Feb
(14) |
Mar
(3) |
Apr
(10) |
May
(10) |
Jun
(17) |
Jul
(15) |
Aug
(24) |
Sep
(24) |
Oct
(11) |
Nov
(13) |
Dec
(15) |
2008 |
Jan
(10) |
Feb
(46) |
Mar
(20) |
Apr
(42) |
May
(44) |
Jun
(22) |
Jul
(59) |
Aug
(8) |
Sep
(15) |
Oct
(52) |
Nov
(30) |
Dec
(38) |
2009 |
Jan
(27) |
Feb
(27) |
Mar
(47) |
Apr
(85) |
May
(74) |
Jun
(41) |
Jul
(70) |
Aug
(64) |
Sep
(97) |
Oct
(147) |
Nov
(67) |
Dec
(48) |
2010 |
Jan
(68) |
Feb
(33) |
Mar
(53) |
Apr
(98) |
May
(55) |
Jun
(71) |
Jul
(99) |
Aug
(132) |
Sep
(291) |
Oct
(220) |
Nov
(344) |
Dec
(300) |
2011 |
Jan
(57) |
Feb
(25) |
Mar
(59) |
Apr
(104) |
May
(60) |
Jun
(155) |
Jul
(143) |
Aug
(43) |
Sep
(53) |
Oct
(20) |
Nov
(35) |
Dec
(103) |
2012 |
Jan
(62) |
Feb
(43) |
Mar
(29) |
Apr
(80) |
May
(75) |
Jun
(61) |
Jul
(52) |
Aug
(58) |
Sep
(33) |
Oct
(32) |
Nov
(69) |
Dec
(37) |
2013 |
Jan
(77) |
Feb
(28) |
Mar
(52) |
Apr
(18) |
May
(37) |
Jun
(21) |
Jul
(22) |
Aug
(55) |
Sep
(29) |
Oct
(74) |
Nov
(50) |
Dec
(44) |
2014 |
Jan
(77) |
Feb
(62) |
Mar
(81) |
Apr
(99) |
May
(59) |
Jun
(95) |
Jul
(55) |
Aug
(34) |
Sep
(78) |
Oct
(33) |
Nov
(48) |
Dec
(51) |
2015 |
Jan
(56) |
Feb
(120) |
Mar
(37) |
Apr
(15) |
May
(22) |
Jun
(196) |
Jul
(54) |
Aug
(33) |
Sep
(32) |
Oct
(42) |
Nov
(149) |
Dec
(61) |
2016 |
Jan
(15) |
Feb
(26) |
Mar
(37) |
Apr
(27) |
May
(14) |
Jun
(11) |
Jul
(13) |
Aug
(64) |
Sep
(2) |
Oct
(36) |
Nov
(18) |
Dec
(46) |
2017 |
Jan
(6) |
Feb
(1) |
Mar
(2) |
Apr
(50) |
May
(42) |
Jun
(11) |
Jul
(4) |
Aug
(12) |
Sep
(11) |
Oct
(21) |
Nov
(15) |
Dec
(42) |
2018 |
Jan
(33) |
Feb
(27) |
Mar
(20) |
Apr
(5) |
May
(4) |
Jun
(1) |
Jul
(42) |
Aug
(29) |
Sep
(11) |
Oct
(40) |
Nov
(312) |
Dec
(18) |
2019 |
Jan
(44) |
Feb
(98) |
Mar
(125) |
Apr
(160) |
May
(123) |
Jun
(33) |
Jul
(56) |
Aug
(81) |
Sep
(24) |
Oct
(23) |
Nov
(52) |
Dec
(86) |
2020 |
Jan
(6) |
Feb
(17) |
Mar
(62) |
Apr
(21) |
May
(118) |
Jun
(42) |
Jul
(52) |
Aug
(62) |
Sep
(20) |
Oct
(5) |
Nov
(23) |
Dec
(111) |
2021 |
Jan
(31) |
Feb
(8) |
Mar
(26) |
Apr
(13) |
May
(54) |
Jun
(31) |
Jul
(17) |
Aug
(10) |
Sep
(83) |
Oct
(8) |
Nov
(21) |
Dec
(33) |
2022 |
Jan
(67) |
Feb
(11) |
Mar
(4) |
Apr
(46) |
May
(12) |
Jun
(17) |
Jul
(19) |
Aug
(7) |
Sep
(53) |
Oct
(14) |
Nov
(29) |
Dec
(22) |
2023 |
Jan
(20) |
Feb
(4) |
Mar
(37) |
Apr
(25) |
May
(15) |
Jun
(20) |
Jul
(38) |
Aug
(1) |
Sep
(1) |
Oct
(34) |
Nov
|
Dec
(8) |
2024 |
Jan
(15) |
Feb
(10) |
Mar
|
Apr
(4) |
May
(23) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
(18) |
Oct
(1) |
Nov
(8) |
Dec
|
From: Gleb C. <lna...@ya...> - 2023-06-27 07:32:04
|
Commit: 1d6ab4a GitHub URL: https://github.com/SCST-project/scst/commit/1d6ab4aa72b666c62fc4cd851b6f5581f7d23d11 Author: Gleb Chesnokov Date: 2023-06-27T10:31:33+03:00 Log Message: ----------- nightly build: Update kernel versions Another kernel versions update following the 6.4 release. Modified Paths: -------------- nightly/conf/nightly.conf | 51 ++++++++------- 1 file changed, 27 insertions(+), 24 deletions(-) =================================================================== diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index dec3437..5246074 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,37 +3,38 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -6.3 \ -6.2.13-nc \ -6.1.26-nc \ +6.4 \ +6.3.9-nc \ +6.2.16-nc \ +6.1.35-nc \ 6.0.19-nc \ 5.19.17-nc \ 5.18.19-nc \ 5.17.15-nc \ 5.16.20-nc \ -5.15.109-nc \ +5.15.118-nc \ 5.14.21-nc \ 5.13.19-nc \ 5.12.19-nc \ 5.11.22-nc \ -5.10.179-nc \ +5.10.185-nc \ 5.9.16-nc \ 5.8.18-nc \ 5.7.19-nc \ 5.6.19-nc \ 5.5.19-nc \ -5.4.242-nc \ +5.4.248-nc \ 5.3.18-nc \ 5.2.21-nc \ 5.1.21-nc \ 5.0.21-nc \ 4.20.17-nc \ -4.19.282-nc \ +4.19.287-nc \ 4.18.20-nc \ 4.17.19-nc \ 4.16.18-nc \ 4.15.18-nc \ -4.14.314-nc \ +4.14.319-nc \ 4.13.16-nc \ 4.12.14-nc \ 4.11.12-nc \ @@ -58,8 +59,10 @@ ABT_KERNELS=" \ 3.12.74-nc \ 3.11.10-nc \ 3.10.108-nc \ +5.14.0-284.11.1.el9_2^AlmaLinux^9.2-nc \ 5.14.0-162.23.1.el9_1^AlmaLinux^9.1-nc \ 5.14.0-70.30.1.el9_0^AlmaLinux^9.0-nc \ +4.18.0-477.13.1.el8_8^AlmaLinux^8.8-nc \ 4.18.0-425.19.2.el8_7^AlmaLinux^8.7-nc \ 4.18.0-372.32.1.el8_6^AlmaLinux^8.6-nc \ 4.18.0-348.2.1.el8_5^CentOS^8.5.2111-nc \ @@ -68,20 +71,20 @@ ABT_KERNELS=" \ 4.18.0-193.28.1.el8_2^CentOS^8.2.2004-nc \ 4.18.0-147.8.1.el8_1^CentOS^8.1.1911-nc \ 4.18.0-80.11.2.el8_0^CentOS^8.0.1905-nc \ -3.10.0-1160.88.1.el7^CentOS^7.9.2009-nc \ -3.10.0-1127.19.1.el7^CentOS^7.8.2003-nc \ -3.10.0-1062.18.1.el7^CentOS^7.7.1908-nc \ -3.10.0-957.27.2.el7^CentOS^7.6.1810-nc \ -3.10.0-862.14.4.el7^CentOS^7.5.1804-nc \ -5.15.0-8.91.4.1.el9uek^UEK^9-nc \ -5.15.0-8.91.4.1.el8uek^UEK^8-nc \ -5.4.17-2136.318.7.1.el8uek^UEK^8-nc \ -5.4.17-2102.206.1.el8uek^UEK^8-nc \ -5.4.17-2036.104.5.el8uek^UEK^8-nc \ -5.4.17-2011.7.4.el8uek^UEK^8-nc \ -5.4.17-2136.318.7.1.el7uek^UEK^7-nc \ -5.4.17-2102.206.1.el7uek^UEK^7-nc \ -5.4.17-2036.104.5.el7uek^UEK^7-nc \ -5.4.17-2011.7.4.el7uek^UEK^7-nc \ -4.1.12-124.48.6.el6uek^UEK^6-nc \ +3.10.0-1160.90.1.el7^CentOS^7.9.2009-nc \ +3.10.0-1127.19.1.el7^CentOS^7.8.2003-nc \ +3.10.0-1062.18.1.el7^CentOS^7.7.1908-nc \ +3.10.0-957.27.2.el7^CentOS^7.6.1810-nc \ +3.10.0-862.14.4.el7^CentOS^7.5.1804-nc \ +5.15.0-102.110.5.1.el9uek^UEK^9-nc \ +5.15.0-102.110.5.1.el8uek^UEK^8-nc \ +5.4.17-2136.320.7.1.el8uek^UEK^8-nc \ +5.4.17-2102.206.1.el8uek^UEK^8-nc \ +5.4.17-2036.104.5.el8uek^UEK^8-nc \ +5.4.17-2011.7.4.el8uek^UEK^8-nc \ +5.4.17-2136.320.7.1.el7uek^UEK^7-nc \ +5.4.17-2102.206.1.el7uek^UEK^7-nc \ +5.4.17-2036.104.5.el7uek^UEK^7-nc \ +5.4.17-2011.7.4.el7uek^UEK^7-nc \ +4.1.12-124.48.6.el6uek^UEK^6-nc \ " |
From: Gleb C. <lna...@ya...> - 2023-06-20 06:55:28
|
Commit: be1574d GitHub URL: https://github.com/SCST-project/scst/commit/be1574d80e0ff51c74bb05f4a1996e1316df78b5 Author: Gleb Chesnokov Date: 2023-06-20T09:53:50+03:00 Log Message: ----------- scst_lib: Make __scst_ext_blocking_done() static Since __scst_ext_blocking_done() is only called from inside scst_lib.c, declare that function static. This patch doesn't change any functionality. Modified Paths: -------------- scst/src/scst_lib.c | 13 ++++++++----- scst/src/scst_priv.h | 1 - 2 files changed, 8 insertions(+), 6 deletions(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 897d526..23149b6 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -14854,14 +14854,18 @@ static inline void scst_ext_blocker_put(struct scst_ext_blocker *b) } /* Must be called under dev_lock and BHs off. Might release it, then reacquire. */ -void __scst_ext_blocking_done(struct scst_device *dev) +static void __scst_ext_blocking_done(struct scst_device *dev) + __releases(&dev->dev_lock) + __acquires(&dev->dev_lock) { bool stop; TRACE_ENTRY(); + lockdep_assert_held(&dev->dev_lock); + TRACE_BLOCK("Notifying ext blockers for dev %s (ext_blocks_cnt %d)", - dev->virt_name, dev->ext_blocks_cnt); + dev->virt_name, dev->ext_blocks_cnt); stop = list_empty(&dev->ext_blockers_list); while (!stop) { @@ -14870,8 +14874,8 @@ void __scst_ext_blocking_done(struct scst_device *dev) b = list_first_entry(&dev->ext_blockers_list, typeof(*b), ext_blockers_list_entry); - TRACE_DBG("Notifying async ext blocker %p (cnt %d)", b, - dev->ext_blocks_cnt); + TRACE_DBG("Notifying async ext blocker %p (cnt %d)", + b, dev->ext_blocks_cnt); list_del(&b->ext_blockers_list_entry); @@ -14890,7 +14894,6 @@ void __scst_ext_blocking_done(struct scst_device *dev) } TRACE_EXIT(); - return; } static void scst_ext_blocking_done_fn(struct work_struct *work) diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index 641ae5b..c9c0d3f 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -615,7 +615,6 @@ int scst_sync_ext_block_dev(struct scst_device *dev); int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, const void *priv, size_t priv_len, bool block_stpg); void scst_ext_unblock_dev(struct scst_device *dev, bool stpg); -void __scst_ext_blocking_done(struct scst_device *dev); void scst_ext_blocking_done(struct scst_device *dev); int scst_get_suspend_count(void); |
From: Gleb C. <lna...@ya...> - 2023-06-20 06:55:19
|
Commit: 2c5c12c GitHub URL: https://github.com/SCST-project/scst/commit/2c5c12c017e7febdd2019217f99749f1516040a0 Author: Gleb Chesnokov Date: 2023-06-20T09:53:50+03:00 Log Message: ----------- scst_lib: Enable scst_sync_ext_block_dev() to handle signals 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 Modified Paths: -------------- scst/include/scst.h | 17 ++++ scst/src/scst_lib.c | 63 +++++++++++---- 2 files changed, 64 insertions(+), 16 deletions(-) =================================================================== diff --git a/scst/include/scst.h b/scst/include/scst.h index 424ef0b..91258d1 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -2716,6 +2716,7 @@ typedef void (*ext_blocker_done_fn_t) (struct scst_device *dev, struct scst_ext_blocker { struct list_head ext_blockers_list_entry; + struct kref refcount; ext_blocker_done_fn_t ext_blocker_done_fn; int ext_blocker_data_len; @@ -5510,6 +5511,22 @@ do { \ __scst_wait_event_lock_bh(wq_head, condition, lock); \ } while (0) +#define __scst_wait_event_interruptible_lock_bh(wq_head, condition, lock) \ + ___scst_wait_event(wq_head, condition, TASK_INTERRUPTIBLE, 0, \ + spin_unlock_bh(&lock); \ + schedule(); \ + spin_lock_bh(&lock)) + +#define scst_wait_event_interruptible_lock_bh(wq_head, condition, lock) \ +({ \ + int __ret = 0; \ + if (!(condition)) \ + __ret = __scst_wait_event_interruptible_lock_bh(wq_head, \ + condition, lock);\ + __ret; \ +}) + + #define __scst_wait_event_lock_irq(wq_head, condition, lock) \ (void)___scst_wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, \ spin_unlock_irq(&lock); \ diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index f160d06..897d526 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -14820,6 +14820,39 @@ out_too_many: } EXPORT_SYMBOL_GPL(scst_restore_global_mode_pages); +static inline struct scst_ext_blocker *scst_ext_blocker_create(size_t size) +{ + struct scst_ext_blocker *b; + + b = kzalloc(size, GFP_KERNEL); + if (unlikely(!b)) { + PRINT_ERROR("Unable to alloc struct scst_ext_blocker with data (size %zd)", + size); + return NULL; + } + + kref_init(&b->refcount); + + return b; +} + +static inline void scst_ext_blocker_get(struct scst_ext_blocker *b) +{ + kref_get(&b->refcount); +} + +static inline void scst_ext_blocker_release(struct kref *kref) +{ + struct scst_ext_blocker *b = container_of(kref, struct scst_ext_blocker, refcount); + + kfree(b); +} + +static inline void scst_ext_blocker_put(struct scst_ext_blocker *b) +{ + kref_put(&b->refcount, scst_ext_blocker_release); +} + /* Must be called under dev_lock and BHs off. Might release it, then reacquire. */ void __scst_ext_blocking_done(struct scst_device *dev) { @@ -14851,7 +14884,7 @@ void __scst_ext_blocking_done(struct scst_device *dev) b->ext_blocker_done_fn(dev, b->ext_blocker_data, b->ext_blocker_data_len); - kfree(b); + scst_ext_blocker_put(b); spin_lock_bh(&dev->dev_lock); } @@ -14911,7 +14944,7 @@ static void scst_sync_ext_blocking_done(struct scst_device *dev, TRACE_ENTRY(); - w = (void *)*((unsigned long *)data); + w = (void *) data; wake_up_all(w); TRACE_EXIT(); @@ -14951,19 +14984,20 @@ static void scst_dev_ext_block(struct scst_device *dev, bool block_stpg) int scst_sync_ext_block_dev(struct scst_device *dev) { struct scst_ext_blocker *b; - DECLARE_WAIT_QUEUE_HEAD_ONSTACK(w); + wait_queue_head_t *w; int res = 0; TRACE_ENTRY(); - b = kzalloc(sizeof(*b) + sizeof(void *), GFP_KERNEL); + b = scst_ext_blocker_create(sizeof(*b) + sizeof(wait_queue_head_t)); if (unlikely(!b)) { - PRINT_ERROR("Unable to alloc struct scst_ext_blocker with data (size %zd)", - sizeof(*b) + sizeof(void *)); res = -ENOMEM; goto out; } + w = (void *)b->ext_blocker_data; + init_waitqueue_head(w); + TRACE_MGMT_DBG("New %d sync ext blocker %p for dev %s", dev->ext_blocks_cnt + 1, b, dev->virt_name); @@ -14975,26 +15009,25 @@ int scst_sync_ext_block_dev(struct scst_device *dev) TRACE_DBG("No commands to wait for sync blocking (dev %s)", dev->virt_name); spin_unlock_bh(&dev->dev_lock); - goto out_free; + goto put_blocker; } list_add_tail(&b->ext_blockers_list_entry, &dev->ext_blockers_list); dev->ext_blocking_pending = 1; b->ext_blocker_done_fn = scst_sync_ext_blocking_done; - *((void **)&b->ext_blocker_data[0]) = &w; + scst_ext_blocker_get(b); - scst_wait_event_lock_bh(w, dev->on_dev_cmd_count == 0, dev->dev_lock); + res = scst_wait_event_interruptible_lock_bh(*w, dev->on_dev_cmd_count == 0, dev->dev_lock); spin_unlock_bh(&dev->dev_lock); +put_blocker: + scst_ext_blocker_put(b); + out: TRACE_EXIT_RES(res); return res; - -out_free: - kfree(b); - goto out; } int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, @@ -15005,10 +15038,8 @@ int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, TRACE_ENTRY(); - b = kzalloc(sizeof(*b) + priv_len, GFP_KERNEL); + b = scst_ext_blocker_create(sizeof(*b) + priv_len); if (unlikely(!b)) { - PRINT_ERROR("Unable to alloc struct scst_ext_blocker with data (size %zd)", - sizeof(*b) + priv_len); res = -ENOMEM; goto out; } |
From: Gleb C. <lna...@ya...> - 2023-06-20 06:54:53
|
Commit: b13b580 GitHub URL: https://github.com/SCST-project/scst/commit/b13b580d8b195dcb6d66dc041d70be32d3b439f9 Author: Gleb Chesnokov Date: 2023-06-20T09:53:50+03:00 Log Message: ----------- scst_lib: Split scst_ext_block_dev() for clarity and easier maintenance 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. Modified Paths: -------------- scst/src/scst_lib.c | 140 +++++++++------ scst/src/scst_priv.h | 5 +- scst/src/scst_sysfs.c | 4 +- scst/src/scst_tg.c | 3 +- 4 files changed, 92 insertions(+), 60 deletions(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 1026d28..f160d06 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -14918,30 +14918,12 @@ static void scst_sync_ext_blocking_done(struct scst_device *dev, return; } -int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, - const uint8_t *priv, int priv_len, int flags) +static void scst_dev_ext_block(struct scst_device *dev, bool block_stpg) { - int res; - struct scst_ext_blocker *b; + lockdep_assert_held(&dev->dev_lock); TRACE_ENTRY(); - if (flags & SCST_EXT_BLOCK_SYNC) - priv_len = sizeof(void *); - - b = kzalloc(sizeof(*b) + priv_len, GFP_KERNEL); - if (b == NULL) { - PRINT_ERROR("Unable to alloc struct scst_ext_blocker with data " - "(size %zd)", sizeof(*b) + priv_len); - res = -ENOMEM; - goto out; - } - - TRACE_MGMT_DBG("New %d ext blocker %p for dev %s (flags %x)", - dev->ext_blocks_cnt+1, b, dev->virt_name, flags); - - spin_lock_bh(&dev->dev_lock); - if (dev->strictly_serialized_cmd_waiting) { /* * Avoid deadlock when this strictly serialized cmd @@ -14951,10 +14933,11 @@ int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, TRACE_DBG("Unstrictlyserialize dev %s", dev->virt_name); dev->strictly_serialized_cmd_waiting = 0; /* We will reuse blocking done by the strictly serialized cmd */ - } else + } else { scst_block_dev(dev); + } - if (flags & SCST_EXT_BLOCK_STPG) { + if (block_stpg) { WARN_ON(dev->stpg_ext_blocked); dev->stpg_ext_blocked = 1; } @@ -14962,52 +14945,103 @@ int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, dev->ext_blocks_cnt++; TRACE_DBG("ext_blocks_cnt %d", dev->ext_blocks_cnt); - if ((flags & SCST_EXT_BLOCK_SYNC) && (dev->on_dev_cmd_count == 0)) { + TRACE_EXIT(); +} + +int scst_sync_ext_block_dev(struct scst_device *dev) +{ + struct scst_ext_blocker *b; + DECLARE_WAIT_QUEUE_HEAD_ONSTACK(w); + int res = 0; + + TRACE_ENTRY(); + + b = kzalloc(sizeof(*b) + sizeof(void *), GFP_KERNEL); + if (unlikely(!b)) { + PRINT_ERROR("Unable to alloc struct scst_ext_blocker with data (size %zd)", + sizeof(*b) + sizeof(void *)); + res = -ENOMEM; + goto out; + } + + TRACE_MGMT_DBG("New %d sync ext blocker %p for dev %s", + dev->ext_blocks_cnt + 1, b, dev->virt_name); + + spin_lock_bh(&dev->dev_lock); + + scst_dev_ext_block(dev, false); + + if (dev->on_dev_cmd_count == 0) { TRACE_DBG("No commands to wait for sync blocking (dev %s)", - dev->virt_name); + dev->virt_name); spin_unlock_bh(&dev->dev_lock); - goto out_free_success; + goto out_free; } list_add_tail(&b->ext_blockers_list_entry, &dev->ext_blockers_list); dev->ext_blocking_pending = 1; - if (flags & SCST_EXT_BLOCK_SYNC) { - DECLARE_WAIT_QUEUE_HEAD_ONSTACK(w); + b->ext_blocker_done_fn = scst_sync_ext_blocking_done; + *((void **)&b->ext_blocker_data[0]) = &w; - b->ext_blocker_done_fn = scst_sync_ext_blocking_done; - *((void **)&b->ext_blocker_data[0]) = &w; + scst_wait_event_lock_bh(w, dev->on_dev_cmd_count == 0, dev->dev_lock); - scst_wait_event_lock_bh(w, dev->on_dev_cmd_count == 0, dev->dev_lock); + spin_unlock_bh(&dev->dev_lock); - spin_unlock_bh(&dev->dev_lock); - } else { - b->ext_blocker_done_fn = done_fn; - if (priv_len > 0) { - b->ext_blocker_data_len = priv_len; - memcpy(b->ext_blocker_data, priv, priv_len); - } - if (dev->on_dev_cmd_count == 0) { - TRACE_DBG("No commands to wait for async blocking " - "(dev %s)", dev->virt_name); - if (!dev->ext_unblock_scheduled) - __scst_ext_blocking_done(dev); - spin_unlock_bh(&dev->dev_lock); - } else - spin_unlock_bh(&dev->dev_lock); +out: + TRACE_EXIT_RES(res); + return res; + +out_free: + kfree(b); + goto out; +} + +int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, + const void *priv, size_t priv_len, bool block_stpg) +{ + struct scst_ext_blocker *b; + int res = 0; + + TRACE_ENTRY(); + + b = kzalloc(sizeof(*b) + priv_len, GFP_KERNEL); + if (unlikely(!b)) { + PRINT_ERROR("Unable to alloc struct scst_ext_blocker with data (size %zd)", + sizeof(*b) + priv_len); + res = -ENOMEM; + goto out; } -out_success: - res = 0; + TRACE_MGMT_DBG("New %d ext blocker %p for dev %s (block_stpg %d)", + dev->ext_blocks_cnt + 1, b, dev->virt_name, block_stpg); + + spin_lock_bh(&dev->dev_lock); + + scst_dev_ext_block(dev, block_stpg); + + list_add_tail(&b->ext_blockers_list_entry, &dev->ext_blockers_list); + dev->ext_blocking_pending = 1; + + b->ext_blocker_done_fn = done_fn; + if (priv_len > 0) { + b->ext_blocker_data_len = priv_len; + memcpy(b->ext_blocker_data, priv, priv_len); + } + + if (dev->on_dev_cmd_count == 0) { + TRACE_DBG("No commands to wait for async blocking (dev %s)", + dev->virt_name); + + if (!dev->ext_unblock_scheduled) + __scst_ext_blocking_done(dev); + } + + spin_unlock_bh(&dev->dev_lock); out: TRACE_EXIT_RES(res); return res; - -out_free_success: - sBUG_ON(!(flags & SCST_EXT_BLOCK_SYNC)); - kfree(b); - goto out_success; } void scst_ext_unblock_dev(struct scst_device *dev, bool stpg) @@ -15044,7 +15078,7 @@ void scst_ext_unblock_dev(struct scst_device *dev, bool stpg) spin_unlock_bh(&dev->dev_lock); TRACE_DBG("Ext unblock (dev %s): still pending...", dev->virt_name); - rc = scst_ext_block_dev(dev, NULL, NULL, 0, SCST_EXT_BLOCK_SYNC); + rc = scst_sync_ext_block_dev(dev); if (rc != 0) { /* Oops, have to poll */ PRINT_WARNING("scst_ext_block_dev(dev %s) failed, " diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index c30af8e..641ae5b 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -611,10 +611,9 @@ bool __scst_check_blocked_dev(struct scst_cmd *cmd); void __scst_check_unblock_dev(struct scst_cmd *cmd); void scst_check_unblock_dev(struct scst_cmd *cmd); -#define SCST_EXT_BLOCK_SYNC 1 -#define SCST_EXT_BLOCK_STPG 2 +int scst_sync_ext_block_dev(struct scst_device *dev); int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, - const uint8_t *priv, int priv_len, int flags); + const void *priv, size_t priv_len, bool block_stpg); void scst_ext_unblock_dev(struct scst_device *dev, bool stpg); void __scst_ext_blocking_done(struct scst_device *dev); void scst_ext_blocking_done(struct scst_device *dev); diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 874ef82..1ed7227 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -3805,10 +3805,10 @@ static ssize_t scst_dev_block_store(struct kobject *kobj, "data_len %d)", dev->virt_name, sync, data_start, data_len); if (sync) - res = scst_ext_block_dev(dev, NULL, NULL, 0, SCST_EXT_BLOCK_SYNC); + res = scst_sync_ext_block_dev(dev); else res = scst_ext_block_dev(dev, scst_sysfs_ext_blocking_done, - data_start, data_len, 0); + data_start, data_len, false); if (res != 0) goto out; diff --git a/scst/src/scst_tg.c b/scst/src/scst_tg.c index 72feb67..d03dda1 100644 --- a/scst/src/scst_tg.c +++ b/scst/src/scst_tg.c @@ -1820,8 +1820,7 @@ static int scst_emit_stpg_event(struct scst_cmd *cmd, struct scst_dev_group *dg, rc = scst_ext_block_dev(dgd->dev, scst_stpg_ext_blocking_done, - (uint8_t *)&wait, sizeof(wait), - SCST_EXT_BLOCK_STPG); + &wait, sizeof(wait), true); if (rc != 0) { TRACE_DBG("scst_ext_block_dev() failed " "with %d, reverting (cmd %p)", rc, cmd); |
From: Gleb C. <lna...@ya...> - 2023-06-20 06:54:44
|
Commit: d8894cb GitHub URL: https://github.com/SCST-project/scst/commit/d8894cbd11573f688a22b199f18359a8075ebce6 Author: Gleb Chesnokov Date: 2023-06-20T09:53:50+03:00 Log Message: ----------- scst.h: Refactor wait_event_locked() to enhance usability and clarity 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(). Modified Paths: -------------- iscsi-scst/kernel/nthread.c | 6 +- scst/include/scst.h | 150 ++++++++++++--- scst/src/dev_handlers/scst_user.c | 10 +- scst/src/scst_lib.c | 3 +- scst/src/scst_sysfs.c | 4 +- scst/src/scst_targ.c | 16 +- 6 files changed, 136 insertions(+), 53 deletions(-) =================================================================== diff --git a/iscsi-scst/kernel/nthread.c b/iscsi-scst/kernel/nthread.c index e91a885..fb4e93a 100644 --- a/iscsi-scst/kernel/nthread.c +++ b/iscsi-scst/kernel/nthread.c @@ -960,8 +960,7 @@ int istrd(void *arg) spin_lock_bh(&p->rd_lock); while (!kthread_should_stop()) { - wait_event_locked(p->rd_waitQ, test_rd_list(p), lock_bh, - p->rd_lock); + scst_wait_event_lock_bh(p->rd_waitQ, test_rd_list(p), p->rd_lock); scst_do_job_rd(p); } spin_unlock_bh(&p->rd_lock); @@ -1613,8 +1612,7 @@ int istwr(void *arg) spin_lock_bh(&p->wr_lock); while (!kthread_should_stop()) { - wait_event_locked(p->wr_waitQ, test_wr_list(p), lock_bh, - p->wr_lock); + scst_wait_event_lock_bh(p->wr_waitQ, test_wr_list(p), p->wr_lock); scst_do_job_wr(p); } spin_unlock_bh(&p->wr_lock); diff --git a/scst/include/scst.h b/scst/include/scst.h index 1eb7213..424ef0b 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -36,6 +36,9 @@ #endif #include <linux/blkdev.h> #include <linux/interrupt.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +#include <linux/sched/signal.h> +#endif #include <linux/wait.h> #include <linux/cpumask.h> #include <linux/dlm.h> @@ -5382,59 +5385,142 @@ void scst_dev_inquiry_data_changed(struct scst_device *dev); */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && \ !defined(CONFIG_SUSE_KERNEL) -static inline void +static inline long prepare_to_wait_exclusive_head(wait_queue_head_t *wq_head, wait_queue_t *wq_entry, int state) { unsigned long flags; + long ret = 0; wq_entry->flags |= WQ_FLAG_EXCLUSIVE; + spin_lock_irqsave(&wq_head->lock, flags); - if (list_empty(&wq_entry->task_list)) - __add_wait_queue(wq_head, wq_entry); - set_current_state(state); + if (signal_pending_state(state, current)) { + /* + * Exclusive waiter must not fail if it was selected by wakeup, + * it should "consume" the condition we were waiting for. + * + * The caller will recheck the condition and return success if + * we were already woken up, we can not miss the event because + * wakeup locks/unlocks the same wq_head->lock. + * + * But we need to ensure that set-condition + wakeup after that + * can't see us, it should wake up another exclusive waiter if + * we fail. + */ + list_del_init(&wq_entry->task_list); + ret = -ERESTARTSYS; + } else { + if (list_empty(&wq_entry->task_list)) + __add_wait_queue(wq_head, wq_entry); + set_current_state(state); + } spin_unlock_irqrestore(&wq_head->lock, flags); + + return ret; } #else -static inline void +static inline long prepare_to_wait_exclusive_head(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state) { unsigned long flags; + long ret = 0; wq_entry->flags |= WQ_FLAG_EXCLUSIVE; + spin_lock_irqsave(&wq_head->lock, flags); - if (list_empty(&wq_entry->entry)) - __add_wait_queue(wq_head, wq_entry); - set_current_state(state); + if (signal_pending_state(state, current)) { + /* + * Exclusive waiter must not fail if it was selected by wakeup, + * it should "consume" the condition we were waiting for. + * + * The caller will recheck the condition and return success if + * we were already woken up, we can not miss the event because + * wakeup locks/unlocks the same wq_head->lock. + * + * But we need to ensure that set-condition + wakeup after that + * can't see us, it should wake up another exclusive waiter if + * we fail. + */ + list_del_init(&wq_entry->entry); + ret = -ERESTARTSYS; + } else { + if (list_empty(&wq_entry->entry)) + __add_wait_queue(wq_head, wq_entry); + set_current_state(state); + } spin_unlock_irqrestore(&wq_head->lock, flags); + + return ret; } #endif -/** - * wait_event_locked() - Wait until a condition becomes true. - * @wq: Wait queue to wait on if @condition is false. - * @condition: Condition to wait for. Can be any C expression. - * @lock_type: One of lock, lock_bh or lock_irq. - * @lock: A spinlock. - * - * Caller must hold lock of type @lock_type on @lock. - */ -#define wait_event_locked(wq, condition, lock_type, lock) do { \ -if (!(condition)) { \ - DEFINE_WAIT(__wait); \ - \ - do { \ - prepare_to_wait_exclusive_head(&(wq), &__wait, \ - TASK_INTERRUPTIBLE); \ - if (condition) \ - break; \ - spin_un ## lock_type(&(lock)); \ - schedule(); \ - spin_ ## lock_type(&(lock)); \ - } while (!(condition)); \ - finish_wait(&(wq), &__wait); \ -} \ +#define ___scst_wait_is_interruptible(state) \ + (!__builtin_constant_p(state) || \ + (state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL))) + +#define ___scst_wait_event(wq_head, condition, state, ret, cmd) \ +({ \ + __label__ __out; \ + DEFINE_WAIT(__wq_entry); \ + long __ret = ret; /* explicit shadow */ \ + \ + for (;;) { \ + long __int = prepare_to_wait_exclusive_head(&wq_head, &__wq_entry,\ + state); \ + \ + if (condition) \ + break; \ + \ + if (___scst_wait_is_interruptible(state) && __int) { \ + __ret = __int; \ + goto __out; \ + } \ + \ + cmd; \ + } \ + finish_wait(&wq_head, &__wq_entry); \ +__out: __ret; \ +}) + +#define __scst_wait_event_lock(wq_head, condition, lock) \ + (void)___scst_wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, \ + spin_unlock(&lock); \ + schedule(); \ + spin_lock(&lock)) + +#define scst_wait_event_lock(wq_head, condition, lock) \ +do { \ + if (condition) \ + break; \ + __scst_wait_event_lock(wq_head, condition, lock); \ +} while (0) + +#define __scst_wait_event_lock_bh(wq_head, condition, lock) \ + (void)___scst_wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, \ + spin_unlock_bh(&lock); \ + schedule(); \ + spin_lock_bh(&lock)) + +#define scst_wait_event_lock_bh(wq_head, condition, lock) \ +do { \ + if (condition) \ + break; \ + __scst_wait_event_lock_bh(wq_head, condition, lock); \ +} while (0) + +#define __scst_wait_event_lock_irq(wq_head, condition, lock) \ + (void)___scst_wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, \ + spin_unlock_irq(&lock); \ + schedule(); \ + spin_lock_irq(&lock)) + +#define scst_wait_event_lock_irq(wq_head, condition, lock) \ +do { \ + if (condition) \ + break; \ + __scst_wait_event_lock_irq(wq_head, condition, lock); \ } while (0) #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index b995f85..e41b3ba 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -2233,9 +2233,9 @@ static int dev_user_get_next_cmd(struct scst_user_dev *dev, TRACE_ENTRY(); while (1) { - wait_event_locked(dev->udev_cmd_threads.cmd_list_waitQ, - test_cmd_threads(dev, can_block), lock_irq, - dev->udev_cmd_threads.cmd_list_lock); + scst_wait_event_lock_irq(dev->udev_cmd_threads.cmd_list_waitQ, + test_cmd_threads(dev, can_block), + dev->udev_cmd_threads.cmd_list_lock); dev_user_process_scst_commands(dev); @@ -4053,8 +4053,8 @@ static int dev_user_cleanup_thread(void *arg) spin_lock(&cleanup_lock); while (!kthread_should_stop()) { - wait_event_locked(cleanup_list_waitQ, test_cleanup_list(), - lock, cleanup_lock); + scst_wait_event_lock(cleanup_list_waitQ, test_cleanup_list(), + cleanup_lock); /* * We have to poll devices, because commands can go from SCST diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 976dcc4..1026d28 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -14978,8 +14978,7 @@ int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, b->ext_blocker_done_fn = scst_sync_ext_blocking_done; *((void **)&b->ext_blocker_data[0]) = &w; - wait_event_locked(w, (dev->on_dev_cmd_count == 0), - lock_bh, dev->dev_lock); + scst_wait_event_lock_bh(w, dev->on_dev_cmd_count == 0, dev->dev_lock); spin_unlock_bh(&dev->dev_lock); } else { diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 110cd45..874ef82 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -470,8 +470,8 @@ static int sysfs_work_thread_fn(void *arg) while (!kthread_should_stop()) { if (one_time_only && !test_sysfs_work_list()) break; - wait_event_locked(sysfs_work_waitQ, test_sysfs_work_list(), - lock, sysfs_work_lock); + scst_wait_event_lock(sysfs_work_waitQ, test_sysfs_work_list(), + sysfs_work_lock); scst_process_sysfs_works(); } spin_unlock(&sysfs_work_lock); diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index d696883..2593cc0 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -4510,9 +4510,9 @@ int scst_init_thread(void *arg) spin_lock_irq(&scst_init_lock); while (!kthread_should_stop()) { - wait_event_locked(scst_init_cmd_list_waitQ, - test_init_cmd_list(), - lock_irq, scst_init_lock); + scst_wait_event_lock_irq(scst_init_cmd_list_waitQ, + test_init_cmd_list(), + scst_init_lock); scst_do_job_init(); } spin_unlock_irq(&scst_init_lock); @@ -6794,9 +6794,9 @@ int scst_tm_thread(void *arg) spin_lock_irq(&scst_mcmd_lock); while (!kthread_should_stop()) { - wait_event_locked(scst_mgmt_cmd_list_waitQ, - test_mgmt_cmd_list(), lock_irq, - scst_mcmd_lock); + scst_wait_event_lock_irq(scst_mgmt_cmd_list_waitQ, + test_mgmt_cmd_list(), + scst_mcmd_lock); while (!list_empty(&scst_active_mgmt_cmd_list)) { int rc; @@ -7610,8 +7610,8 @@ int scst_global_mgmt_thread(void *arg) spin_lock_irq(&scst_mgmt_lock); while (!kthread_should_stop()) { - wait_event_locked(scst_mgmt_waitQ, test_mgmt_list(), lock_irq, - scst_mgmt_lock); + scst_wait_event_lock_irq(scst_mgmt_waitQ, test_mgmt_list(), + scst_mgmt_lock); while (!list_empty(&scst_sess_init_list)) { sess = list_first_entry(&scst_sess_init_list, |
From: Gleb C. <lna...@ya...> - 2023-06-20 06:54:24
|
Commit: 334d29c GitHub URL: https://github.com/SCST-project/scst/commit/334d29c96ad338191fe6719ee86be04d22634228 Author: Gleb Chesnokov Date: 2023-06-20T09:53:50+03:00 Log Message: ----------- scst.h: Unify names in prepare_to_wait_exclusive_head() Use the standardized version of the name for wait_queue_head and wait_queue_entry variables. This patch doesn't change any functionality. Modified Paths: -------------- scst/include/scst.h | 20 ++++++++------- 1 file changed, 11 insertions(+), 9 deletions(-) =================================================================== diff --git a/scst/include/scst.h b/scst/include/scst.h index 0723d75..1eb7213 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -5382,21 +5382,23 @@ void scst_dev_inquiry_data_changed(struct scst_device *dev); */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && \ !defined(CONFIG_SUSE_KERNEL) -static inline void prepare_to_wait_exclusive_head(wait_queue_head_t *q, - wait_queue_t *wait, int state) +static inline void +prepare_to_wait_exclusive_head(wait_queue_head_t *wq_head, + wait_queue_t *wq_entry, int state) { unsigned long flags; - wait->flags |= WQ_FLAG_EXCLUSIVE; - spin_lock_irqsave(&q->lock, flags); - if (list_empty(&wait->task_list)) - __add_wait_queue(q, wait); + wq_entry->flags |= WQ_FLAG_EXCLUSIVE; + spin_lock_irqsave(&wq_head->lock, flags); + if (list_empty(&wq_entry->task_list)) + __add_wait_queue(wq_head, wq_entry); set_current_state(state); - spin_unlock_irqrestore(&q->lock, flags); + spin_unlock_irqrestore(&wq_head->lock, flags); } #else -static inline void prepare_to_wait_exclusive_head(struct wait_queue_head *wq_head, - struct wait_queue_entry *wq_entry, int state) +static inline void +prepare_to_wait_exclusive_head(struct wait_queue_head *wq_head, + struct wait_queue_entry *wq_entry, int state) { unsigned long flags; |
From: Gleb C. <lna...@ya...> - 2023-06-16 10:36:20
|
Commit: 7881162 GitHub URL: https://github.com/SCST-project/scst/commit/7881162b9b475e707b9c7e4a764272aa3ec22be8 Author: Gleb Chesnokov Date: 2023-06-16T13:35:51+03:00 Log Message: ----------- scst: Unbreak the non-DLM build 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: 00f31004ab2b ("scst_sysfs: Add support for cluster_name") Modified Paths: -------------- scst/src/scst_dlm.c | 2 -- scst/src/scst_main.c | 6 +++-- scst/src/scst_priv.h | 4 ++-- scst/src/scst_sysfs.c | 17 +++++++-------- 4 files changed, 14 insertions(+), 15 deletions(-) =================================================================== diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index c3fb411..8afedb1 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -1831,6 +1831,4 @@ const struct scst_cl_ops scst_dlm_cl_ops = { .pr_reg_queue_rem_ua = scst_dlm_pr_reg_queue_rem_ua, }; -char *scst_dlm_cluster_name; - #endif diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 564488d..11d26d3 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -93,6 +93,8 @@ struct kmem_cache *scst_sess_cachep; struct kmem_cache *scst_acgd_cachep; static struct kmem_cache *scst_thr_cachep; +char *scst_cluster_name; + unsigned int scst_setup_id; spinlock_t scst_init_lock; @@ -2599,7 +2601,6 @@ static void __exit exit_scst(void) scst_cm_exit(); - scst_stop_global_threads(); scst_deinit_threads(&scst_main_cmd_threads); @@ -2609,13 +2610,14 @@ static void __exit exit_scst(void) scsi_unregister_interface(&scst_interface); - scst_sgv_pools_deinit(); scst_tg_cleanup(); scst_sysfs_cleanup(); + kfree(scst_cluster_name); + scst_event_exit(); rcu_barrier(); diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index c2e2cf7..c30af8e 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -176,7 +176,7 @@ extern wait_queue_head_t scst_dev_cmd_waitQ; extern const struct scst_cl_ops scst_no_dlm_cl_ops; extern const struct scst_cl_ops scst_dlm_cl_ops; -extern char *scst_dlm_cluster_name; +extern char *scst_cluster_name; extern unsigned int scst_setup_id; @@ -418,7 +418,7 @@ static inline int scst_dlm_new_lockspace(const char *name, int namelen, uint32_t flags, int lvblen) { - return dlm_new_lockspace(name, scst_dlm_cluster_name, flags, lvblen, + return dlm_new_lockspace(name, scst_cluster_name, flags, lvblen, NULL, NULL, NULL, lockspace); } diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 4fadd86..110cd45 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -7701,8 +7701,8 @@ static ssize_t scst_cluster_name_show(struct kobject *kobj, TRACE_ENTRY(); - if (scst_dlm_cluster_name != NULL) - res = sprintf(buf, "%s\n%s", scst_dlm_cluster_name, + if (scst_cluster_name != NULL) + res = sprintf(buf, "%s\n%s", scst_cluster_name, SCST_SYSFS_KEY_MARK "\n"); TRACE_EXIT_RES(res); @@ -7726,8 +7726,8 @@ static ssize_t scst_cluster_name_store(struct kobject *kobj, len--; if (len == 0) { - kfree(scst_dlm_cluster_name); - scst_dlm_cluster_name = NULL; + kfree(scst_cluster_name); + scst_cluster_name = NULL; goto out_done; } @@ -7737,11 +7737,11 @@ static ssize_t scst_cluster_name_store(struct kobject *kobj, goto out; } - kfree(scst_dlm_cluster_name); - scst_dlm_cluster_name = kstrndup(buf, len, GFP_KERNEL); - if (!scst_dlm_cluster_name) { + kfree(scst_cluster_name); + scst_cluster_name = kstrndup(buf, len, GFP_KERNEL); + if (!scst_cluster_name) { PRINT_ERROR("Unable to alloc cluster_name string (len %d)", - len+1); + len + 1); res = -ENOMEM; goto out; } @@ -8097,7 +8097,6 @@ void scst_sysfs_cleanup(void) TRACE_ENTRY(); PRINT_INFO("%s", "Exiting SCST sysfs hierarchy..."); - kfree(scst_dlm_cluster_name); scst_del_put_sgv_kobj(); |
From: Gleb C. <lna...@ya...> - 2023-06-14 13:50:37
|
Commit: a6e0967 GitHub URL: https://github.com/SCST-project/scst/commit/a6e09670547ba6b62d36b6102f13b47fa4bdc140 Author: Gleb Chesnokov Date: 2023-06-14T16:49:36+03:00 Log Message: ----------- scst/src/Makefile: Fix depmod warnings during installation process 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. Modified Paths: -------------- scst/src/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) =================================================================== diff --git a/scst/src/Makefile b/scst/src/Makefile index a4469bf..1d79143 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -97,14 +97,15 @@ install: all false; fi -rm -f $(INSTALL_DIR)/scsi_tgt.ko KDIR=$(KDIR) ../../scripts/sign-modules - $(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ - INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)/dev_handlers \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install - $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ + (cd $(SCST_DH_MOD_DIR) && KDIR=$(KDIR) ../../../scripts/sign-modules) + $(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ - INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)/dev_handlers \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install install -d $(INSTALL_DIR_H) @@ -140,12 +141,11 @@ uninstall: rm -rf $(INSTALL_DIR_H) clean: + $(MAKE) -C $(DEV_HANDLERS_DIR) $@ rm -f $(SCST_INTF_VER_FILE) $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) $@ - $(MAKE) -C $(DEV_HANDLERS_DIR) $@ extraclean: clean - rm -f $(SCST_INTF_VER_FILE) cd $(DEV_HANDLERS_DIR) && $(MAKE) $@ rm -f *.orig *.rej |
From: Gleb C. <lna...@ya...> - 2023-06-14 13:50:19
|
Commit: 6c2771b GitHub URL: https://github.com/SCST-project/scst/commit/6c2771baefc91d3a9219333b6bc994b8c6992bb4 Author: Gleb Chesnokov Date: 2023-06-14T16:49:36+03:00 Log Message: ----------- Makefile: Specify the installation directory for SCST modules explicitly 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`. Modified Paths: -------------- fcst/Makefile | 5 ++++- iscsi-scst/Makefile | 6 +++++- qla2x00t-32gbit/Makefile | 5 ++++- qla2x00t-32gbit/qla2x00-target/Makefile | 5 ++++- qla2x00t/Makefile | 5 ++++- qla2x00t/qla2x00-target/Makefile | 5 ++++- scst/src/Makefile | 11 +++++++---- scst/src/dev_handlers/Makefile | 9 ++++++--- scst_local/Makefile | 5 ++++- srpt/Makefile | 5 ++++- 10 files changed, 46 insertions(+), 15 deletions(-) =================================================================== diff --git a/fcst/Makefile b/fcst/Makefile index 7c39044..497291b 100644 --- a/fcst/Makefile +++ b/fcst/Makefile @@ -55,7 +55,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) SCST_DIR := $(shell echo "$$PWD")/../scst/src @@ -67,6 +69,7 @@ install: all KDIR=$(KDIR) ../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 557088e..f153e35 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -43,7 +43,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) INFINIBAND_ENABLED = $(shell syms=$$(dirname "$(KDIR)")/modules.symbols; if [ -e "$$syms" ] && grep -wq 'ib_register_client' "$$syms" || grep -q "^CONFIG_INFINIBAND=[my]$$" "$(KDIR)/.config"; then echo true; else echo false; fi) all: progs mods @@ -166,6 +168,7 @@ install: all (cd $(KMOD) && KDIR=$(KDIR) ../../scripts/sign-modules) $(MAKE) -C $(KDIR) M=$(KMOD) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install echo "$@: INFINIBAND_ENABLED = $(INFINIBAND_ENABLED)" @@ -173,6 +176,7 @@ install: all (cd $(ISERTMOD) && KDIR=$(KDIR) ../../../scripts/sign-modules);\ $(MAKE) -C $(KDIR) M=$(ISERTMOD) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install; \ fi diff --git a/qla2x00t-32gbit/Makefile b/qla2x00t-32gbit/Makefile index cf4cea8..48dad4f 100644 --- a/qla2x00t-32gbit/Makefile +++ b/qla2x00t-32gbit/Makefile @@ -45,7 +45,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) all: $(MAKE) -C $(KDIR) M=$(shell pwd) \ @@ -56,6 +58,7 @@ install: all KDIR=$(KDIR) ../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/qla2x00t-32gbit/qla2x00-target/Makefile b/qla2x00t-32gbit/qla2x00-target/Makefile index 574527e..4de10dc 100644 --- a/qla2x00t-32gbit/qla2x00-target/Makefile +++ b/qla2x00t-32gbit/qla2x00-target/Makefile @@ -62,7 +62,9 @@ ifndef PREFIX PREFIX=/usr/local endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) SCST_DIR := $(shell echo "$$PWD/../../scst/src") @@ -77,6 +79,7 @@ endif KDIR=$(KDIR) ../../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index 9806a81..4bdb5fa 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -43,7 +43,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) all: $(MAKE) -C $(KDIR) M=$(shell pwd) \ @@ -54,6 +56,7 @@ install: all KDIR=$(KDIR) ../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index 0fe34e1..5fdfcf8 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -61,7 +61,9 @@ ifndef PREFIX PREFIX=/usr/local endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) SCST_DIR := $(shell echo "$$PWD/../../scst/src") @@ -76,6 +78,7 @@ endif KDIR=$(KDIR) ../../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/scst/src/Makefile b/scst/src/Makefile index 9975a1f..a4469bf 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -61,8 +61,13 @@ ifeq ($(SCST_INC_DIR),) SCST_INC_DIR := ../include endif +INSTALL_MOD_DIR=extra + SCST_INTF_VER_FILE := $(SCST_INC_DIR)/scst_itf_ver.h +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) +INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst + $(SCST_INTF_VER_FILE): $(SCST_INC_DIR)/scst.h $(SCST_INC_DIR)/scst_const.h $(SCST_INC_DIR)/scst_user.h echo "/* Autogenerated, don't edit */" >$(SCST_INTF_VER_FILE) echo "" >>$(SCST_INTF_VER_FILE) @@ -94,11 +99,12 @@ install: all KDIR=$(KDIR) ../../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ - INSTALL_MOD_DIR=extra/dev_handlers \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)/dev_handlers \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install install -d $(INSTALL_DIR_H) @@ -133,9 +139,6 @@ uninstall: -/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER) rm -rf $(INSTALL_DIR_H) -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra -INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst - clean: rm -f $(SCST_INTF_VER_FILE) $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) $@ diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 4ecbb5f..8d5734d 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -48,7 +48,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra/dev_handlers + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) all: $(MAKE) -C $(KDIR) M=$(shell pwd) \ @@ -63,12 +65,13 @@ install: all KDIR=$(KDIR) ../../../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install uninstall: - rm -f $(INSTALL_DIR)/dev_handlers/scst_*.ko - -rmdir $(INSTALL_DIR)/dev_handlers 2>/dev/null + rm -f $(INSTALL_DIR)/scst_*.ko + -rmdir $(INSTALL_DIR) 2>/dev/null clean: $(MAKE) -C $(KDIR) M=$(shell pwd) $@ diff --git a/scst_local/Makefile b/scst_local/Makefile index f53473c..05e2c4c 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -29,7 +29,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) SCST_DIR := $(shell echo "$$PWD")/../scst/src @@ -41,6 +43,7 @@ install: all KDIR=$(KDIR) ../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install diff --git a/srpt/Makefile b/srpt/Makefile index 5f2a97a..86ba92f 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -31,7 +31,9 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra +INSTALL_MOD_DIR=extra + +INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR) SRC_FILES=$(wildcard */*.[ch]) @@ -125,6 +127,7 @@ install: all $(MAKE) -C $(KDIR) M=$(shell pwd)/src \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ CONFTEST_CFLAGS="$(CONFTEST_CFLAGS)" \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install |
From: Gleb C. <lna...@ya...> - 2023-06-14 13:50:10
|
Commit: 85e8086 GitHub URL: https://github.com/SCST-project/scst/commit/85e8086a7e49428666df6b139d53f1364a979b51 Author: Gleb Chesnokov Date: 2023-06-14T16:49:36+03:00 Log Message: ----------- Makefile: Implement several improvements to SCST Makefiles 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. Modified Paths: -------------- INSTALL.md | 2 +- Makefile | 7 +++++++ fcst/Makefile | 2 +- qla2x00t-32gbit/Makefile | 2 +- qla2x00t-32gbit/qla2x00-target/Makefile | 2 +- qla2x00t/Makefile | 2 +- qla2x00t/qla2x00-target/Makefile | 2 +- scst/src/Makefile | 15 +++++++++------ scst/src/dev_handlers/Makefile | 1 + scst_local/Makefile | 2 +- 10 files changed, 24 insertions(+), 13 deletions(-) =================================================================== diff --git a/INSTALL.md b/INSTALL.md index ce7c6b2..80c3472 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -22,7 +22,7 @@ If the following packages have not yet been installed, install these now: The next step is to build and install SCST. How to do that depends on whether or not your Linux distribution supports a package manager: - make release + make 2release if rpm -q glibc >/dev/null 2>&1; then rm -rf {,scstadmin/}rpmbuilddir make rpm diff --git a/Makefile b/Makefile index e81abe2..bdcca82 100644 --- a/Makefile +++ b/Makefile @@ -146,6 +146,13 @@ help: @echo " usr_install : usr target: install" @echo " usr_uninstall : usr target: uninstall" @echo "" + @echo " scst-rpm : make SCST RPM packages" + @echo " scst-dkms-rpm : make SCST DKMS RPM packages" + @echo " rpm : make both SCST and scstadmin RPM packages" + @echo " rpm-dkms : make both SCST DKMS and scstadmin RPM packages" + @echo "" + @echo " dpkg : make SCST dpkg packages" + @echo "" @echo " 2perf : changes debug state to full performance" @echo " 2release : changes debug state to release" @echo " 2debug : changes debug state to full debug" diff --git a/fcst/Makefile b/fcst/Makefile index 8c82d4a..7c39044 100644 --- a/fcst/Makefile +++ b/fcst/Makefile @@ -87,4 +87,4 @@ extraclean: clean release-archive: ../scripts/generate-release-archive fcst "$$(sed -n 's/^#define[[:blank:]]FT_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' fcst.h)" -.PHONY: all tgt install uninstall clean extraclean release-archive +.PHONY: all install uninstall clean extraclean release-archive diff --git a/qla2x00t-32gbit/Makefile b/qla2x00t-32gbit/Makefile index ddcaafc..cf4cea8 100644 --- a/qla2x00t-32gbit/Makefile +++ b/qla2x00t-32gbit/Makefile @@ -71,7 +71,7 @@ clean: extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean +.PHONY: all install uninstall clean extraclean endif diff --git a/qla2x00t-32gbit/qla2x00-target/Makefile b/qla2x00t-32gbit/qla2x00-target/Makefile index 886494d..574527e 100644 --- a/qla2x00t-32gbit/qla2x00-target/Makefile +++ b/qla2x00t-32gbit/qla2x00-target/Makefile @@ -102,4 +102,4 @@ endif extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean qla2xxx_scst +.PHONY: all install uninstall clean extraclean qla2xxx_scst diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index dfaa980..9806a81 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -69,7 +69,7 @@ clean: extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean +.PHONY: all install uninstall clean extraclean endif diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index b976e17..0fe34e1 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -101,4 +101,4 @@ endif extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean qla2xxx_scst +.PHONY: all install uninstall clean extraclean qla2xxx_scst diff --git a/scst/src/Makefile b/scst/src/Makefile index 236d1d2..9975a1f 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -35,6 +35,9 @@ SHELL=/bin/bash DEV_HANDLERS_DIR = dev_handlers +SCST_MOD_DIR := $(shell pwd) +SCST_DH_MOD_DIR := $(shell pwd)/$(DEV_HANDLERS_DIR) + ifeq ($(KVER),) ifeq ($(KDIR),) KVER := $(shell uname -r) @@ -73,13 +76,13 @@ $(SCST_INTF_VER_FILE): $(SCST_INC_DIR)/scst.h $(SCST_INC_DIR)/scst_const.h $(SCS all: $(SCST_INTF_VER_FILE) $(MAKE) -C certs KDIR=$(KDIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") - $(MAKE) -C $(KDIR) M=$(shell pwd) \ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") - $(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers \ + $(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") scst: - $(MAKE) -C $(KDIR) M=$(shell pwd) \ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") install: all @@ -89,12 +92,12 @@ install: all false; fi -rm -f $(INSTALL_DIR)/scsi_tgt.ko KDIR=$(KDIR) ../../scripts/sign-modules - $(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers \ + $(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ INSTALL_MOD_DIR=extra/dev_handlers \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install - $(MAKE) -C $(KDIR) M=$(shell pwd) \ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install @@ -135,7 +138,7 @@ INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst clean: rm -f $(SCST_INTF_VER_FILE) - $(MAKE) -C $(KDIR) M=$(shell pwd) $@ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) $@ $(MAKE) -C $(DEV_HANDLERS_DIR) $@ extraclean: clean diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 2be974b..4ecbb5f 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -68,6 +68,7 @@ install: all uninstall: rm -f $(INSTALL_DIR)/dev_handlers/scst_*.ko + -rmdir $(INSTALL_DIR)/dev_handlers 2>/dev/null clean: $(MAKE) -C $(KDIR) M=$(shell pwd) $@ diff --git a/scst_local/Makefile b/scst_local/Makefile index 4e7626f..f53473c 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -57,5 +57,5 @@ extraclean: clean release-archive: ../scripts/generate-release-archive scst_local "$$(sed -n 's/^#define[[:blank:]]SCST_LOCAL_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' scst_local.c)" -.PHONY: all tgt install uninstall clean extraclean +.PHONY: all install uninstall clean extraclean |
From: Gleb C. <lna...@ya...> - 2023-06-13 14:50:23
|
Commit: 3b0ab93 GitHub URL: https://github.com/SCST-project/scst/commit/3b0ab93c93b94d880f60fba76c8e9458cbf83ee1 Author: Gleb Chesnokov Date: 2023-06-13T17:49:50+03:00 Log Message: ----------- scst/include/backport.h: Unbreak the RHEL 9.3 build Fixes: https://github.com/SCST-project/scst/issues/167 Modified Paths: -------------- scst/include/backport.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 66671bc..6d0fd87 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -798,13 +798,15 @@ static inline void kvfree(void *addr) /* <linux/shrinker.h> */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 3)) /* * See also commit e33c267ab70d ("mm: shrinkers: provide shrinkers with * names") # v6.0. */ -static inline -int register_shrinker_backport(struct shrinker *shrinker, const char *fmt, ...) +static inline int +register_shrinker_backport(struct shrinker *shrinker, const char *fmt, ...) { /* * See also commit 1d3d4437eae1 ("vmscan: per-node deferred work") # v3.12 |
From: Gleb C. <lna...@ya...> - 2023-06-09 12:11:45
|
Commit: 1756a54 GitHub URL: https://github.com/SCST-project/scst/commit/1756a54367c3a46fa058618023f950abe0c6b7c9 Author: Gleb Chesnokov Date: 2023-06-09T15:11:18+03:00 Log Message: ----------- scst.spec.in, scst-dkms.spec.in: Unbreak the CentOS Stream 9 build Fixes: https://github.com/SCST-project/scst/issues/167 Modified Paths: -------------- scst-dkms.spec.in | 5 +++++ scst.spec.in | 5 +++++ 2 files changed, 10 insertions(+) =================================================================== diff --git a/scst-dkms.spec.in b/scst-dkms.spec.in index 848a3ea..ab43bb1 100644 --- a/scst-dkms.spec.in +++ b/scst-dkms.spec.in @@ -46,6 +46,10 @@ # Fedora %define kernel_devel_rpm kernel-devel %else +%if %([ %{kernel_rpm} = kernel-modules-core ]; echo $((1-$?))) +# CentOS Stream 9 +%define kernel_devel_rpm kernel-devel +%else %if %([ %{kernel_rpm} = kernel-uek-core ]; echo $((1-$?))) # UEK 7 %define kernel_devel_rpm kernel-uek-devel @@ -56,6 +60,7 @@ %endif %endif %endif +%endif %{echo:kernel_devel_rpm=%{kernel_devel_rpm} } %endif diff --git a/scst.spec.in b/scst.spec.in index b99bcb2..ba4f40d 100644 --- a/scst.spec.in +++ b/scst.spec.in @@ -51,6 +51,10 @@ # Fedora %define kernel_devel_rpm kernel-devel %else +%if %([ %{kernel_rpm} = kernel-modules-core ]; echo $((1-$?))) +# CentOS Stream 9 +%define kernel_devel_rpm kernel-devel +%else %if %([ %{kernel_rpm} = kernel-uek-core ]; echo $((1-$?))) # UEK 7 %define kernel_devel_rpm kernel-uek-devel @@ -61,6 +65,7 @@ %endif %endif %endif +%endif %{echo:kernel_devel_rpm=%{kernel_devel_rpm} } %endif |
From: Gleb C. <lna...@ya...> - 2023-06-05 10:53:08
|
Commit: e2a6774 GitHub URL: https://github.com/SCST-project/scst/commit/e2a6774a2e28c389a69a3525e9c653688fd31951 Author: Gleb Chesnokov Date: 2023-06-05T13:36:46+03:00 Log Message: ----------- scstadmin.spec: Replace custom Requires line with package names 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 Modified Paths: -------------- scstadmin/scstadmin.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/scstadmin/scstadmin.spec.in b/scstadmin/scstadmin.spec.in index 853c063..2016520 100644 --- a/scstadmin/scstadmin.spec.in +++ b/scstadmin/scstadmin.spec.in @@ -16,7 +16,7 @@ URL: http://scst.sourceforge.net/ Source: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build AutoReqProv: yes -Requires: %{expand:%%(for c in killall rm; do echo -n "$(which $c) "; done)} +Requires: psmisc, coreutils %description A tool for configuring SCST via the SCST sysfs interface. Allows to save, |
From: Gleb C. <lna...@ya...> - 2023-06-05 10:53:07
|
Commit: 1a4ecab GitHub URL: https://github.com/SCST-project/scst/commit/1a4ecab818f3d54b131655d5d604bc49d5648662 Author: Gleb Chesnokov Date: 2023-06-05T13:35:03+03:00 Log Message: ----------- qla2x00t-32gbit: Fix NULL pointer dereference in target mode 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 <gle...@sc...v> Link: https://lore.kernel.org/r/56b...@sc...v Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit d54820b22e40 upstream ] Fixes: https://github.com/SCST-project/scst/issues/156 Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 1 + qla2x00t-32gbit/qla_init.c | 9 +++------ qla2x00t-32gbit/qla_inline.h | 3 +++ qla2x00t-32gbit/qla_isr.c | 11 ++++------- 4 files changed, 11 insertions(+), 13 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index b403107..d4f7c4d 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -3848,6 +3848,7 @@ struct qla_qpair { uint64_t retry_term_jiff; struct qla_tgt_counters tgt_counters; uint16_t cpuid; + bool cpu_mapped; struct qla_fw_resources fwres ____cacheline_aligned; struct qla_buf_pool buf_pool; u32 cmd_cnt; diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index 8dc879c..b86f9af 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -9428,12 +9428,9 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos, qpair->req = ha->req_q_map[req_id]; qpair->rsp->req = qpair->req; qpair->rsp->qpair = qpair; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) && \ - (!defined(RHEL_RELEASE_CODE) || \ - RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 5)) - /* init qpair to this cpu. Will adjust at run time. */ - qla_cpu_update(qpair, raw_smp_processor_id()); -#endif + + if (!qpair->cpu_mapped) + qla_cpu_update(qpair, raw_smp_processor_id()); if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) { if (ha->fw_attributes & BIT_4) diff --git a/qla2x00t-32gbit/qla_inline.h b/qla2x00t-32gbit/qla_inline.h index c3f1b3b..b1bf22d 100644 --- a/qla2x00t-32gbit/qla_inline.h +++ b/qla2x00t-32gbit/qla_inline.h @@ -550,11 +550,14 @@ qla_mapq_init_qp_cpu_map(struct qla_hw_data *ha, if (!ha->qp_cpu_map) return; mask = pci_irq_get_affinity(ha->pdev, msix->vector_base0); + if (!mask) + return; qpair->cpuid = cpumask_first(mask); for_each_cpu(cpu, mask) { ha->qp_cpu_map[cpu] = qpair; } msix->cpuid = qpair->cpuid; + qpair->cpu_mapped = true; #endif } diff --git a/qla2x00t-32gbit/qla_isr.c b/qla2x00t-32gbit/qla_isr.c index 9a57920..646a4eb 100644 --- a/qla2x00t-32gbit/qla_isr.c +++ b/qla2x00t-32gbit/qla_isr.c @@ -3791,14 +3791,11 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, if (!ha->flags.fw_started) return; - if (rsp->qpair->cpuid != raw_smp_processor_id() || - !rsp->qpair->rcv_intr) { + if (rsp->qpair->cpuid != raw_smp_processor_id() || !rsp->qpair->rcv_intr) { rsp->qpair->rcv_intr = 1; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) && \ - (!defined(RHEL_RELEASE_CODE) || \ - RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 5)) - qla_cpu_update(rsp->qpair, raw_smp_processor_id()); -#endif + + if (!rsp->qpair->cpu_mapped) + qla_cpu_update(rsp->qpair, raw_smp_processor_id()); } #define __update_rsp_in(_is_shadow_hba, _rsp, _rsp_in) \ |
From: Gleb C. <lna...@ya...> - 2023-06-05 10:52:23
|
Commit: 7d1afe8 GitHub URL: https://github.com/SCST-project/scst/commit/7d1afe8a99206da5040d8d6496e6855852fe5553 Author: Gleb Chesnokov Date: 2023-06-05T13:35:03+03:00 Log Message: ----------- qla2x00t-32gbit: Drop redundant pci_enable_pcie_error_reporting() 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 <bhe...@go...> Link: https://lore.kernel.org/r/202...@ke... Cc: Nilesh Javali <nj...@ma...> Cc: GR-...@ma... Signed-off-by: Martin K. Petersen <mar...@or...> [ commit c5c440bbff86 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 1 - qla2x00t-32gbit/qla_os.c | 6 ------ 2 files changed, 7 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index e25f8ea..437200a 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -22,7 +22,6 @@ #include <linux/interrupt.h> #include <linux/workqueue.h> #include <linux/firmware.h> -#include <linux/aer.h> #include <linux/mutex.h> #include <linux/btree.h> #include <linux/version.h> diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 4b4b19f..fc071df 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -3010,9 +3010,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ql2xallocfwdump = 0; } - /* This may fail but that's ok */ - pci_enable_pcie_error_reporting(pdev); - ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL); if (!ha) { ql_log_pci(ql_log_fatal, pdev, 0x0009, @@ -4022,8 +4019,6 @@ qla2x00_remove_one(struct pci_dev *pdev) pci_release_selected_regions(ha->pdev, ha->bars); kfree(ha); - pci_disable_pcie_error_reporting(pdev); - pci_disable_device(pdev); } @@ -6899,7 +6894,6 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work) qla2x00_unmap_iobases(ha); pci_release_selected_regions(ha->pdev, ha->bars); - pci_disable_pcie_error_reporting(pdev); pci_disable_device(pdev); /* |
From: Gleb C. <lna...@ya...> - 2023-06-05 10:47:48
|
Commit: 596800c GitHub URL: https://github.com/SCST-project/scst/commit/596800ce2d75ea9dd01e68c8a14b5baa0e6bd6e5 Author: Gleb Chesnokov Date: 2023-06-05T13:35:03+03:00 Log Message: ----------- qla2x00t-32gbit: Backport to older kernel versions 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. Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 6 ++++++ qla2x00t-32gbit/qla_os.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index 437200a..b403107 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -6,6 +6,9 @@ #ifndef __QLA_DEF_H #define __QLA_DEF_H +#ifndef INSIDE_KERNEL_TREE +#include <linux/version.h> +#endif #include <linux/kernel.h> #include <linux/init.h> #include <linux/types.h> @@ -22,6 +25,9 @@ #include <linux/interrupt.h> #include <linux/workqueue.h> #include <linux/firmware.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) +#include <linux/aer.h> +#endif #include <linux/mutex.h> #include <linux/btree.h> #include <linux/version.h> diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index fc071df..490568e 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -3010,6 +3010,11 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ql2xallocfwdump = 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + /* This may fail but that's ok */ + pci_enable_pcie_error_reporting(pdev); +#endif + ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL); if (!ha) { ql_log_pci(ql_log_fatal, pdev, 0x0009, @@ -4019,6 +4024,10 @@ qla2x00_remove_one(struct pci_dev *pdev) pci_release_selected_regions(ha->pdev, ha->bars); kfree(ha); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + pci_disable_pcie_error_reporting(pdev); +#endif + pci_disable_device(pdev); } @@ -6894,6 +6903,9 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work) qla2x00_unmap_iobases(ha); pci_release_selected_regions(ha->pdev, ha->bars); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + pci_disable_pcie_error_reporting(pdev); +#endif pci_disable_device(pdev); /* |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:43:03
|
Commit: 28e8d31 GitHub URL: https://github.com/SCST-project/scst/commit/28e8d31f86e4f4898457d25fedc63df82a1e7a3c Author: Gleb Chesnokov Date: 2023-05-10T13:39:06+03:00 Log Message: ----------- scst: Unbreak the RHEL 9.2 build See also PR https://github.com/SCST-project/scst/pull/145. Modified Paths: -------------- iscsi-scst/include/iscsi_scst.h | 10 +++++++++- qla2x00t-32gbit/qla_os.c | 8 +++++--- scst/src/dev_handlers/scst_vdisk.c | 8 ++++++-- scst/src/scst_lib.c | 12 ++++++++---- scst_local/scst_local.c | 8 ++++++-- 5 files changed, 34 insertions(+), 12 deletions(-) =================================================================== diff --git a/iscsi-scst/include/iscsi_scst.h b/iscsi-scst/include/iscsi_scst.h index 486c128..985621c 100644 --- a/iscsi-scst/include/iscsi_scst.h +++ b/iscsi-scst/include/iscsi_scst.h @@ -20,6 +20,12 @@ #include <linux/uaccess.h> /* mm_segment_t */ #include <linux/version.h> +#ifdef INSIDE_KERNEL_TREE +#include <scst/backport.h> +#else +#include "backport.h" +#endif + /* <asm/uaccess.h> */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) @@ -33,7 +39,9 @@ * to write kernel code that is compatible with all kernel versions. */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) || \ + (defined(RHEL_RELEASE_CODE) && \ + RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(9, 2)) /* * Backport mm_segment_t to save compatibility with older kernel versions. * diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 302ae70..16917bc 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -375,14 +375,16 @@ static void qla2x00_clear_drv_active(struct qla_hw_data *); static void qla2x00_free_device(scsi_qla_host_t *); #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) /* * See also commit a4e1d0b76e7b ("block: Change the return type of * blk_mq_map_queues() into void") # v6.1. */ -#define MAP_QUEUES_RET void -#else +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #define MAP_QUEUES_RET int +#else +#define MAP_QUEUES_RET void #endif static MAP_QUEUES_RET qla2xxx_map_queues(struct Scsi_Host *shost); diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 85a3931..54fbc70 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -3157,7 +3157,9 @@ struct bio_vec *vdisk_map_pages_to_bvec(struct bio_vec *bvec, struct page *page, } static void fileio_async_complete(struct kiocb *iocb, long ret -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) , long ret2 #endif ) @@ -3267,7 +3269,9 @@ static enum compl_status_e fileio_exec_async(struct vdisk_cmd_params *p) if (p->async.bvec != p->async.small_bvec) kfree(p->async.bvec); if (ret != -EIOCBQUEUED) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) fileio_async_complete(iocb, ret, 0); #else fileio_async_complete(iocb, ret); diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 29f1744..7adc568 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8560,14 +8560,16 @@ out: static void scsi_end_async(struct request *req, int error) #else -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) /* * See also commit de671d6116b5 ("block: change request end_io handler to pass * back a return value") # v6.1. */ -#define RQ_END_IO_RET enum rq_end_io_ret -#else +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #define RQ_END_IO_RET void +#else +#define RQ_END_IO_RET enum rq_end_io_ret #endif static RQ_END_IO_RET scsi_end_async(struct request *req, blk_status_t error) @@ -8619,7 +8621,9 @@ static RQ_END_IO_RET scsi_end_async(struct request *req, blk_status_t error) kmem_cache_free(scsi_io_context_cache, sioc); -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) && \ (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8) /* See also commit 92bc5a24844a ("block: remove __blk_put_request()") */ diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 1c168e2..e9a0390 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1462,8 +1462,12 @@ out: return ret; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) -/* See also commit fc7a6209d571 ("bus: Make remove callback return void") */ +/* + * See also commit fc7a6209d571 ("bus: Make remove callback return void") + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #define DRIVER_REMOVE_RET int #else #define DRIVER_REMOVE_RET void |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:42:50
|
Commit: b4e012c GitHub URL: https://github.com/SCST-project/scst/commit/b4e012ca423441782f4396d5299623a710258e5c Author: Gleb Chesnokov Date: 2023-05-10T13:39:06+03:00 Log Message: ----------- scst/include/backport.h: Fix the RHEL 9.0 build Commit 9be09fd68b46 ("scst/include/backport.h: Fix building on RHEL 8.8") fixed the build for RHEL 8.8, but at the same time, it broke the build for RHEL 9.0. Modified Paths: -------------- scst/include/backport.h | 42 ++++++++------- 1 file changed, 22 insertions(+), 20 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 2e154ce..c871706 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1464,10 +1464,8 @@ static inline void scsi_build_sense(struct scsi_cmnd *scmd, int desc, #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \ (!defined(RHEL_RELEASE_CODE) || \ - RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) - -#if (!defined(RHEL_RELEASE_CODE) || \ - RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7)) + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7) || \ + RHEL_RELEASE_CODE -0 == RHEL_RELEASE_VERSION(9, 0)) /* * See also 51f3a4788928 ("scsi: core: Introduce the scsi_cmd_to_rq() * function"). @@ -1478,27 +1476,18 @@ static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd) } #endif -/* - * See also commit c611529e7cd3 ("sd: Honor block layer integrity handling - * flags"; v3.18). - */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) -static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd) -{ - /* To do: backport this function properly. */ - WARN_ON_ONCE(true); - return 512; -} -#endif - /* * See also commits 7ba46799d346 ("scsi: core: Add scsi_prot_ref_tag() * helper") and ddd0bc756983 ("block: move ref_tag calculation func to the * block layer"; v4.19). */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || \ - (defined(RHEL_RELEASE_CODE) && \ - RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7))) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || \ + (defined(RHEL_RELEASE_CODE) && \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7)) static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd) { #if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 7 @@ -1513,6 +1502,19 @@ static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd) #endif #endif +/* + * See also commit c611529e7cd3 ("sd: Honor block layer integrity handling + * flags"; v3.18). + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) +static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd) +{ + /* To do: backport this function properly. */ + WARN_ON_ONCE(true); + return 512; +} +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \ (!defined(RHEL_RELEASE_CODE) || \ RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:42:40
|
Commit: 951e34f GitHub URL: https://github.com/SCST-project/scst/commit/951e34f5f8e2ed24d6981fa27a8c2b7d44379167 Author: Robert Blackhart Date: 2023-05-10T13:39:05+03:00 Log Message: ----------- scst/include/backport.h: Fix building on RHEL 8.8 This fixes a compilation issue with RHEL 8.8 in scst/include/backport.h. This is the same issue as was seen for RHEL 8.7 in #77 Modified Paths: -------------- scst/include/backport.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 1e7e1cc..2e154ce 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1467,7 +1467,7 @@ static inline void scsi_build_sense(struct scsi_cmnd *scmd, int desc, RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) #if (!defined(RHEL_RELEASE_CODE) || \ - RHEL_RELEASE_CODE -0 != RHEL_RELEASE_VERSION(8, 7)) + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7)) /* * See also 51f3a4788928 ("scsi: core: Introduce the scsi_cmd_to_rq() * function"). @@ -1498,7 +1498,7 @@ static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd) */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || \ (defined(RHEL_RELEASE_CODE) && \ - RHEL_RELEASE_CODE -0 != RHEL_RELEASE_VERSION(8, 7))) + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7))) static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd) { #if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 7 |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:42:29
|
Commit: 6485007 GitHub URL: https://github.com/SCST-project/scst/commit/648500799d9ccb9163bf906f1808d939e27ff5fc Author: Gleb Chesnokov Date: 2023-05-10T13:39:05+03:00 Log Message: ----------- scst/include/backport.h: Fix the CentOS / RHEL 7.[012345] builds See also PR https://github.com/SCST-project/scst/pull/132. Modified Paths: -------------- scst/include/backport.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index dd98d9b..1e7e1cc 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -576,8 +576,9 @@ static inline long get_user_pages_backport(unsigned long start, /* <linux/kobject_ns.h> */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) && \ - (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 6)) /* * See also commit 5f256becd868 ("[NET]: Basic network namespace * infrastructure."; v2.6.24). a685e08987d1 ("Delay struct net freeing while |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:42:15
|
Commit: 164a58f GitHub URL: https://github.com/SCST-project/scst/commit/164a58fa3d003514cb26674c74c33ce850288fb0 Author: Gleb Chesnokov Date: 2023-05-10T13:39:05+03:00 Log Message: ----------- scst_lib: Fix bio_kmalloc usage for RHEL 9.1 See also commit 87340a8427d2 ("scst_lib: Fix bio_kmalloc usage to match change in Linux kernel v5.19"). Modified Paths: -------------- scst/src/scst_lib.c | 88 +++++++++------ 1 file changed, 56 insertions(+), 32 deletions(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 4e0f47b..29f1744 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -7938,6 +7938,8 @@ static void blk_free_kern_sg_work(struct blk_kern_sg_work *bw) return; } +static inline void scst_free_bio(struct bio *bio); + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) static void blk_bio_map_kern_endio(struct bio *bio, int err) { @@ -7968,16 +7970,7 @@ static void blk_bio_map_kern_endio(struct bio *bio) } } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) - /* - * See commit 066ff571011d ("block: turn bio_kmalloc into a simple - * kmalloc wrapper"). - */ - bio_uninit(bio); - kfree(bio); -#else - bio_put(bio); -#endif + scst_free_bio(bio); return; } @@ -8139,6 +8132,57 @@ scst_free_passthrough_request(struct request *rq) #endif } +/** + * scst_alloc_bio - Allocate a bio. + * @nr_vecs: Number of bio_vecs to allocate. + * @gfp_mask: The GFP_* mask given to the slab allocator. + * + * Returns + * Pointer to new bio on success, NULL on failure. + */ +static inline struct bio * +scst_alloc_bio(unsigned short nr_vecs, gfp_t gfp_mask) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) + return bio_kmalloc(gfp_mask, nr_vecs); +#else + /* + * See also commit 066ff571011d ("block: turn bio_kmalloc into a + * simple kmalloc wrapper"). + */ + struct bio *bio; + + bio = bio_kmalloc(nr_vecs, gfp_mask); + if (bio) + bio_init(bio, NULL, bio->bi_inline_vecs, nr_vecs, 0); + + return bio; +#endif +} + +/** + * scst_free_bio - Free a bio that was allocated with scst_alloc_bio(). + * @bio: bio pointer. + */ +static inline void +scst_free_bio(struct bio *bio) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) + bio_put(bio); +#else + /* + * See also commit 066ff571011d ("block: turn bio_kmalloc into a + * simple kmalloc wrapper"). + */ + bio_uninit(bio); + kfree(bio); +#endif +} + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) || \ (defined(CONFIG_SUSE_KERNEL) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) static struct request *blk_make_request(struct request_queue *q, @@ -8251,22 +8295,11 @@ static struct request *__blk_map_kern_sg(struct request_queue *q, int rc; if (need_new_bio) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) - /* - * See commit 066ff571011d ("block: turn - * bio_kmalloc into a simple kmalloc wrapper"). - */ - bio = bio_kmalloc(max_nr_vecs, gfp_mask); -#else - bio = bio_kmalloc(gfp_mask, max_nr_vecs); -#endif + bio = scst_alloc_bio(max_nr_vecs, gfp_mask); if (bio == NULL) { rq = ERR_PTR(-ENOMEM); goto out_free_bios; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) - bio_init(bio, NULL, bio->bi_inline_vecs, max_nr_vecs, 0); -#endif if (!reading) #if (!defined(CONFIG_SUSE_KERNEL) && \ @@ -8345,16 +8378,7 @@ out_free_bios: while (hbio != NULL) { bio = hbio; hbio = hbio->bi_next; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) - /* - * See commit 066ff571011d ("block: turn bio_kmalloc into a - * simple kmalloc wrapper"). - */ - bio_uninit(bio); - kfree(bio); -#else - bio_put(bio); -#endif + scst_free_bio(bio); } goto out; } |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:41:59
|
Commit: ae5aa8c GitHub URL: https://github.com/SCST-project/scst/commit/ae5aa8ca36b331b89961d60baf34b48b156c5cff Author: Brian Meagher Date: 2023-05-10T13:39:05+03:00 Log Message: ----------- scst_lib: Fix bio_kmalloc usage to match change in Linux kernel v5.19 In kernel commit 066ff571011d ("block: turn bio_kmalloc into a simple kmalloc wrapper"), the order of arguments to bio_kmalloc changed, as did its semantics. Modified Paths: -------------- scst/src/scst_lib.c | 29 +++++++++++++++ 1 file changed, 29 insertions(+) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 559cd91..4e0f47b 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -7968,7 +7968,16 @@ static void blk_bio_map_kern_endio(struct bio *bio) } } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) + /* + * See commit 066ff571011d ("block: turn bio_kmalloc into a simple + * kmalloc wrapper"). + */ + bio_uninit(bio); + kfree(bio); +#else bio_put(bio); +#endif return; } @@ -8242,11 +8251,22 @@ static struct request *__blk_map_kern_sg(struct request_queue *q, int rc; if (need_new_bio) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) + /* + * See commit 066ff571011d ("block: turn + * bio_kmalloc into a simple kmalloc wrapper"). + */ + bio = bio_kmalloc(max_nr_vecs, gfp_mask); +#else bio = bio_kmalloc(gfp_mask, max_nr_vecs); +#endif if (bio == NULL) { rq = ERR_PTR(-ENOMEM); goto out_free_bios; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) + bio_init(bio, NULL, bio->bi_inline_vecs, max_nr_vecs, 0); +#endif if (!reading) #if (!defined(CONFIG_SUSE_KERNEL) && \ @@ -8325,7 +8345,16 @@ out_free_bios: while (hbio != NULL) { bio = hbio; hbio = hbio->bi_next; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) + /* + * See commit 066ff571011d ("block: turn bio_kmalloc into a + * simple kmalloc wrapper"). + */ + bio_uninit(bio); + kfree(bio); +#else bio_put(bio); +#endif } goto out; } |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:41:44
|
Commit: 5b9d4d0 GitHub URL: https://github.com/SCST-project/scst/commit/5b9d4d03d07dbd449371544d5d1f540a1eb22d10 Author: Brian Meagher Date: 2023-05-10T13:39:05+03:00 Log Message: ----------- scst_lib: Fix sense data regression for pass-through commands. In kernel commit 772c8f6f3bbd ("Merge tag 'for-4.11/linus-merge-signed' * of git://git.kernel.dk/linux-block") both scsi_init_rq and scsi_init_request (later renamed to scsi_mq_init_request in e7008ff5c61a) initialize the scsi_request sense buffer, so we don't need to (nor should) provide our own. Modified Paths: -------------- scst/src/scst_lib.c | 26 ++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 178200a..559cd91 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -76,7 +76,17 @@ static void scst_free_acn(struct scst_acn *acn, bool reassign); struct scsi_io_context { void *data; void (*done)(void *data, char *sense, int result, int resid); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + /* + * See commit 772c8f6f3bbd ("Merge tag 'for-4.11/linus-merge-signed' + * of git://git.kernel.dk/linux-block") + * + * Both scsi_init_rq and scsi_init_request (later renamed to + * scsi_mq_init_request in e7008ff5c61a) initialize the scsi_request + * sense buffer, so we don't need to (nor should) provide our own. + */ char sense[SCST_SENSE_BUFFERSIZE]; +#endif }; static struct kmem_cache *scsi_io_context_cache; static struct workqueue_struct *scst_release_acg_wq; @@ -8530,6 +8540,7 @@ static RQ_END_IO_RET scsi_end_async(struct request *req, blk_status_t error) if (sioc->done) { int resid_len; long result; + char *sense; #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) result = scsi_req(req)->result; @@ -8544,11 +8555,13 @@ static RQ_END_IO_RET scsi_end_async(struct request *req, blk_status_t error) #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) resid_len = scsi_req(req)->resid_len; + sense = SREQ_SENSE(scsi_req(req)); #else resid_len = req->resid_len; + sense = sioc->sense; #endif - sioc->done(sioc->data, sioc->sense, result, resid_len); + sioc->done(sioc->data, sense, result, resid_len); } kmem_cache_free(scsi_io_context_cache, sioc); @@ -8655,8 +8668,19 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data, memset(SREQ_CP(req), 0, MAX_COMMAND_SIZE); /* ATAPI hates garbage after CDB */ memcpy(SREQ_CP(req), cmd->cdb, cmd->cdb_len); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + /* + * See commit 772c8f6f3bbd ("Merge tag 'for-4.11/linus-merge-signed' + * of git://git.kernel.dk/linux-block") + * + * Both scsi_init_rq and scsi_init_request (later renamed to + * scsi_mq_init_request in e7008ff5c61a) initialize the scsi_request + * sense buffer, so we don't need to (nor should) provide our own. + */ SREQ_SENSE(req) = sioc->sense; req->sense_len = sizeof(sioc->sense); +#endif + rq->timeout = cmd->timeout; #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) req->retries = cmd->retries; |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:41:31
|
Commit: 2ec0fcc GitHub URL: https://github.com/SCST-project/scst/commit/2ec0fcc90330a89c51b15d5974609d4462be0beb Author: Gleb Chesnokov Date: 2023-05-10T13:34:15+03:00 Log Message: ----------- github: Add a job name for the mail notification action Enhance the mail notification GitHub action by including the commit message in the job name. Modified Paths: -------------- .github/workflows/mail_notification.yml | 1 + 1 file changed, 1 insertion(+) =================================================================== diff --git a/.github/workflows/mail_notification.yml b/.github/workflows/mail_notification.yml index e66ecc8..ee54d3b 100644 --- a/.github/workflows/mail_notification.yml +++ b/.github/workflows/mail_notification.yml @@ -9,6 +9,7 @@ on: jobs: send_mails: + name: ${{matrix.commit.message}} runs-on: ubuntu-latest strategy: max-parallel: 1 |
From: Gleb C. <lna...@ya...> - 2023-05-10 10:41:20
|
Commit: f52cd09 GitHub URL: https://github.com/SCST-project/scst/commit/f52cd09e3a044b77a6472045f7c67e05bd971104 Author: Gleb Chesnokov Date: 2023-05-10T13:34:13+03:00 Log Message: ----------- github: Fix deprecated set-output commands set-output is being deprecated: "Starting 1st June 2023 workflows using save-state or set-output commands via stdout will fail with an error." So fix this by using the GITHUB_OUTPUT environment files instead. Modified Paths: -------------- .github/workflows/coverity.yml | 2 +- .github/workflows/mail_notification.yml | 38 +++++++-------- 2 files changed, 18 insertions(+), 22 deletions(-) =================================================================== diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 083ef0f..ebdc75f 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -19,7 +19,7 @@ jobs: revision="$(git rev-parse --short HEAD)" version="$version_without_revesion-$revision" - echo ::set-output name=version::"$version" + echo "version=$version" >> $GITHUB_OUTPUT - name: Run Coverity Build uses: vapier/coverity-scan-action@v1 diff --git a/.github/workflows/mail_notification.yml b/.github/workflows/mail_notification.yml index 36ff772..e66ecc8 100644 --- a/.github/workflows/mail_notification.yml +++ b/.github/workflows/mail_notification.yml @@ -24,40 +24,36 @@ jobs: - name: Get short ref id: get_short_ref run: | - echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} + echo "short_ref=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Get commit id - id: get_comm_id + id: get_commit_id run: | - echo ::set-output name=comm_id::$(git rev-parse --short HEAD) + echo "commit_id=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Get commit message - id: get_comm_message + id: get_commit_message run: | - echo ::set-output name=comm_message::$(git log --format=%s -n 1 HEAD) + echo "commit_message=$(git log --format=%s -n 1 HEAD)" >> $GITHUB_OUTPUT - name: Get list of files id: get_list_files run: | - files="$(git diff-tree --no-commit-id --stat --stat-name-width=60 --stat-graph-width=15 -r HEAD)" + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) - files="${files//'%'/'%25'}" - files="${files//$'\n'/'%0A'}" - files="${files//$'\r'/'%0D'}" - - echo ::set-output name=files::"$files" + echo "files<<$EOF" >> $GITHUB_OUTPUT + echo "$(git diff-tree --no-commit-id --stat --stat-name-width=60 --stat-graph-width=15 -r HEAD)" >> $GITHUB_OUTPUT + echo "$EOF" >> $GITHUB_OUTPUT - name: Get commit diff - id: get_comm_diff + id: get_commit_diff run: | if [ $(git show --no-patch --format="%P" | wc -w) -eq 1 ]; then - diff="$(git --no-pager diff -p HEAD^1)" - - diff="${diff//'%'/'%25'}" - diff="${diff//$'\n'/'%0A'}" - diff="${diff//$'\r'/'%0D'}" + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) - echo ::set-output name=comm_diff::"$diff" + echo "commit_diff<<$EOF" >> $GITHUB_OUTPUT + echo "$(git --no-pager diff -p HEAD^1)" >> $GITHUB_OUTPUT + echo "$EOF" >> $GITHUB_OUTPUT fi - name: Send mail @@ -73,7 +69,7 @@ jobs: password: ${{secrets.MAIL_SERVER_PASSWORD}} # Required mail subject: subject: | - [${{steps.get_short_ref.outputs.short_ref}}] ${{steps.get_comm_message.outputs.comm_message}} + [${{steps.get_short_ref.outputs.short_ref}}] ${{steps.get_commit_message.outputs.commit_message}} # Required recipients' addresses: to: scs...@li... # Required sender full name (address can be skipped): @@ -83,7 +79,7 @@ jobs: # Optional plain body: body: | - Commit: ${{steps.get_comm_id.outputs.comm_id}} + Commit: ${{steps.get_commit_id.outputs.commit_id}} GitHub URL: ${{matrix.commit.url}} Author: ${{matrix.commit.author.name}} Date: ${{matrix.commit.timestamp}} @@ -96,7 +92,7 @@ jobs: ${{steps.get_list_files.outputs.files}} =================================================================== - ${{steps.get_comm_diff.outputs.comm_diff}} + ${{steps.get_commit_diff.outputs.commit_diff}} # Optional unsigned/invalid certificates allowance: ignore_cert: true |