summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/smbsrv/smb_ofile.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/fs/smbsrv/smb_ofile.c')
-rw-r--r--usr/src/uts/common/fs/smbsrv/smb_ofile.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr/src/uts/common/fs/smbsrv/smb_ofile.c b/usr/src/uts/common/fs/smbsrv/smb_ofile.c
index 1d7a5c134f..70c546228c 100644
--- a/usr/src/uts/common/fs/smbsrv/smb_ofile.c
+++ b/usr/src/uts/common/fs/smbsrv/smb_ofile.c
@@ -23,6 +23,7 @@
* Copyright 2016 Syneto S.R.L. All rights reserved.
* Copyright (c) 2016 by Delphix. All rights reserved.
* Copyright 2020 Tintri by DDN, Inc. All rights reserved.
+ * Copyright 2021 RackTop Systems, Inc.
*/
/*
@@ -455,9 +456,13 @@ smb_ofile_close(smb_ofile_t *of, int32_t mtime_sec)
smb_llist_enter(&node->n_ofile_list, RW_READER);
mutex_enter(&node->n_oplock.ol_mutex);
- if (of->f_lease != NULL)
- smb2_lease_ofile_close(of);
- smb_oplock_break_CLOSE(node, of);
+ if (of->f_oplock_closing == B_FALSE) {
+ of->f_oplock_closing = B_TRUE;
+
+ if (of->f_lease != NULL)
+ smb2_lease_ofile_close(of);
+ smb_oplock_break_CLOSE(node, of);
+ }
mutex_exit(&node->n_oplock.ol_mutex);
smb_llist_exit(&node->n_ofile_list);