]> git.ipfire.org Git - people/ms/linux.git/commitdiff
SUNRPC/auth_gss: Convert GFP_NOFS to GFP_KERNEL
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 29 Jan 2022 19:43:09 +0000 (14:43 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 25 Feb 2022 23:50:12 +0000 (18:50 -0500)
Assume that the upper layers have set memalloc_nofs_save/restore as
appropriate.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/auth_gss/auth_gss_internal.h
net/sunrpc/auth_gss/gss_krb5_crypto.c
net/sunrpc/auth_gss/gss_krb5_seqnum.c

index 5f42aa5fc612850b526c160ab5e5c75416862676..affd64a54f02d3195fbcaaced5668ad658aba770 100644 (file)
@@ -145,7 +145,7 @@ gss_alloc_context(void)
 {
        struct gss_cl_ctx *ctx;
 
-       ctx = kzalloc(sizeof(*ctx), GFP_NOFS);
+       ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
        if (ctx != NULL) {
                ctx->gc_proc = RPC_GSS_PROC_DATA;
                ctx->gc_seq = 1;        /* NetApp 6.4R1 doesn't accept seq. no. 0 */
@@ -208,7 +208,7 @@ gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct
                p = ERR_PTR(-EFAULT);
                goto err;
        }
-       ret = gss_import_sec_context(p, seclen, gm, &ctx->gc_gss_ctx, NULL, GFP_NOFS);
+       ret = gss_import_sec_context(p, seclen, gm, &ctx->gc_gss_ctx, NULL, GFP_KERNEL);
        if (ret < 0) {
                trace_rpcgss_import_ctx(ret);
                p = ERR_PTR(ret);
@@ -510,7 +510,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
        int vers;
        int err = -ENOMEM;
 
-       gss_msg = kzalloc(sizeof(*gss_msg), GFP_NOFS);
+       gss_msg = kzalloc(sizeof(*gss_msg), GFP_KERNEL);
        if (gss_msg == NULL)
                goto err;
        vers = get_pipe_version(gss_auth->net);
@@ -526,7 +526,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
        gss_msg->auth = gss_auth;
        kref_get(&gss_auth->kref);
        if (service_name) {
-               gss_msg->service_name = kstrdup_const(service_name, GFP_NOFS);
+               gss_msg->service_name = kstrdup_const(service_name, GFP_KERNEL);
                if (!gss_msg->service_name) {
                        err = -ENOMEM;
                        goto err_put_pipe_version;
@@ -702,7 +702,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
        if (mlen > MSG_BUF_MAXSIZE)
                goto out;
        err = -ENOMEM;
-       buf = kmalloc(mlen, GFP_NOFS);
+       buf = kmalloc(mlen, GFP_KERNEL);
        if (!buf)
                goto out;
 
@@ -1218,7 +1218,7 @@ gss_dup_cred(struct gss_auth *gss_auth, struct gss_cred *gss_cred)
        struct gss_cred *new;
 
        /* Make a copy of the cred so that we can reference count it */
-       new = kzalloc(sizeof(*gss_cred), GFP_NOFS);
+       new = kzalloc(sizeof(*gss_cred), GFP_KERNEL);
        if (new) {
                struct auth_cred acred = {
                        .cred = gss_cred->gc_base.cr_cred,
@@ -1341,7 +1341,7 @@ gss_hash_cred(struct auth_cred *acred, unsigned int hashbits)
 static struct rpc_cred *
 gss_lookup_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
 {
-       return rpcauth_lookup_credcache(auth, acred, flags, GFP_NOFS);
+       return rpcauth_lookup_credcache(auth, acred, flags, GFP_KERNEL);
 }
 
 static struct rpc_cred *
@@ -1667,7 +1667,7 @@ gss_validate(struct rpc_task *task, struct xdr_stream *xdr)
        if (!p)
                goto validate_failed;
 
-       seq = kmalloc(4, GFP_NOFS);
+       seq = kmalloc(4, GFP_KERNEL);
        if (!seq)
                goto validate_failed;
        *seq = cpu_to_be32(task->tk_rqstp->rq_seqno);
@@ -1777,11 +1777,11 @@ alloc_enc_pages(struct rpc_rqst *rqstp)
        rqstp->rq_enc_pages
                = kmalloc_array(rqstp->rq_enc_pages_num,
                                sizeof(struct page *),
-                               GFP_NOFS);
+                               GFP_KERNEL);
        if (!rqstp->rq_enc_pages)
                goto out;
        for (i=0; i < rqstp->rq_enc_pages_num; i++) {
-               rqstp->rq_enc_pages[i] = alloc_page(GFP_NOFS);
+               rqstp->rq_enc_pages[i] = alloc_page(GFP_KERNEL);
                if (rqstp->rq_enc_pages[i] == NULL)
                        goto out_free;
        }
@@ -1985,7 +1985,7 @@ gss_unwrap_resp_integ(struct rpc_task *task, struct rpc_cred *cred,
        if (offset + len > rcv_buf->len)
                goto unwrap_failed;
        mic.len = len;
-       mic.data = kmalloc(len, GFP_NOFS);
+       mic.data = kmalloc(len, GFP_KERNEL);
        if (!mic.data)
                goto unwrap_failed;
        if (read_bytes_from_xdr_buf(rcv_buf, offset, mic.data, mic.len))
index f6d9631bd9d0016bd5bbaaf7644f6455811d33b4..c53b329092d40598bf8111ac75d06d9f3d1756d5 100644 (file)
@@ -35,7 +35,7 @@ simple_get_netobj(const void *p, const void *end, struct xdr_netobj *dest)
        if (unlikely(q > end || q < p))
                return ERR_PTR(-EFAULT);
        if (len) {
-               dest->data = kmemdup(p, len, GFP_NOFS);
+               dest->data = kmemdup(p, len, GFP_KERNEL);
                if (unlikely(dest->data == NULL))
                        return ERR_PTR(-ENOMEM);
        } else
index 634b6c6e0dcbc9016cc3f8f03bd8fa39c4ca7667..3ea58175e15999a3fc3c559af0a285ca9f17f8f8 100644 (file)
@@ -161,7 +161,7 @@ make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen,
                return GSS_S_FAILURE;
        }
 
-       checksumdata = kmalloc(GSS_KRB5_MAX_CKSUM_LEN, GFP_NOFS);
+       checksumdata = kmalloc(GSS_KRB5_MAX_CKSUM_LEN, GFP_KERNEL);
        if (checksumdata == NULL)
                return GSS_S_FAILURE;
 
@@ -169,7 +169,7 @@ make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen,
        if (IS_ERR(tfm))
                goto out_free_cksum;
 
-       req = ahash_request_alloc(tfm, GFP_NOFS);
+       req = ahash_request_alloc(tfm, GFP_KERNEL);
        if (!req)
                goto out_free_ahash;
 
@@ -257,7 +257,7 @@ make_checksum_v2(struct krb5_ctx *kctx, char *header, int hdrlen,
                return GSS_S_FAILURE;
        }
 
-       checksumdata = kmalloc(GSS_KRB5_MAX_CKSUM_LEN, GFP_NOFS);
+       checksumdata = kmalloc(GSS_KRB5_MAX_CKSUM_LEN, GFP_KERNEL);
        if (!checksumdata)
                return GSS_S_FAILURE;
 
@@ -265,7 +265,7 @@ make_checksum_v2(struct krb5_ctx *kctx, char *header, int hdrlen,
        if (IS_ERR(tfm))
                goto out_free_cksum;
 
-       req = ahash_request_alloc(tfm, GFP_NOFS);
+       req = ahash_request_alloc(tfm, GFP_KERNEL);
        if (!req)
                goto out_free_ahash;
 
@@ -554,7 +554,7 @@ gss_krb5_cts_crypt(struct crypto_sync_skcipher *cipher, struct xdr_buf *buf,
                WARN_ON(0);
                return -ENOMEM;
        }
-       data = kmalloc(GSS_KRB5_MAX_BLOCKSIZE * 2, GFP_NOFS);
+       data = kmalloc(GSS_KRB5_MAX_BLOCKSIZE * 2, GFP_KERNEL);
        if (!data)
                return -ENOMEM;
 
index fb117817ff5d911bffa13f1dfb0a280d6658911e..3200b971a814faa749f44b7c177b39e56e6e874f 100644 (file)
@@ -49,7 +49,7 @@ krb5_make_seq_num(struct krb5_ctx *kctx,
        unsigned char *plain;
        s32 code;
 
-       plain = kmalloc(8, GFP_NOFS);
+       plain = kmalloc(8, GFP_KERNEL);
        if (!plain)
                return -ENOMEM;
 
@@ -80,7 +80,7 @@ krb5_get_seq_num(struct krb5_ctx *kctx,
 
        dprintk("RPC:       krb5_get_seq_num:\n");
 
-       plain = kmalloc(8, GFP_NOFS);
+       plain = kmalloc(8, GFP_KERNEL);
        if (!plain)
                return -ENOMEM;