diff options
-rw-r--r-- | source3/locking/brlock.c | 16 | ||||
-rw-r--r-- | source3/modules/vfs_btrfs.c | 5 | ||||
-rw-r--r-- | source3/modules/vfs_default.c | 9 | ||||
-rw-r--r-- | source3/smbd/aio.c | 10 | ||||
-rw-r--r-- | source3/smbd/scavenger.c | 3 |
5 files changed, 41 insertions, 2 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index 78c2538d09..df689a7ad5 100644 --- a/source3/locking/brlock.c +++ b/source3/locking/brlock.c @@ -1526,12 +1526,18 @@ void brl_close_fnum(struct messaging_context *msg_ctx, bool brl_mark_disconnected(struct files_struct *fsp) { uint32_t tid = fsp->conn->cnum; - uint64_t smblctx = fsp->op->global->open_persistent_id; + uint64_t smblctx; uint64_t fnum = fsp->fnum; unsigned int i; struct server_id self = messaging_server_id(fsp->conn->sconn->msg_ctx); struct byte_range_lock *br_lck = NULL; + if (fsp->op == NULL) { + return false; + } + + smblctx = fsp->op->global->open_persistent_id; + if (!fsp->op->global->durable) { return false; } @@ -1586,12 +1592,18 @@ bool brl_mark_disconnected(struct files_struct *fsp) bool brl_reconnect_disconnected(struct files_struct *fsp) { uint32_t tid = fsp->conn->cnum; - uint64_t smblctx = fsp->op->global->open_persistent_id; + uint64_t smblctx; uint64_t fnum = fsp->fnum; unsigned int i; struct server_id self = messaging_server_id(fsp->conn->sconn->msg_ctx); struct byte_range_lock *br_lck = NULL; + if (fsp->op == NULL) { + return false; + } + + smblctx = fsp->op->global->open_persistent_id; + if (!fsp->op->global->durable) { return false; } diff --git a/source3/modules/vfs_btrfs.c b/source3/modules/vfs_btrfs.c index 4ecf7ab23c..f062eba37b 100644 --- a/source3/modules/vfs_btrfs.c +++ b/source3/modules/vfs_btrfs.c @@ -98,6 +98,11 @@ static struct tevent_req *btrfs_copy_chunk_send(struct vfs_handle_struct *handle return tevent_req_post(req, ev); } + if (src_fsp->op == NULL || dest_fsp->op == NULL) { + tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR); + return tevent_req_post(req, ev); + } + init_strict_lock_struct(src_fsp, src_fsp->op->global->open_persistent_id, src_off, diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 82d059c28f..f6200edb6a 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -1393,6 +1393,10 @@ static struct tevent_req *vfswrap_copy_chunk_send(struct vfs_handle_struct *hand off_t this_num = MIN(sizeof(vfs_cc_state->buf), num - vfs_cc_state->copied); + if (src_fsp->op == NULL) { + tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR); + return tevent_req_post(req, ev); + } init_strict_lock_struct(src_fsp, src_fsp->op->global->open_persistent_id, src_off, @@ -1426,6 +1430,11 @@ static struct tevent_req *vfswrap_copy_chunk_send(struct vfs_handle_struct *hand src_off += ret; + if (dest_fsp->op == NULL) { + tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR); + return tevent_req_post(req, ev); + } + init_strict_lock_struct(dest_fsp, dest_fsp->op->global->open_persistent_id, dest_off, diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c index eec29f664f..44d771ebf0 100644 --- a/source3/smbd/aio.c +++ b/source3/smbd/aio.c @@ -688,6 +688,11 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn, return NT_STATUS_RETRY; } + if (fsp->op == NULL) { + /* No AIO on internal opens. */ + return NT_STATUS_RETRY; + } + if ((!min_aio_read_size || (smb_maxcnt < min_aio_read_size)) && !SMB_VFS_AIO_FORCE(fsp)) { /* Too small a read for aio request. */ @@ -839,6 +844,11 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn, return NT_STATUS_RETRY; } + if (fsp->op == NULL) { + /* No AIO on internal opens. */ + return NT_STATUS_RETRY; + } + if ((!min_aio_write_size || (in_data.length < min_aio_write_size)) && !SMB_VFS_AIO_FORCE(fsp)) { /* Too small a write for aio request. */ diff --git a/source3/smbd/scavenger.c b/source3/smbd/scavenger.c index e6e2878806..122305e04b 100644 --- a/source3/smbd/scavenger.c +++ b/source3/smbd/scavenger.c @@ -418,6 +418,9 @@ void scavenger_schedule_disconnected(struct files_struct *fsp) struct scavenger_message msg; DATA_BLOB msg_blob; + if (fsp->op == NULL) { + return; + } nttime_to_timeval(&disconnect_time, fsp->op->global->disconnect_time); timeout_usec = 1000 * fsp->op->global->durable_timeout_msec; until = timeval_add(&disconnect_time, |