]> git.baikalelectronics.ru Git - kernel.git/commit
ext4 crypto: fix bugs in ext4_encrypted_zeroout()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 3 Oct 2015 14:49:29 +0000 (10:49 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 3 Oct 2015 14:49:29 +0000 (10:49 -0400)
commit64c7780b5b9cc0442ab5d3af4b3b56aa1750b252
treeae42f97191ed243525e8c303d36425a23f5476c7
parent397fd1877c54f3b328626c500a3ddb1bc76f2f99
ext4 crypto: fix bugs in ext4_encrypted_zeroout()

Fix multiple bugs in ext4_encrypted_zeroout(), including one that
could cause us to write an encrypted zero page to the wrong location
on disk, potentially causing data and file system corruption.
Fortunately, this tends to only show up in stress tests, but even with
these fixes, we are seeing some test failures with generic/127 --- but
these are now caused by data failures instead of metadata corruption.

Since ext4_encrypted_zeroout() is only used for some optimizations to
keep the extent tree from being too fragmented, and
ext4_encrypted_zeroout() itself isn't all that optimized from a time
or IOPS perspective, disable the extent tree optimization for
encrypted inodes for now.  This prevents the data corruption issues
reported by generic/127 until we can figure out what's going wrong.

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