The "deferred" array only holds enough entries for non-stale pids. We
should skip those as well when filling that array.
This bug came in with
19b6671. No issue in master and 4.1, we don't have
deferred entries anymore there.
Part of a fix for bug #10138 - smbd doesn't always clean up share modes after
hard crash.
num_deferred = 0;
for (i=0; i<lck->data->num_share_modes; i++) {
struct share_mode_entry *e = &lck->data->share_modes[i];
- if (is_deferred_open_entry(e)) {
- deferred[num_deferred] = *e;
- num_deferred += 1;
+ if (!is_deferred_open_entry(e)) {
+ continue;
+ }
+ if (share_mode_stale_pid(lck->data, i)) {
+ continue;
}
+ deferred[num_deferred] = *e;
+ num_deferred += 1;
}
/*