Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69725181 authored by Eric Biggers's avatar Eric Biggers Committed by Theodore Ts'o
Browse files

ext4: switch to fscrypt_prepare_link()



Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 09a5c31c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -3221,9 +3221,10 @@ static int ext4_link(struct dentry *old_dentry,

	if (inode->i_nlink >= EXT4_LINK_MAX)
		return -EMLINK;
	if (ext4_encrypted_inode(dir) &&
			!fscrypt_has_permitted_context(dir, inode))
		return -EPERM;

	err = fscrypt_prepare_link(old_dentry, dir, dentry);
	if (err)
		return err;

       if ((ext4_test_inode_flag(dir, EXT4_INODE_PROJINHERIT)) &&
	   (!projid_eq(EXT4_I(dir)->i_projid,