diff options
Diffstat (limited to 'usr/src/uts/common/fs/smbsrv/smb_opipe.c')
| -rw-r--r-- | usr/src/uts/common/fs/smbsrv/smb_opipe.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/usr/src/uts/common/fs/smbsrv/smb_opipe.c b/usr/src/uts/common/fs/smbsrv/smb_opipe.c index ac73e9494b..83b74ee075 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_opipe.c +++ b/usr/src/uts/common/fs/smbsrv/smb_opipe.c @@ -268,11 +268,10 @@ out: * Returns 0 on success, Otherwise an NT status code. */ int -smb_opipe_open(smb_request_t *sr, uint32_t uniqid) +smb_opipe_open(smb_request_t *sr, smb_ofile_t *ofile) { smb_arg_open_t *op = &sr->sr_open; smb_attr_t *ap = &op->fqi.fq_fattr; - smb_ofile_t *ofile; smb_opipe_t *opipe; smb_error_t err; @@ -292,19 +291,24 @@ smb_opipe_open(smb_request_t *sr, uint32_t uniqid) } /* - * Note: If smb_ofile_open succeeds, the new ofile is - * in the FID lists can can be used by I/O requests. + * We might have blocked in smb_opipe_connect long enough so + * a tree disconnect might have happened. In that case, we + * would be adding an ofile to a tree that's disconnecting, + * which would interfere with tear-down. */ - op->create_options = 0; - op->pipe = opipe; - ofile = smb_ofile_open(sr, NULL, op, - SMB_FTYPE_MESG_PIPE, uniqid, &err); - op->pipe = NULL; - if (ofile == NULL) { + if (!smb_tree_is_connected(sr->tid_tree)) { smb_opipe_dealloc(opipe); - return (err.status); + return (NT_STATUS_NETWORK_NAME_DELETED); } + /* + * Note: The new opipe is given to smb_ofile_open + * via op->pipe + */ + op->pipe = opipe; + smb_ofile_open(sr, op, ofile); + op->pipe = NULL; + /* An "up" pointer, for debug. */ opipe->p_ofile = ofile; |
