]> git.baikalelectronics.ru Git - kernel.git/commit
dax: Fix xarray entry association for mixed mappings
authorJan Kara <jack@suse.cz>
Thu, 6 Jun 2019 09:10:28 +0000 (11:10 +0200)
committerDan Williams <dan.j.williams@intel.com>
Fri, 7 Jun 2019 05:18:49 +0000 (22:18 -0700)
commit387a817787badb588933d58884512e11ba68ca6b
tree18f4216050c35e68b5a4f6098aa6b185c931d3db
parent31750888ad4ce9d2a30f744c4c2ab30aee07f569
dax: Fix xarray entry association for mixed mappings

When inserting entry into xarray, we store mapping and index in
corresponding struct pages for memory error handling. When it happened
that one process was mapping file at PMD granularity while another
process at PTE granularity, we could wrongly deassociate PMD range and
then reassociate PTE range leaving the rest of struct pages in PMD range
without mapping information which could later cause missed notifications
about memory errors. Fix the problem by calling the association /
deassociation code if and only if we are really going to update the
xarray (deassociating and associating zero or empty entries is just
no-op so there's no reason to complicate the code with trying to avoid
the calls for these cases).

Cc: <stable@vger.kernel.org>
Fixes: 2077bdab45b2 ("fs, dax: use page->mapping to warn if truncate...")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
fs/dax.c