ext4: enforce online defrag restriction for encrypted files
authorEric Whitney <enwlinux@gmail.com>
Mon, 29 Aug 2016 19:45:11 +0000 (15:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Oct 2016 10:26:56 +0000 (12:26 +0200)
commit76a8f17e0b850d5bb842097b0ee9c2e96af806a0
tree866ebc0d5707481b4836bcb6f3da3d7d844f21fb
parent2ed1b50a40e6d023e91a7a7d2cdb4b1247d8cec3
ext4: enforce online defrag restriction for encrypted files

commit 14fbd4aa613bd5110556c281799ce36dc6f3ba97 upstream.

Online defragging of encrypted files is not currently implemented.
However, the move extent ioctl can still return successfully when
called.  For example, this occurs when xfstest ext4/020 is run on an
encrypted file system, resulting in a corrupted test file and a
corresponding test failure.

Until the proper functionality is implemented, fail the move extent
ioctl if either the original or donor file is encrypted.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/move_extent.c