Skip to content

Commit ad47f95

Browse files
Tahsin Erdogantytso
authored andcommitted
ext4: skip ext4_init_security() and encryption on ea_inodes
Extended attribute inodes are internal to ext4. Adding encryption/security related attributes on them would mean dealing with nested calls into ea code. Since they have no direct exposure to user mode, just avoid creating ea entries for them. Signed-off-by: Tahsin Erdogan <tahsin@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 2a527d6 commit ad47f95

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎fs/ext4/ialloc.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,8 @@ struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir,
771771

772772
if ((ext4_encrypted_inode(dir) ||
773773
DUMMY_ENCRYPTION_ENABLED(EXT4_SB(dir->i_sb))) &&
774-
(S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))) {
774+
(S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) &&
775+
!(i_flags & EXT4_EA_INODE_FL)) {
775776
err = fscrypt_get_encryption_info(dir);
776777
if (err)
777778
return ERR_PTR(err);
@@ -1114,11 +1115,11 @@ struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir,
11141115
err = ext4_init_acl(handle, inode, dir);
11151116
if (err)
11161117
goto fail_free_drop;
1117-
}
11181118

1119-
err = ext4_init_security(handle, inode, dir, qstr);
1120-
if (err)
1121-
goto fail_free_drop;
1119+
err = ext4_init_security(handle, inode, dir, qstr);
1120+
if (err)
1121+
goto fail_free_drop;
1122+
}
11221123

11231124
if (ext4_has_feature_extents(sb)) {
11241125
/* set extent flag only for directory, file and normal symlink*/

0 commit comments

Comments
 (0)