mbox series

[v2,0/3] fix races between nbd setup and module removal

Message ID 20210904122519.1963983-1-houtao1@huawei.com (mailing list archive)
Headers show
Series fix races between nbd setup and module removal | expand

Message

Hou Tao Sept. 4, 2021, 12:25 p.m. UTC
Hi,

The patch series aims to fix the races between nbd setup and module
removal which may lead to oops. Patch #1 is just replacing
printk(KERN_ERR "nbd: ...") by pr_err("...") which makes it easier
to add error message in patch #3. Patch #2 serializes the concurrently
calling of nbd_genl_connect() and nbd_cleanup(), and patch #3 fixes race
between nbd_alloc_config() and nbd_cleanup().

Any comments are welcome.

Regards,
Tao

ChangeLog:
v2:
  * add a new patch "use pr_err to output error message"
  * add the missing error message in patch 3.

v1: https://www.spinics.net/lists/linux-block/msg72995.html

Hou Tao (3):
  nbd: use pr_err to output error message
  nbd: call genl_unregister_family() first in nbd_cleanup()
  nbd: fix race between nbd_alloc_config() and module removal

 drivers/block/nbd.c | 70 ++++++++++++++++++++++++++++-----------------
 1 file changed, 44 insertions(+), 26 deletions(-)