block/rnbd-srv: Set keep_id to true after mutex_trylock
authorMd Haris Iqbal <haris.iqbal@ionos.com>
Thu, 7 Jul 2022 14:31:21 +0000 (16:31 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 7 Jul 2022 23:29:51 +0000 (17:29 -0600)
commit5ba7b490d9fce87b2aea9de27e13da6ef5300a17
tree109e67618f24c52f5ec8da3e83c3dae82a13424d
parent3b56590b1715b998cb5c73a5bd2e9d340ccb42dc
block/rnbd-srv: Set keep_id to true after mutex_trylock

After setting keep_id if the mutex trylock fails, the keep_id stays set
for the rest of the sess_dev lifetime.

Therefore, set keep_id to true after mutex_trylock succeeds, so that a
failure of trylock does'nt touch keep_id.

Fixes: b168e1d85cf3 ("block/rnbd-srv: Prevent a deadlock generated by accessing sysfs in parallel")
Cc: gi-oh.kim@ionos.com
Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Link: https://lore.kernel.org/r/20220707143122.460362-2-haris.iqbal@ionos.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/rnbd/rnbd-srv.c