]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Tue, 2 Aug 2022 23:14:50 +0000 (17:14 -0600)
commit361f4daa06c3652035a0db48bacf5f48cf6cc03d
tree84ba1c800f62dec5503a16c3f217d8f699ca9288
parent88e6feb52c6470c352d2b6527c2a54d415522894
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: 01651ec2a58e ("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