diff options
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r-- | mm/memory-failure.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 0cd3de3550f0..7c72f2a95785 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
@@ -1161,6 +1161,7 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags, | |||
1161 | LIST_HEAD(tokill); | 1161 | LIST_HEAD(tokill); |
1162 | int rc = -EBUSY; | 1162 | int rc = -EBUSY; |
1163 | loff_t start; | 1163 | loff_t start; |
1164 | dax_entry_t cookie; | ||
1164 | 1165 | ||
1165 | /* | 1166 | /* |
1166 | * Prevent the inode from being freed while we are interrogating | 1167 | * Prevent the inode from being freed while we are interrogating |
@@ -1169,7 +1170,8 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags, | |||
1169 | * also prevents changes to the mapping of this pfn until | 1170 | * also prevents changes to the mapping of this pfn until |
1170 | * poison signaling is complete. | 1171 | * poison signaling is complete. |
1171 | */ | 1172 | */ |
1172 | if (!dax_lock_mapping_entry(page)) | 1173 | cookie = dax_lock_page(page); |
1174 | if (!cookie) | ||
1173 | goto out; | 1175 | goto out; |
1174 | 1176 | ||
1175 | if (hwpoison_filter(page)) { | 1177 | if (hwpoison_filter(page)) { |
@@ -1220,7 +1222,7 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags, | |||
1220 | kill_procs(&tokill, flags & MF_MUST_KILL, !unmap_success, pfn, flags); | 1222 | kill_procs(&tokill, flags & MF_MUST_KILL, !unmap_success, pfn, flags); |
1221 | rc = 0; | 1223 | rc = 0; |
1222 | unlock: | 1224 | unlock: |
1223 | dax_unlock_mapping_entry(page); | 1225 | dax_unlock_page(page, cookie); |
1224 | out: | 1226 | out: |
1225 | /* drop pgmap ref acquired in caller */ | 1227 | /* drop pgmap ref acquired in caller */ |
1226 | put_dev_pagemap(pgmap); | 1228 | put_dev_pagemap(pgmap); |