memsw: handle swapaccount kernel parameter correctly
commite7e78456b4aa3c087129b9dec0ad90b1cedec57f
authorMichal Hocko <mhocko@suse.cz>
Tue, 1 Feb 2011 23:52:30 +0000 (1 15:52 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 23:14:46 +0000 (17 15:14 -0800)
tree20b6c6bcf3108d432b3ff32a8f27945f14c42638
parent1ac0a5efc2227ca74f36c4e7d2f166a8e0469216
memsw: handle swapaccount kernel parameter correctly

commit fceda1bf498677501befc7da72fd2e4de7f18466 upstream.

__setup based kernel command line parameters handlers which are handled in
obsolete_checksetup are provided with the parameter value including =
(more precisely everything right after the parameter name).

This means that the current implementation of swapaccount[=1|0] doesn't
work at all because if there is a value for the parameter then we are
testing for "0" resp.  "1" but we are getting "=0" resp.  "=1" and if
there is no parameter value we are getting an empty string rather than
NULL.

The original noswapccount parameter, which doesn't care about the value,
works correctly.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/memcontrol.c