[Devel] [PATCH RH8 2/8] ploop: Move alloc wq up
Kirill Tkhai
ktkhai at virtuozzo.com
Tue May 11 11:45:54 MSK 2021
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/md/dm-ploop-target.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index 155327242fc5..a07cee3fea46 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -241,6 +241,13 @@ static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto err;
}
+ ploop->wq = alloc_ordered_workqueue("dm-" DM_MSG_PREFIX, WQ_MEM_RECLAIM);
+ if (!ploop->wq) {
+ ti->error = "could not create workqueue for metadata object";
+ ret = -ENOMEM;
+ goto err;
+ }
+
/*
* We do not add FMODE_EXCL, because further open_table_device()
* unconditionally adds it. See call stack.
@@ -258,14 +265,6 @@ static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto err;
}
- ret = -ENOMEM;
-
- ploop->wq = alloc_ordered_workqueue("dm-" DM_MSG_PREFIX, WQ_MEM_RECLAIM);
- if (!ploop->wq) {
- ti->error = "could not create workqueue for metadata object";
- goto err;
- }
-
ret = ploop_add_deltas_stack(ploop, &argv[2], argc - 2);
if (ret)
goto err;
More information about the Devel
mailing list