summaryrefslogtreecommitdiff
path: root/fs/smb/server/connection.c
diff options
context:
space:
mode:
authorNamjae Jeon <linkinjeon@kernel.org>2024-11-22 10:33:25 +0300
committerSteve French <stfrench@microsoft.com>2024-11-26 03:58:02 +0300
commit0066f623bce8f98b69b752ee03d46a5047c281b8 (patch)
tree86583913e44e47b85f9670344f814523383538f0 /fs/smb/server/connection.c
parentd6eb09fb46707a060209f077abede8c0e2c21b73 (diff)
downloadlinux-0066f623bce8f98b69b752ee03d46a5047c281b8.tar.xz
ksmbd: use __GFP_RETRY_MAYFAIL
Prefer to report ENOMEM rather than incur the oom for allocations in ksmbd. __GFP_NORETRY could not achieve that, It would fail the allocations just too easily. __GFP_RETRY_MAYFAIL will keep retrying the allocation until there is no more progress and fail the allocation instead go OOM and let the caller to deal with it. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/server/connection.c')
-rw-r--r--fs/smb/server/connection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/smb/server/connection.c b/fs/smb/server/connection.c
index e6a72f75ab94..23c5ff84c9eb 100644
--- a/fs/smb/server/connection.c
+++ b/fs/smb/server/connection.c
@@ -52,7 +52,7 @@ struct ksmbd_conn *ksmbd_conn_alloc(void)
{
struct ksmbd_conn *conn;
- conn = kzalloc(sizeof(struct ksmbd_conn), GFP_KERNEL);
+ conn = kzalloc(sizeof(struct ksmbd_conn), KSMBD_DEFAULT_GFP);
if (!conn)
return NULL;
@@ -359,7 +359,7 @@ int ksmbd_conn_handler_loop(void *p)
/* 4 for rfc1002 length field */
/* 1 for implied bcc[0] */
size = pdu_size + 4 + 1;
- conn->request_buf = kvmalloc(size, GFP_KERNEL);
+ conn->request_buf = kvmalloc(size, KSMBD_DEFAULT_GFP);
if (!conn->request_buf)
break;