]> git.baikalelectronics.ru Git - kernel.git/commit
rnbd-clt: don't free rsp in msg_open_conf for map scenario
authorGuoqing Jiang <guoqing.jiang@linux.dev>
Wed, 6 Jul 2022 13:31:46 +0000 (21:31 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:14:45 +0000 (17:14 -0600)
commit5d58419b476575c2169fa17072a808400618b3d4
tree4b2eb6f1b275e2bfd308ee4b3f2196902d272b9d
parent96325c955e6772d8550a0e88eb709b6d1ee91444
rnbd-clt: don't free rsp in msg_open_conf for map scenario

For map scenario, rsp is freed in two places:

1. msg_open_conf frees rsp if rtrs_clt_request returns 0.

2. Otherwise, rsp is freed by the call sites of rtrs_clt_request.

Now, We'd like to control full lifecycle of rsp in rnbd_clt_map_device,
with that, it is feasible to pass rsp to rnbd_client_setup_device in
next commit.

For 1, it is possible to free rsp from the caller of send_usr_msg
because of the synchronization of iu->comp.wait. And we put iu later
in rnbd_clt_map_device to ensure order of release rsp and iu.

Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Link: https://lore.kernel.org/r/20220706133152.12058-3-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/rnbd/rnbd-clt.c