UPSTREAM: f2fs: avoid hungtask problem caused by losing wake_up
[firefly-linux-kernel-4.4.55.git] / fs / f2fs / crypto_policy.c
index d4a96af513c22f28ea1242496286d4ff1a606567..e504f548b64e3045177ae884b3352ac34bd7466e 100644 (file)
@@ -89,6 +89,9 @@ static int f2fs_create_encryption_context_from_policy(
 int f2fs_process_policy(const struct f2fs_encryption_policy *policy,
                        struct inode *inode)
 {
+       if (!inode_owner_or_capable(inode))
+               return -EACCES;
+
        if (policy->version != 0)
                return -EINVAL;