]> git.karo-electronics.de Git - karo-tx-linux.git/commit
page-flags: do not corrupt caller 'page' in PF_NO_TAIL
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Wed, 21 Oct 2015 22:03:31 +0000 (09:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:03:31 +0000 (09:03 +1100)
commitdc5f54eefc8e98ed185a91f6504626747f9b2b10
treeb4fd0232ed1a1d339f43e62206adfd9990633215
parent30400609ac212f909a93925f8d4a5adfe011f10f
page-flags: do not corrupt caller 'page' in PF_NO_TAIL

Andrew noticed that PF_NO_TAIL() modifies caller's 'page'.  This doesn't
trigger any bad results, because all users are inline functions which
doesn't use the variable beyond the point.  But still not good.

The patch changes PF_NO_TAIL() to always return head page, regardless
'enforce'.  This makes operations of page flags with PF_NO_TAIL more
symmetrical: modifications and checks goes to head page.  It gives better
chance to recover in case of bug for non-DEBUG_VM kernel.

DEBUG_VM kernel will still trigger VM_BUG_ON() on modifications to tail
pages.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/page-flags.h