Skip to content

Commit c1832f6

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: don't send oplock break if rename fails
Don't send oplock break if rename fails. This patch fix smb2.oplock.batch20 test. Cc: [email protected] Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 39cd87c commit c1832f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5857,8 +5857,9 @@ static int smb2_rename(struct ksmbd_work *work,
58575857
if (!file_info->ReplaceIfExists)
58585858
flags = RENAME_NOREPLACE;
58595859

5860-
smb_break_all_levII_oplock(work, fp, 0);
58615860
rc = ksmbd_vfs_rename(work, &fp->filp->f_path, new_name, flags);
5861+
if (!rc)
5862+
smb_break_all_levII_oplock(work, fp, 0);
58625863
out:
58635864
kfree(new_name);
58645865
return rc;

0 commit comments

Comments
 (0)