|
@@ -1098,6 +1098,17 @@ got:
|
|
if (err)
|
|
if (err)
|
|
goto fail_drop;
|
|
goto fail_drop;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Since the encryption xattr will always be unique, create it first so
|
|
|
|
+ * that it's less likely to end up in an external xattr block and
|
|
|
|
+ * prevent its deduplication.
|
|
|
|
+ */
|
|
|
|
+ if (encrypt) {
|
|
|
|
+ err = fscrypt_inherit_context(dir, inode, handle, true);
|
|
|
|
+ if (err)
|
|
|
|
+ goto fail_free_drop;
|
|
|
|
+ }
|
|
|
|
+
|
|
err = ext4_init_acl(handle, inode, dir);
|
|
err = ext4_init_acl(handle, inode, dir);
|
|
if (err)
|
|
if (err)
|
|
goto fail_free_drop;
|
|
goto fail_free_drop;
|
|
@@ -1119,12 +1130,6 @@ got:
|
|
ei->i_datasync_tid = handle->h_transaction->t_tid;
|
|
ei->i_datasync_tid = handle->h_transaction->t_tid;
|
|
}
|
|
}
|
|
|
|
|
|
- if (encrypt) {
|
|
|
|
- err = fscrypt_inherit_context(dir, inode, handle, true);
|
|
|
|
- if (err)
|
|
|
|
- goto fail_free_drop;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
err = ext4_mark_inode_dirty(handle, inode);
|
|
err = ext4_mark_inode_dirty(handle, inode);
|
|
if (err) {
|
|
if (err) {
|
|
ext4_std_error(sb, err);
|
|
ext4_std_error(sb, err);
|