mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 01:21:58 +00:00
dax: Fix deadlock in dax_lock_mapping_entry()
When dax_lock_mapping_entry() has to sleep to obtain entry lock, it will
fail to unlock mapping->i_pages spinlock and thus immediately deadlock
against itself when retrying to grab the entry lock again. Fix the
problem by unlocking mapping->i_pages before retrying.
Fixes: c2a7d2a115
("filesystem-dax: Introduce dax_lock_mapping_entry()")
Reported-by: Barret Rhoden <brho@google.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
6bf4ca7fbc
commit
f52afc93cd
1 changed files with 1 additions and 0 deletions
1
fs/dax.c
1
fs/dax.c
|
@ -447,6 +447,7 @@ bool dax_lock_mapping_entry(struct page *page)
|
|||
xa_unlock_irq(&mapping->i_pages);
|
||||
break;
|
||||
} else if (IS_ERR(entry)) {
|
||||
xa_unlock_irq(&mapping->i_pages);
|
||||
WARN_ON_ONCE(PTR_ERR(entry) != -EAGAIN);
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue