]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix a potential fiemap/page fault deadlock w/ inline_data
authorTheodore Ts'o <tytso@mit.edu>
Tue, 25 Dec 2018 05:56:33 +0000 (00:56 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 25 Dec 2018 05:56:33 +0000 (00:56 -0500)
commit33241ec3d1f4ee304d1f95091c0c2da0e092a9b8
treeec4e19afec1556c8aeecef9a460a1208c1a71c83
parentfd7095567689bd48e45c3d5085f0d59aa182e01a
ext4: fix a potential fiemap/page fault deadlock w/ inline_data

The ext4_inline_data_fiemap() function calls fiemap_fill_next_extent()
while still holding the xattr semaphore.  This is not necessary and it
triggers a circular lockdep warning.  This is because
fiemap_fill_next_extent() could trigger a page fault when it writes
into page which triggers a page fault.  If that page is mmaped from
the inline file in question, this could very well result in a
deadlock.

This problem can be reproduced using generic/519 with a file system
configuration which has the inline_data feature enabled.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/inline.c