mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
dax: Remove optimisation from dax_lock_mapping_entry
Skipping some of the revalidation after we sleep can lead to returning
a mapping which has already been freed. Just drop this optimisation.
Reported-by: Dan Williams <dan.j.williams@intel.com>
Fixes: 9f32d22130
("dax: Convert dax_lock_mapping_entry to XArray")
Signed-off-by: Matthew Wilcox <willy@infradead.org>
This commit is contained in:
parent
5404a7f1c2
commit
6d7cd8c137
7
fs/dax.c
7
fs/dax.c
@ -383,11 +383,8 @@ bool dax_lock_mapping_entry(struct page *page)
|
||||
entry = xas_load(&xas);
|
||||
if (dax_is_locked(entry)) {
|
||||
entry = get_unlocked_entry(&xas);
|
||||
/* Did the page move while we slept? */
|
||||
if (dax_to_pfn(entry) != page_to_pfn(page)) {
|
||||
xas_unlock_irq(&xas);
|
||||
continue;
|
||||
}
|
||||
xas_unlock_irq(&xas);
|
||||
continue;
|
||||
}
|
||||
dax_lock_entry(&xas, entry);
|
||||
xas_unlock_irq(&xas);
|
||||
|
Loading…
Reference in New Issue
Block a user