struct file_id id;
struct smb2_lease_key lease_key;
struct GUID client_guid;
+ size_t num_kept;
size_t num_broken;
};
&e->lease_key);
if (our_own) {
DEBUG(10, ("Don't break our own lease\n"));
+ state->num_kept += 1;
return false;
}
DBG_WARNING("share_mode_forall_entries failed\n");
}
- if (state.num_broken == 0) {
+ if (state.num_broken == 0 && state.num_kept == 0) {
/*
- * Lazy update here. It might be that the read lease
- * has gone in the meantime.
+ * Lazy update here. It might be that all leases
+ * have gone in the meantime.
*/
uint32_t acc, sh, ls;
share_mode_flags_get(lck, &acc, &sh, &ls);
- ls &= ~SMB2_LEASE_READ;
+ ls &= ~(SMB2_LEASE_READ|SMB2_LEASE_WRITE|SMB2_LEASE_HANDLE);
share_mode_flags_set(lck, acc, sh, ls, NULL);
}