]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vmscan.c: fix invalid strict_strtoul() check in write_scan_unevictable_node()
authorKautuk Consul <consul.kautuk@gmail.com>
Wed, 5 Oct 2011 00:43:13 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 12 Oct 2011 06:32:13 +0000 (17:32 +1100)
commit325486058cf78aec56d7c4f0ff4abdd2042248b7
tree767eba9f435c9c3a2e14bf0a3932af276d3fa43a
parent27061d721432d8d4e51b3c2db5b73b3e69d37338
vmscan.c: fix invalid strict_strtoul() check in write_scan_unevictable_node()

write_scan_unevictable_node() checks the value req returned by
strict_strtoul() and returns 1 if req is 0.

However, when strict_strtoul() returns 0, it means successful conversion
of buf to unsigned long.

Due to this, the function was not proceeding to scan the zones for
unevictable pages even though we write a valid value to the
scan_unevictable_pages sys file.

Change this check slightly to check for invalid value in buf as well as 0
value stored in res after successful conversion via strict_strtoul.  In
both cases, we do not perform the scanning of this node's zones.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c