Skip to content

Commit

Permalink
ocfs2: Fix heartbeat sector calculation
Browse files Browse the repository at this point in the history
This fixes things for devices which set max_sectors to 8.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
  • Loading branch information
Mathieu Avila authored and Mark Fasheh committed Sep 20, 2006
1 parent 2d56251 commit 471e3f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fs/ocfs2/cluster/heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,12 @@ static int compute_max_sectors(struct block_device *bdev)
max_pages = q->max_hw_segments;
max_pages--; /* Handle I/Os that straddle a page */

max_sectors = max_pages << (PAGE_SHIFT - 9);

if (max_pages) {
max_sectors = max_pages << (PAGE_SHIFT - 9);
} else {
/* If BIO contains 1 or less than 1 page. */
max_sectors = q->max_sectors;
}
/* Why is fls() 1-based???? */
pow_two_sectors = 1 << (fls(max_sectors) - 1);

Expand Down

0 comments on commit 471e3f5

Please sign in to comment.