struct deferred_open_record {
bool delayed_for_oplocks;
bool async_open;
+ bool cancelled;
struct file_id id;
/*
return rec->async_open;
}
+bool cancel_open_async(struct deferred_open_record *rec)
+{
+ if (rec->cancelled) {
+ return false;
+ }
+
+ if (is_deferred_open_async(rec)) {
+ /* Can't cancel an async create. */
+ return false;
+ }
+
+ rec->cancelled = true;
+ return true;
+}
+
static bool clear_ads(uint32_t create_disposition)
{
bool ret = false;
/* Ensure we don't reprocess this message. */
remove_deferred_open_message_smb(req->xconn, req->mid);
+ if (open_rec->cancelled) {
+ return NT_STATUS_CANCELLED;
+ }
+
first_open_attempt = false;
}
}