summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2018-11-09 20:09:37 -0500
committerMatthew Wilcox <willy@infradead.org>2018-11-16 16:38:50 -0500
commit7ae2ea7dc45e8250a74cfaaecdce578427669ae5 (patch)
tree838dbe7e08ee992a51e5a38236f3df0cf6260c18 /fs
parent6d7cd8c1373746a93dc868ee9d38a82df78b38aa (diff)
dax: Make sure the unlocking entry isn't locked
I wrote the semantics in the commit message, but didn't document it in the source code. Use a BUG_ON instead (if any code does do this, it's really buggy; we can't recover and it's worth taking the machine down). Signed-off-by: Matthew Wilcox <willy@infradead.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/dax.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 529ac9d7c10a..7944417f5a71 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -255,6 +255,7 @@ static void dax_unlock_entry(struct xa_state *xas, void *entry)
{
void *old;
+ BUG_ON(dax_is_locked(entry));
xas_reset(xas);
xas_lock_irq(xas);
old = xas_store(xas, entry);