Merge tag 'for_linux-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jwess...
[firefly-linux-kernel-4.4.55.git] / fs / f2fs / acl.c
index 1ccb26bc2a0b5cc709806715e8eec7fcdcb88854..742202779bd517029ff8a910a361f37181c530f6 100644 (file)
@@ -62,7 +62,7 @@ static struct posix_acl *f2fs_acl_from_disk(const char *value, size_t size)
        if (count == 0)
                return NULL;
 
-       acl = posix_acl_alloc(count, GFP_KERNEL);
+       acl = posix_acl_alloc(count, GFP_NOFS);
        if (!acl)
                return ERR_PTR(-ENOMEM);
 
@@ -116,7 +116,7 @@ static void *f2fs_acl_to_disk(const struct posix_acl *acl, size_t *size)
        int i;
 
        f2fs_acl = kmalloc(sizeof(struct f2fs_acl_header) + acl->a_count *
-                       sizeof(struct f2fs_acl_entry), GFP_KERNEL);
+                       sizeof(struct f2fs_acl_entry), GFP_NOFS);
        if (!f2fs_acl)
                return ERR_PTR(-ENOMEM);
 
@@ -396,7 +396,7 @@ int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage,
                posix_acl_release(default_acl);
        }
        if (acl) {
-               if (error)
+               if (!error)
                        error = __f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl,
                                               ipage);
                posix_acl_release(acl);