diff options
author | Namjae Jeon <linkinjeon@kernel.org> | 2024-03-31 14:58:26 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-04-02 16:20:35 +0200 |
commit | c1832f67035dc04fb89e6b591b64e4d515843cda (patch) | |
tree | 910393aae90a4bd48839d5b445c5bb5e33ed5fde /fs | |
parent | Linux 6.9-rc2 (diff) | |
download | linux-c1832f67035dc04fb89e6b591b64e4d515843cda.tar.xz linux-c1832f67035dc04fb89e6b591b64e4d515843cda.zip |
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: stable@vger.kernel.org
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/smb/server/smb2pdu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index d478fa0c57ab..5723bbf372d7 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -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; |