Fix a problem that shows up if less than the full complement of

lock sectors are defined ("number_of_keys" argument to gbde init being
less than 4 in the default compile).
This commit is contained in:
Poul-Henning Kamp 2004-09-11 17:58:53 +00:00
parent cbca0b53e5
commit 4090065137

@ -311,7 +311,7 @@ g_bde_map_sector(struct g_bde_work *wp)
/* Compensate for lock sectors */
for (u = 0; u < G_BDE_MAXKEYS; u++) {
/* Find the start of this lock sector */
ko = kp->lsector[u] & ~(kp->sectorsize - 1);
ko = kp->lsector[u] & ~((uint64_t)kp->sectorsize - 1);
if (wp->kso >= ko)
wp->kso += kp->sectorsize;