]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
GFS2: Fix bmap allocation corner-case bug
authorSteven Whitehouse <swhiteho@redhat.com>
Fri, 12 Feb 2010 10:10:55 +0000 (10:10 +0000)
committerWilly Tarreau <w@1wt.eu>
Sat, 30 Apr 2011 14:53:05 +0000 (16:53 +0200)
commit2568ab65802cb7e776a75a6f89e9e84565b3aef1
treec43e63f9b8d2da15eb3d63b9dc289b1f0b6326db
parent7404ccad11827e62290b0b4dc2dfe0b6ba70f8ad
GFS2: Fix bmap allocation corner-case bug

commit 07ccb7bf2c928fef4fea2cda69ba2e23479578db upstream.

This patch solves a corner case during allocation which occurs if both
metadata (indirect) and data blocks are required but there is an
obstacle in the filesystem (e.g. a resource group header or another
allocated block) such that when the allocation is requested only
enough blocks for the metadata are returned.

By changing the exit condition of this loop, we ensure that a
minimum of one data block will always be returned.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/gfs2/bmap.c