Skip to contentSkip to conversation

ksmbd: don't send oplock break if rename fails

PATCH New Namjae Jeon 1 participant 1 message Mar 31, 2024

Subsystems (2)
lore
Share & tools
lore

Namjae Jeon

author maintainer
#0 lore raw

PATCH 1/1 ksmbd: don't send oplock break if rename fails

Don't send oplock break if rename fails. This patch fix smb2.oplock.batch20 test.

---
 fs/smb/server/smb2pdu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/smb/server/smb2pdu.c +2 -1
index d478fa0c57ab..5723bbf372d7 100644
@@ -5857,8 +5857,9 @@ static int smb2_rename(struct ksmbd_work *work,
 	if (!file_info->ReplaceIfExists)
 		flags = RENAME_NOREPLACE;
 
-	smb_break_all_levII_oplock(work, fp, 0);
 	rc = ksmbd_vfs_rename(work, &fp->filp->f_path, new_name, flags);
+	if (!rc)
+		smb_break_all_levII_oplock(work, fp, 0);
 out:
 	kfree(new_name);
 	return rc;
Signature · 1 line
2.25.1