]> git.karo-electronics.de Git - linux-beck.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)
commit36086d43f6575c081067de9855786a2fc91df77b
treeae42f97191ed243525e8c303d36425a23f5476c7
parent687c3c36e754a999a8263745b27965128db4fee5
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