[RHEL8,COMMIT] dm-ploop: Add PERCPU_REF_ALLOW_REINIT for refcounter

Submitted by Konstantin Khorenko on Dec. 7, 2020, 5:31 p.m.

Details

Message ID 202012071731.0B7HV6Ft1821169@finist-co8.sw.ru
State New
Series "dm-ploop: Add PERCPU_REF_ALLOW_REINIT for refcounter"
Headers show

Commit Message

Konstantin Khorenko Dec. 7, 2020, 5:31 p.m.
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.el8
------>
commit b304f2465c4e01078d261734ed7c0f106d6928ae
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Fri Dec 4 19:32:41 2020 +0300

    dm-ploop: Add PERCPU_REF_ALLOW_REINIT for refcounter
    
    This is for RHEL8.4 rebase. Without the flag,
    refcounter memory is freed early.
    
    https://jira.sw.ru/browse/PSBM-123433
    
    Fixes: 7264d1dd954a ("dm: Interpreter of ploop1 format (ploop driver)")
    
    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;

Comments

Kirill Tkhai Dec. 8, 2020, 8:06 a.m.
On 07.12.2020 20:31, Konstantin Khorenko wrote:
> The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
> after rh8-4.18.0-240.1.1.el8
> ------>
> commit b304f2465c4e01078d261734ed7c0f106d6928ae
> Author: Kirill Tkhai <ktkhai@virtuozzo.com>
> Date:   Fri Dec 4 19:32:41 2020 +0300
> 
>     dm-ploop: Add PERCPU_REF_ALLOW_REINIT for refcounter
>     
>     This is for RHEL8.4 rebase. Without the flag,
>     refcounter memory is freed early.
>     
>     https://jira.sw.ru/browse/PSBM-123433
>     
>     Fixes: 7264d1dd954a ("dm: Interpreter of ploop1 format (ploop driver)")

This fixes not this patch. This fixes rebase to RH branch-rh8-4.18.0-240.1.1.vz8.5.x

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