ocfs2: fix leaf start calculation in ocfs2_dx_dir_rebalance()
authorMark Fasheh <mfasheh@suse.com>
Thu, 19 Feb 2009 21:17:05 +0000 (13:17 -0800)
committerMark Fasheh <mfasheh@suse.com>
Fri, 3 Apr 2009 18:39:17 +0000 (11:39 -0700)
commit1d46dc08d33138c29c63d717807c08ab704fc773
tree8e4d2e1b5c49cb379c0f800e00e1cd01d33d4d0c
parentb80b549c3520b31d3bbc4b36e37e0a5102da0b94
ocfs2: fix leaf start calculation in ocfs2_dx_dir_rebalance()

ocfs2_dx_dir_rebalance() is passed the block offset of a dx leaf which needs
rebalancing. Since we rebalance an entire cluster at a time however, this
function needs to calculate the beginning of that cluster, in blocks. The
calculation was wrong, which would result in a read of non-leaf blocks. Fix
the calculation by adding ocfs2_block_to_cluster_start() which is a more
straight-forward way of determining this.

Reported-by: Tristan Ye <tristan.ye@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/dir.c
fs/ocfs2/ocfs2.h