lightnvm: prevent target type module removal when in use
authorRakesh Pandit <rakesh@tuxera.com>
Fri, 13 Oct 2017 12:45:50 +0000 (14:45 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Oct 2017 14:34:57 +0000 (08:34 -0600)
commit900148296b78c61aa8c443dc594c0da968c3be53
tree916dfc2000208ddb8cc5e829ddef190cf9049cff
parent47bc227deedbcf3ac214a2d922c28dfa5e403f09
lightnvm: prevent target type module removal when in use

If target type module e.g. pblk here is unloaded (rmmod) while module
is in use (after creating target) system crashes.  We fix this by
using module API refcnt.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/core.c
drivers/lightnvm/pblk-init.c
include/linux/lightnvm.h