X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=fs%2Fcrypto%2Fpolicy.c;h=6865663aac69690f7ccdce030c48488a13ce917b;hb=1e90a13d0c3dc94512af1ccb2b6563e8297838fa;hp=ed115acb5dee04bd15726ed2b9f368f6d13315cc;hpb=2eee010d092903ee95716b6c2fbd9d3289839aa4;p=cascardo%2Flinux.git diff --git a/fs/crypto/policy.c b/fs/crypto/policy.c index ed115acb5dee..6865663aac69 100644 --- a/fs/crypto/policy.c +++ b/fs/crypto/policy.c @@ -109,6 +109,8 @@ int fscrypt_process_policy(struct file *filp, if (ret) return ret; + inode_lock(inode); + if (!inode_has_encryption_context(inode)) { if (!S_ISDIR(inode->i_mode)) ret = -EINVAL; @@ -127,6 +129,8 @@ int fscrypt_process_policy(struct file *filp, ret = -EINVAL; } + inode_unlock(inode); + mnt_drop_write_file(filp); return ret; }