dax: Don't access a freed inode
authorMatthew Wilcox <willy@infradead.org>
Tue, 27 Nov 2018 21:16:34 +0000 (13:16 -0800)
committerDan Williams <dan.j.williams@intel.com>
Wed, 28 Nov 2018 19:08:42 +0000 (11:08 -0800)
commit55e56f06ed71d9441f3abd5b1d3c1a870812b3fe
tree6d4ea9c78b457d2b894d11c58af2798b09a8746c
parentc93db7bb6ef3251e0ea48ade311d3e9942748e1c
dax: Don't access a freed inode

After we drop the i_pages lock, the inode can be freed at any time.
The get_unlocked_entry() code has no choice but to reacquire the lock,
so it can't be used here.  Create a new wait_entry_unlocked() which takes
care not to acquire the lock or dereference the address_space in any way.

Fixes: c2a7d2a11552 ("filesystem-dax: Introduce dax_lock_mapping_entry()")
Cc: <stable@vger.kernel.org>
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
fs/dax.c