Skip to content

Commit 39ebd6d

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
mm/memory-failure: cast index to loff_t before shifting it
On 32-bit systems, we'll lose the top bits of index because arithmetic will be performed in unsigned long instead of unsigned long long. This affects files over 4GB in size. Link: https://lkml.kernel.org/r/[email protected] Fixes: 6100e34 ("mm, memory_failure: Teach memory_failure() about dev_pagemap pages") Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Dan Williams <[email protected]> Cc: Naoya Horiguchi <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent c79c5a0 commit 39ebd6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/memory-failure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ static void unmap_and_kill(struct list_head *to_kill, unsigned long pfn,
17041704
* mapping being torn down is communicated in siginfo, see
17051705
* kill_proc()
17061706
*/
1707-
loff_t start = (index << PAGE_SHIFT) & ~(size - 1);
1707+
loff_t start = ((loff_t)index << PAGE_SHIFT) & ~(size - 1);
17081708

17091709
unmap_mapping_range(mapping, start, size, 0);
17101710
}

0 commit comments

Comments
 (0)