aboutsummaryrefslogtreecommitdiff
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorGary S. Robertson <gary.robertson@linaro.org>2014-05-06 01:11:53 -0500
committerGary S. Robertson <gary.robertson@linaro.org>2014-05-06 01:11:53 -0500
commite8f84c44a0d78cb3413d69331bee6ce4d86b2e1d (patch)
tree0eb14b7e337b7b8dbc1bd97e11a13e1abc114b9a /include/linux/mm.h
parente365c882ed38dbbe1a6ff4ed72414835390368a6 (diff)
parentf512eefd5cde0ad21bd99bbfe4dc70b62805838e (diff)
Merge tag 'v3.10.37' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into linux-lnglinux-lng-v3.10.37-finallinux-lng-v3.10.xlinux-lng
This is the 3.10.37 stable release Conflicts: scripts/package/builddeb
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3bf21c3502d0..a9a48309f045 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -361,8 +361,18 @@ static inline void compound_unlock_irqrestore(struct page *page,
static inline struct page *compound_head(struct page *page)
{
- if (unlikely(PageTail(page)))
- return page->first_page;
+ if (unlikely(PageTail(page))) {
+ struct page *head = page->first_page;
+
+ /*
+ * page->first_page may be a dangling pointer to an old
+ * compound page, so recheck that it is still a tail
+ * page before returning.
+ */
+ smp_rmb();
+ if (likely(PageTail(page)))
+ return head;
+ }
return page;
}