mirror of
https://github.com/raspberrypi/linux.git
synced 2026-01-04 18:27:36 +00:00
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>
This commit is contained in:
committed by
Steve French
parent
d6eb09fb46
commit
0066f623bc
@@ -47,7 +47,7 @@ static int ___server_conf_set(int idx, char *val)
|
||||
return -EINVAL;
|
||||
|
||||
kfree(server_conf.conf[idx]);
|
||||
server_conf.conf[idx] = kstrdup(val, GFP_KERNEL);
|
||||
server_conf.conf[idx] = kstrdup(val, KSMBD_DEFAULT_GFP);
|
||||
if (!server_conf.conf[idx])
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
@@ -415,7 +415,7 @@ static int __queue_ctrl_work(int type)
|
||||
{
|
||||
struct server_ctrl_struct *ctrl;
|
||||
|
||||
ctrl = kmalloc(sizeof(struct server_ctrl_struct), GFP_KERNEL);
|
||||
ctrl = kmalloc(sizeof(struct server_ctrl_struct), KSMBD_DEFAULT_GFP);
|
||||
if (!ctrl)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user