]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
smb: client: change allocation requirements in DUP_CTX_STR macro
authorFredric Cover <fredric.cover.lkernel@gmail.com>
Wed, 13 May 2026 20:19:15 +0000 (13:19 -0700)
committerSteve French <stfrench@microsoft.com>
Thu, 21 May 2026 16:16:09 +0000 (11:16 -0500)
Currently, the macro DUP_CTX_STR allocates new_ctx->field using
GFP_ATOMIC. DUP_CTX_STR is only used in smb3_fs_context_dup(), which
is never called in an atomic context. Using GFP_ATOMIC puts unnecessary
pressure on emergency memory pools.

Change GFP_ATOMIC to GFP_KERNEL.

Signed-off-by: Fredric Cover <fredric.cover.lkernel@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/fs_context.c

index 4c8b1b9ade8b83022f9b2bd4092bf3bad91a0484..2f86158f85d7b6c6821ca83fdd690c28db10a3bf 100644 (file)
@@ -420,7 +420,7 @@ static int parse_symlink_flavor(struct fs_context *fc, char *value,
 #define DUP_CTX_STR(field)                                             \
 do {                                                                   \
        if (ctx->field) {                                               \
-               new_ctx->field = kstrdup(ctx->field, GFP_ATOMIC);       \
+               new_ctx->field = kstrdup(ctx->field, GFP_KERNEL);       \
                if (new_ctx->field == NULL) {                           \
                        smb3_cleanup_fs_context_contents(new_ctx);      \
                        return -ENOMEM;                                 \