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.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr/src/uts/common/fs/smbsrv/smb_ofile.c b/usr/src/uts/common/fs/smbsrv/smb_ofile.c
index 59a3900513..9c275f9527 100644
--- a/usr/src/uts/common/fs/smbsrv/smb_ofile.c
+++ b/usr/src/uts/common/fs/smbsrv/smb_ofile.c
@@ -23,7 +23,7 @@
* Copyright 2011-2020 Tintri by DDN, Inc. All rights reserved.
* Copyright 2016 Syneto S.R.L. All rights reserved.
* Copyright (c) 2016 by Delphix. All rights reserved.
- * Copyright 2021 RackTop Systems, Inc.
+ * Copyright 2022 RackTop Systems, Inc.
*/
/*
@@ -581,6 +581,16 @@ smb_ofile_close(smb_ofile_t *of, int32_t mtime_sec)
(void) smb_node_setattr(NULL, of->f_node,
of->f_cr, NULL, pa);
}
+ /*
+ * Don't want the performance cost of generating
+ * change notify events on every write. Instead:
+ * Keep track of the fact that we have written
+ * data via this handle, and do change notify
+ * work on the first write, and during close.
+ */
+ if (of->f_written) {
+ smb_node_notify_modified(of->f_node);
+ }
smb_server_dec_files(of->f_server);
break;