/* if header size is smaller than what we have, we'll have to recreate
the index to grow it. so don't even try regular locking. */
- if (index->map->hdr == &index->map->hdr_copy &&
- index->map->hdr->base_header_size < sizeof(*index->hdr)) {
+ if (index->map->hdr != &index->map->hdr_copy &&
+ index->map->hdr->base_header_size == sizeof(*index->hdr)) {
/* wait two seconds for exclusive lock */
ret = mail_index_lock(index, F_WRLCK, 2, TRUE, lock_id_r);
if (ret > 0)