Skip to contentSkip to conversation

cifs: some missing initializations on replay

PATCH In review [email protected] 2 participants 2 messages Feb 14 – Feb 15

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: some missing initializations on replay

From: Shyam Prasad N <[email protected]>

In several places in the code, we have a label to signify the start of the code where a request can be replayed if necessary. However, some of these places were missing the necessary reinitializations of certain local variables before replay.

This change makes sure that these variables get initialized after the label.

---
 fs/smb/client/smb2ops.c | 2 ++
 fs/smb/client/smb2pdu.c | 1 +
 2 files changed, 3 insertions(+)
fs/smb/client/smb2ops.c +2 -0
index 262df6d2c2c82..ae39b3c027d2d 100644
@@ -1185,6 +1185,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
 
 replay_again:
 	/* reinitialize for possible replay */
+	used_len = 0;
 	flags = CIFS_CP_CREATE_CLOSE_OP;
 	oplock = SMB2_OPLOCK_LEVEL_NONE;
 	server = cifs_pick_channel(ses);
@@ -1586,6 +1587,7 @@ smb2_ioctl_query_info(const unsigned int xid,
 
 replay_again:
 	/* reinitialize for possible replay */
+	buffer = NULL;
 	flags = CIFS_CP_CREATE_CLOSE_OP;
 	oplock = SMB2_OPLOCK_LEVEL_NONE;
 	server = cifs_pick_channel(ses);
fs/smb/client/smb2pdu.c +1 -0
index 4602b4dfe8322..7f3edf42b9c3f 100644
@@ -2908,6 +2908,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 
 replay_again:
 	/* reinitialize for possible replay */
+	pc_buf = NULL;
 	flags = 0;
 	n_iov = 2;
 	server = cifs_pick_channel(ses);
Signature · 1 line
2.43.0
#1 lore raw

tentatively merged into cifs-2.6.git for-next (as well as your previous debugging patch) pending additional review and testing

Quoted 53 lines · On Sat, Feb 14, 2026 at 4:30 AM <[email protected]> wrote:

From: Shyam Prasad N <[email protected]>

In several places in the code, we have a label to signify the start of the code where a request can be replayed if necessary. However, some of these places were missing the necessary reinitializations of certain local variables before replay.

This change makes sure that these variables get initialized after the label.

---
 fs/smb/client/smb2ops.c | 2 ++
 fs/smb/client/smb2pdu.c | 1 +
 2 files changed, 3 insertions(+)
fs/smb/client/smb2ops.c +2 -0
index 262df6d2c2c82..ae39b3c027d2d 100644
@@ -1185,6 +1185,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
 
 replay_again:
        /* reinitialize for possible replay */
+       used_len = 0;
        flags = CIFS_CP_CREATE_CLOSE_OP;
        oplock = SMB2_OPLOCK_LEVEL_NONE;
        server = cifs_pick_channel(ses);
@@ -1586,6 +1587,7 @@ smb2_ioctl_query_info(const unsigned int xid,
 
 replay_again:
        /* reinitialize for possible replay */
+       buffer = NULL;
        flags = CIFS_CP_CREATE_CLOSE_OP;
        oplock = SMB2_OPLOCK_LEVEL_NONE;
        server = cifs_pick_channel(ses);
fs/smb/client/smb2pdu.c +1 -1
index 4602b4dfe8322..7f3edf42b9c3f 100644
@@ -2908,6 +2908,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 
 replay_again:
        /* reinitialize for possible replay */
+       pc_buf = NULL;
        flags = 0;
        n_iov = 2;
        server = cifs_pick_channel(ses);
--

2.43.0

Signature · 3 lines
Thanks,

Steve