* [PATCH] ext4: enforce online defrag restriction for encrypted files
@ 2016-07-22 22:17 Eric Whitney
2016-09-06 3:05 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Eric Whitney @ 2016-07-22 22:17 UTC (permalink / raw)
To: linux-ext4; +Cc: tytso
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>
---
fs/ext4/move_extent.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index a920c5d..6fc14de 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -598,6 +598,13 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,
return -EOPNOTSUPP;
}
+ if (ext4_encrypted_inode(orig_inode) ||
+ ext4_encrypted_inode(donor_inode)) {
+ ext4_msg(orig_inode->i_sb, KERN_ERR,
+ "Online defrag not supported for encrypted files");
+ return -EOPNOTSUPP;
+ }
+
/* Protect orig and donor inodes against a truncate */
lock_two_nondirectories(orig_inode, donor_inode);
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext4: enforce online defrag restriction for encrypted files
2016-07-22 22:17 [PATCH] ext4: enforce online defrag restriction for encrypted files Eric Whitney
@ 2016-09-06 3:05 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2016-09-06 3:05 UTC (permalink / raw)
To: Eric Whitney; +Cc: linux-ext4
On Fri, Jul 22, 2016 at 06:17:55PM -0400, Eric Whitney wrote:
> 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>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-06 3:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-22 22:17 [PATCH] ext4: enforce online defrag restriction for encrypted files Eric Whitney
2016-09-06 3:05 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).