From 088ae41ea793fc92f1e949ea035e6d896025acb4 Mon Sep 17 00:00:00 2001 From: Gordon Ross Date: Sun, 10 Jul 2022 21:37:04 -0400 Subject: 14989 SMB panic running smbtorture smb2.durable-open.delete_on_close1 Reviewed-by: Jerry Jelinek Reviewed-by: Garrett D'Amore Reviewed by: Andy Stormont Reviewed by: Sam Zaydel Reviewed by: Gordon Ross Reviewed by: Matt Barden Approved by: Dan McDonald --- usr/src/uts/common/fs/smbsrv/smb_common_open.c | 2 ++ usr/src/uts/common/fs/smbsrv/smb_ofile.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'usr') diff --git a/usr/src/uts/common/fs/smbsrv/smb_common_open.c b/usr/src/uts/common/fs/smbsrv/smb_common_open.c index 59c892ee88..a4b572ad28 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_common_open.c +++ b/usr/src/uts/common/fs/smbsrv/smb_common_open.c @@ -834,6 +834,8 @@ smb_common_open(smb_request_t *sr) * smb2.durable-open.delete_on_close1 */ DTRACE_PROBE1(node_deleted, smb_node_t, fnode); + tree_fid = of->f_fid; + of->f_fid = 0; smb_ofile_free(of); of = NULL; last_comp_found = B_FALSE; diff --git a/usr/src/uts/common/fs/smbsrv/smb_ofile.c b/usr/src/uts/common/fs/smbsrv/smb_ofile.c index d3f2bad47c..59a3900513 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_ofile.c +++ b/usr/src/uts/common/fs/smbsrv/smb_ofile.c @@ -405,6 +405,8 @@ smb_ofile_open( smb_node_t *node = of->f_node; ASSERT(of->f_state == SMB_OFILE_STATE_ALLOC); + ASSERT(of->f_fid != 0); + of->f_state = SMB_OFILE_STATE_OPEN; switch (of->f_ftype) { -- cgit v1.2.3