Skip to content

Commit

Permalink
ksmbd: don't send oplock break if rename fails
Browse files Browse the repository at this point in the history
commit c1832f6 upstream.

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

Cc: stable@vger.kernel.org
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
namjaejeon authored and gregkh committed Apr 10, 2024
1 parent dbba735 commit 99d6198
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/smb/server/smb2pdu.c
Expand Up @@ -5632,8 +5632,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;
Expand Down

0 comments on commit 99d6198

Please sign in to comment.