From: Cesar Eduardo Barros Date: Wed, 12 Dec 2012 00:01:14 +0000 (-0800) Subject: mm: do not call frontswap_init() during swapoff X-Git-Tag: omap-for-v3.8/fixes-for-merge-window-v4-signed~81^2~46 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6555bc035731eab76c0901925034465d3ad2099c;p=pandora-kernel.git mm: do not call frontswap_init() during swapoff The call to frontswap_init() was added within enable_swap_info(), which was called not only during sys_swapon, but also to reinsert the swap_info into the swap_list in case of failure of try_to_unuse() within sys_swapoff. This means that frontswap_init() might be called more than once for the same swap area. While as far as I could see no frontswap implementation has any problem with it (and in fact, all the ones I found ignore the parameter passed to frontswap_init), this could change in the future. To prevent future problems, move the call to frontswap_init() to outside the code shared between sys_swapon and sys_swapoff. Signed-off-by: Cesar Eduardo Barros Cc: Konrad Rzeszutek Wilk Acked-by: Dan Magenheimer Cc: Mel Gorman Cc: Rik van Riel Cc: KAMEZAWA Hiroyuki Cc: Johannes Weiner Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed