X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=mm%2Fmemory-failure.c;h=44c6bd201d3a1cac7120527b45e2a86f5f77abff;hb=2f39691f31a22e0c6d82573d91306059f8ef920c;hp=a013bc94ebbed4af3764e396b087475310ed5185;hpb=049711bf3cc59501ebeae621aa22acd3918ebd79;p=firefly-linux-kernel-4.4.55.git diff --git a/mm/memory-failure.c b/mm/memory-failure.c index a013bc94ebbe..44c6bd201d3a 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1172,6 +1172,16 @@ int memory_failure(unsigned long pfn, int trapno, int flags) lock_page(hpage); + /* + * The page could have changed compound pages during the locking. + * If this happens just bail out. + */ + if (compound_head(p) != hpage) { + action_result(pfn, "different compound page after locking", IGNORED); + res = -EBUSY; + goto out; + } + /* * We use page flags to determine what action should be taken, but * the flags can be modified by the error containment action. One