[RH8] dm-ploop: Add PERCPU_REF_ALLOW_REINIT for refcounter

Submitted by Kirill Tkhai on Dec. 4, 2020, 4:32 p.m.

Details

Message ID 160709955774.492651.3426221205177063363.stgit@localhost.localdomain
State New
Series "dm-ploop: Add PERCPU_REF_ALLOW_REINIT for refcounter"
Headers show

Commit Message

Kirill Tkhai Dec. 4, 2020, 4:32 p.m.
This is for RHEL8.4 rebase. Without the flag,
refcounter memory is freed early.

https://jira.sw.ru/browse/PSBM-123433

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/md/dm-ploop-target.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index 986617dc1eb8..591f583bc324 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -145,7 +145,7 @@  static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	for (i = 0; i < 2; i++) {
 		release = i ? inflight_bios_ref_exit1 : inflight_bios_ref_exit0;
 		if (percpu_ref_init(&ploop->inflight_bios_ref[i], release,
-				    0, GFP_KERNEL)) {
+				    PERCPU_REF_ALLOW_REINIT, GFP_KERNEL)) {
 			ret = -ENOMEM;
 			ti->error = "could not alloc percpu_ref";
 			goto err;