]> git.karo-electronics.de Git - karo-tx-linux.git/commit
GFS2: Fix unclaimed_blocks() wrapping bug and clean up
authorSteven Whitehouse <swhiteho@redhat.com>
Sat, 25 Aug 2012 17:21:47 +0000 (18:21 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Sat, 25 Aug 2012 17:21:47 +0000 (18:21 +0100)
commit9117c89c4316ed7eb45a6f939a33e58bde50d611
tree494cecad08c4fb22f1c3e8b30f936cb2392cd2a4
parent246c5e27c0603f73f68834ba35a92b37ef48e98f
GFS2: Fix unclaimed_blocks() wrapping bug and clean up

When rgd->rd_free_clone is less than rgd->rd_reserved, the
unclaimed_blocks() calculation would wrap and produce
incorrect results. This patch checks for this condition
when this function is called from gfs2_mblk_search()

In addition, the use of this particular function in other
places in the code has been dropped by means of a general
clean up of gfs2_inplace_reserve(). This function is now
much easier to follow.

Also the setting of the rgd->rd_last_alloc field is corrected.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/rgrp.c