Skip to content

Commit

Permalink
dax: Make sure the unlocking entry isn't locked
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthew Wilcox committed Nov 16, 2018
1 parent 6d7cd8c commit 7ae2ea7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/dax.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7ae2ea7

Please sign in to comment.