]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Nov 2018 08:13:58 +0000 (09:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Nov 2018 08:13:58 +0000 (09:13 +0100)
added patches:
dax-avoid-losing-wakeup-in-dax_lock_mapping_entry.patch

queue-4.19/dax-avoid-losing-wakeup-in-dax_lock_mapping_entry.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/dax-avoid-losing-wakeup-in-dax_lock_mapping_entry.patch b/queue-4.19/dax-avoid-losing-wakeup-in-dax_lock_mapping_entry.patch
new file mode 100644 (file)
index 0000000..489c3fa
--- /dev/null
@@ -0,0 +1,45 @@
+From 25bbe21bf427a81b8e3ccd480ea0e1d940256156 Mon Sep 17 00:00:00 2001
+From: Matthew Wilcox <willy@infradead.org>
+Date: Fri, 16 Nov 2018 15:50:02 -0500
+Subject: dax: Avoid losing wakeup in dax_lock_mapping_entry
+
+From: Matthew Wilcox <willy@infradead.org>
+
+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>
+
+---
+ fs/dax.c |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/fs/dax.c
++++ b/fs/dax.c
+@@ -217,6 +217,9 @@ static inline void *unlock_slot(struct a
+       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_entr
+               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);
++              }
+       }
+ }
index b5ab24861f5131969eea22b9e67d544f1aabe1e6..57906a7b759c68eaf3fff4e44d0fe7cc14cbd5c1 100644 (file)
@@ -96,3 +96,4 @@ z3fold-fix-possible-reclaim-races.patch
 mm-memory_hotplug-check-zone_movable-in-has_unmovabl.patch
 tmpfs-make-lseek-seek_data-sek_hole-return-enxio-wit.patch
 mm-page_alloc-check-for-max-order-in-hot-path.patch
+dax-avoid-losing-wakeup-in-dax_lock_mapping_entry.patch