Commit 95539719 authored by Stephen Lord's avatar Stephen Lord Committed by Christoph Hellwig

XFS: fix some off by one errors in the busy list search code

The errors were benevolent, we flushed the log more than we needed to.

Modid: 2.5.x-xfs:slinx:129745a
parent c05feefb
......@@ -2597,7 +2597,7 @@ xfs_alloc_search_busy(xfs_trans_t *tp,
s = mutex_spinlock(&mp->m_perag[agno].pagb_lock);
cnt = mp->m_perag[agno].pagb_count;
uend = bno + len;
uend = bno + len - 1;
/* search pagb_list for this slot, skipping open slots */
for (bsy = mp->m_perag[agno].pagb_list, n = 0;
......@@ -2607,16 +2607,16 @@ xfs_alloc_search_busy(xfs_trans_t *tp,
* (start1,length1) within (start2, length2)
*/
if (bsy->busy_tp != NULL) {
bend = bsy->busy_start + bsy->busy_length;
if ( (bno >= bsy->busy_start && bno <= bend) ||
(uend >= bsy->busy_start && uend <= bend) ||
(bno <= bsy->busy_start && uend >= bsy->busy_start) ) {
bend = bsy->busy_start + bsy->busy_length - 1;
if ((bno > bend) ||
(uend < bsy->busy_start)) {
cnt--;
} else {
TRACE_BUSYSEARCH("xfs_alloc_search_busy",
"found1", agno, bno, len, n,
tp);
break;
}
cnt--;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment