[PATCH] smb: client: change allocation requirements in smb2_compound_op

From: Fredric Cover

Date: Wed Apr 29 2026 - 17:35:50 EST


From: Fredric Cover <fredric.cover.lkernel@xxxxxxxxx>

Currently, smb2_compound_op() allocates
struct smb2_compound_vars *vars using GFP_ATOMIC, although
smb2_compound_op() can sleep when it calls compound_send_recv()
before vars is freed.

Allocate vars using GFP_KERNEL.

Signed-off-by: Fredric Cover <fredric.cover.lkernel@xxxxxxxxx>
---
Please note that I am new to patching the Linux kernel.
I appreciate advice.
---
fs/smb/client/smb2inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c
index c6dd282fc..286912616 100644
--- a/fs/smb/client/smb2inode.c
+++ b/fs/smb/client/smb2inode.c
@@ -230,7 +230,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
num_rqst = 0;
server = cifs_pick_channel(ses);

- vars = kzalloc_obj(*vars, GFP_ATOMIC);
+ vars = kzalloc_obj(*vars, GFP_KERNEL);
if (vars == NULL) {
rc = -ENOMEM;
goto out;
--
2.43.0