crypto_cfg.data_unit_size = sb->s_blocksize;
        crypto_cfg.dun_bytes = fscrypt_get_dun_bytes(ci);
        num_devs = fscrypt_get_num_devices(sb);
-       devs = kmalloc_array(num_devs, sizeof(*devs), GFP_NOFS);
+       devs = kmalloc_array(num_devs, sizeof(*devs), GFP_KERNEL);
        if (!devs)
                return -ENOMEM;
        fscrypt_get_devices(sb, num_devs, devs);
        struct fscrypt_blk_crypto_key *blk_key;
        int err;
        int i;
-       unsigned int flags;
 
-       blk_key = kzalloc(struct_size(blk_key, devs, num_devs), GFP_NOFS);
+       blk_key = kzalloc(struct_size(blk_key, devs, num_devs), GFP_KERNEL);
        if (!blk_key)
                return -ENOMEM;
 
                }
                queue_refs++;
 
-               flags = memalloc_nofs_save();
                err = blk_crypto_start_using_key(&blk_key->base,
                                                 blk_key->devs[i]);
-               memalloc_nofs_restore(flags);
                if (err) {
                        fscrypt_err(inode,
                                    "error %d starting to use blk-crypto", err);
 
                goto out;
        }
        crypto_skcipher_set_flags(tfm, CRYPTO_TFM_REQ_FORBID_WEAK_KEYS);
-       req = skcipher_request_alloc(tfm, GFP_NOFS);
+       req = skcipher_request_alloc(tfm, GFP_KERNEL);
        if (!req) {
                res = -ENOMEM;
                goto out;
        const struct user_key_payload *ukp;
        const struct fscrypt_key *payload;
 
-       description = kasprintf(GFP_NOFS, "%s%*phN", prefix,
+       description = kasprintf(GFP_KERNEL, "%s%*phN", prefix,
                                FSCRYPT_KEY_DESCRIPTOR_SIZE, descriptor);
        if (!description)
                return ERR_PTR(-ENOMEM);
                return dk;
 
        /* Nope, allocate one. */
-       dk = kzalloc(sizeof(*dk), GFP_NOFS);
+       dk = kzalloc(sizeof(*dk), GFP_KERNEL);
        if (!dk)
                return ERR_PTR(-ENOMEM);
        refcount_set(&dk->dk_refcount, 1);
         * This cannot be a stack buffer because it will be passed to the
         * scatterlist crypto API during derive_key_aes().
         */
-       derived_key = kmalloc(ci->ci_mode->keysize, GFP_NOFS);
+       derived_key = kmalloc(ci->ci_mode->keysize, GFP_KERNEL);
        if (!derived_key)
                return -ENOMEM;