dax: Avoid losing wakeup in dax_lock_mapping_entry
authorMatthew Wilcox <willy@infradead.org>
Fri, 16 Nov 2018 20:50:02 +0000 (15:50 -0500)
committerMatthew Wilcox <willy@infradead.org>
Mon, 19 Nov 2018 14:40:58 +0000 (09:40 -0500)
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>
fs/dax.c

index cf2394e2bf4bf36b845e4c52f697ba16881d7e08..9bcce89ea18ef458b25e786ce21b6f1c6122a178 100644 (file)
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -391,6 +391,7 @@ bool dax_lock_mapping_entry(struct page *page)
                        rcu_read_unlock();
                        entry = get_unlocked_entry(&xas);
                        xas_unlock_irq(&xas);
+                       put_unlocked_entry(&xas, entry);
                        rcu_read_lock();
                        continue;
                }