diff options
author | Matthew Wilcox <willy@infradead.org> | 2018-11-16 15:50:02 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-01 09:37:34 +0100 |
commit | e7a121e34c79bca171e5076a4c30a17d9966e88f (patch) | |
tree | 131935bc87e11b41128cff1797bbf16af65bfd60 /fs/dax.c | |
parent | 9dec38554aa876700acb851b35ee0c5e28841e03 (diff) | |
download | linux-rt-e7a121e34c79bca171e5076a4c30a17d9966e88f.tar.gz |
dax: Avoid losing wakeup in dax_lock_mapping_entry
commit 25bbe21bf427a81b8e3ccd480ea0e1d940256156 upstream.
After calling get_unlocked_entry(), you have to call
put_unlocked_entry() to avoid subsequent waiters losing wakeups.
Fixes: c2a7d2a11552 ("filesystem-dax: Introduce dax_lock_mapping_entry()")
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/dax.c')
-rw-r--r-- | fs/dax.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -217,6 +217,9 @@ static inline void *unlock_slot(struct address_space *mapping, void **slot) return (void *)entry; } +static void put_unlocked_mapping_entry(struct address_space *mapping, + pgoff_t index, void *entry); + /* * Lookup entry in radix tree, wait for it to become unlocked if it is * exceptional entry and return it. The caller must call @@ -256,8 +259,10 @@ static void *__get_unlocked_mapping_entry(struct address_space *mapping, revalidate = wait_fn(); finish_wait(wq, &ewait.wait); xa_lock_irq(&mapping->i_pages); - if (revalidate) + if (revalidate) { + put_unlocked_mapping_entry(mapping, index, entry); return ERR_PTR(-EAGAIN); + } } } |