diff options
author | Eric Biggers <ebiggers@google.com> | 2017-10-18 20:21:57 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-10-18 20:21:57 -0400 |
commit | 697251816d64572098a2d26791a1c49c3723f5b1 (patch) | |
tree | 758d4923b2539d545f69085af065d4054679774f | |
parent | 09a5c31c919da0a83d3fa9fffaa09cf78cc2d466 (diff) |
ext4: switch to fscrypt_prepare_link()
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | fs/ext4/namei.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index c1cf020d1889..b2058500f1dc 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -3221,9 +3221,10 @@ static int ext4_link(struct dentry *old_dentry, | |||
3221 | 3221 | ||
3222 | if (inode->i_nlink >= EXT4_LINK_MAX) | 3222 | if (inode->i_nlink >= EXT4_LINK_MAX) |
3223 | return -EMLINK; | 3223 | return -EMLINK; |
3224 | if (ext4_encrypted_inode(dir) && | 3224 | |
3225 | !fscrypt_has_permitted_context(dir, inode)) | 3225 | err = fscrypt_prepare_link(old_dentry, dir, dentry); |
3226 | return -EPERM; | 3226 | if (err) |
3227 | return err; | ||
3227 | 3228 | ||
3228 | if ((ext4_test_inode_flag(dir, EXT4_INODE_PROJINHERIT)) && | 3229 | if ((ext4_test_inode_flag(dir, EXT4_INODE_PROJINHERIT)) && |
3229 | (!projid_eq(EXT4_I(dir)->i_projid, | 3230 | (!projid_eq(EXT4_I(dir)->i_projid, |