]> git.baikalelectronics.ru Git - kernel.git/commit
dax: Call ->iomap_begin without entry lock during dax fault
authorJan Kara <jack@suse.cz>
Wed, 19 Oct 2016 12:34:31 +0000 (14:34 +0200)
committerDan Williams <dan.j.williams@intel.com>
Tue, 27 Dec 2016 04:29:25 +0000 (20:29 -0800)
commit5afcd2a8bbddb07aae61cadf04087673892dff19
tree99f00ca80593939bb78d826331c5b13aab014624
parent590448acbd10f54bd40cae42d518f5d9b4900479
dax: Call ->iomap_begin without entry lock during dax fault

Currently ->iomap_begin() handler is called with entry lock held. If the
filesystem held any locks between ->iomap_begin() and ->iomap_end()
(such as ext4 which will want to hold transaction open), this would cause
lock inversion with the iomap_apply() from standard IO path which first
calls ->iomap_begin() and only then calls ->actor() callback which grabs
entry locks for DAX (if it faults when copying from/to user provided
buffers).

Fix the problem by nesting grabbing of entry lock inside ->iomap_begin()
- ->iomap_end() pair.

Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
fs/dax.c