>From 9f68c0a856b86dbd109be3b95427cd69bec8330d Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Fri, 25 Jul 2014 09:43:15 -0400 Subject: [PATCH 1/4] dax: Only unlock the i_mmap_mutex if we locked it The second time we faulted on a hole, we would try to unlock the i_mmap_mutex, even though we weren't holding it. Oops. --- fs/dax.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index 39b95b1..a65a0f9 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -341,7 +341,8 @@ static int do_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf, if (error || bh.b_size < PAGE_SIZE) goto sigbus; } else { - mutex_unlock(&mapping->i_mmap_mutex); + if (!page) + mutex_unlock(&mapping->i_mmap_mutex); return dax_load_hole(mapping, page, vmf); } } -- 2.0.1