mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] smb: client: use GFP_KERNEL in get_targets()
@ 2026-09-22 17:37 Fredric Cover
  2026-09-23  1:24 ` Paulo Alcantara
  0 siblings, 1 reply; 2+ messages in thread
From: Fredric Cover @ 2026-09-22 17:37 UTC (permalink / raw)
  To: Paulo Alcantara, Namjae Jeon
  Cc: ChenXiaoSong, Tom Talpey, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, linux-cifs, linux-kernel, Fredric Cover

Currently, get_targets() uses GFP_ATOMIC to allocate the cache target
iterator and to duplicate t->name. The callers of get_targets() are
in a sleepable context; therefore, switch to GFP_KERNEL to reduce
risk of failure and reduce pressure on emergency pools in low-memory
scenarios.

Signed-off-by: Fredric Cover <fredric.cover.lkernel@gmail.com>
---
 fs/smb/client/dfs_cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/smb/client/dfs_cache.c b/fs/smb/client/dfs_cache.c
index f6c4259479c5..f727fb261331 100644
--- a/fs/smb/client/dfs_cache.c
+++ b/fs/smb/client/dfs_cache.c
@@ -798,13 +798,13 @@ static int get_targets(struct cache_entry *ce, struct dfs_cache_tgt_list *tl)
 	INIT_LIST_HEAD(head);
 
 	list_for_each_entry(t, &ce->tlist, list) {
-		it = kzalloc_obj(*it, GFP_ATOMIC);
+		it = kzalloc_obj(*it, GFP_KERNEL);
 		if (!it) {
 			rc = -ENOMEM;
 			goto err_free_it;
 		}
 
-		it->it_name = kstrdup(t->name, GFP_ATOMIC);
+		it->it_name = kstrdup(t->name, GFP_KERNEL);
 		if (!it->it_name) {
 			kfree(it);
 			rc = -ENOMEM;
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] smb: client: use GFP_KERNEL in get_targets()
  2026-09-22 17:37 [PATCH] smb: client: use GFP_KERNEL in get_targets() Fredric Cover
@ 2026-09-23  1:24 ` Paulo Alcantara
  0 siblings, 0 replies; 2+ messages in thread
From: Paulo Alcantara @ 2026-09-23  1:24 UTC (permalink / raw)
  To: Fredric Cover, Namjae Jeon
  Cc: ChenXiaoSong, Tom Talpey, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, linux-cifs, linux-kernel, Fredric Cover

Fredric Cover <fredric.cover.lkernel@gmail.com> writes:

> Currently, get_targets() uses GFP_ATOMIC to allocate the cache target
> iterator and to duplicate t->name. The callers of get_targets() are
> in a sleepable context; therefore, switch to GFP_KERNEL to reduce
> risk of failure and reduce pressure on emergency pools in low-memory
> scenarios.
> ...

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-23  1:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 17:37 [PATCH] smb: client: use GFP_KERNEL in get_targets() Fredric Cover
2026-09-23  1:24 ` Paulo Alcantara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®