]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/zpool: prevent zbud/zsmalloc from unloading when used
authorDan Streetman <ddstreet@ieee.org>
Thu, 26 Jun 2014 00:42:46 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:46 +0000 (10:42 +1000)
commit04b72c766eb18490a41163b58e75be16fc33ab52
tree328b8ff87eca8e94c76e7d11ec676df62c61b8b9
parenta5eaa8ab0f9c42b8b4c457c15c09b8f9b092ecef
mm/zpool: prevent zbud/zsmalloc from unloading when used

Add try_module_get() to zpool_create_pool(), and module_put() to
zpool_destroy_pool().  Without module usage counting, the driver module(s)
could be unloaded while their pool(s) were active, resulting in an oops
when zpool tried to access them.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Cc: Seth Jennings <sjennings@variantweb.net>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Weijie Yang <weijie.yang@samsung.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/zpool.h
mm/zbud.c
mm/zpool.c
mm/zsmalloc.c