diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2010-02-12 11:10:55 +0100 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2010-02-12 11:16:14 +0100 |
commit | 07ccb7bf2c928fef4fea2cda69ba2e23479578db (patch) | |
tree | 6aee126126d3a1245b5b9f79abe2101098392187 | |
parent | GFS2: Fix error code (diff) | |
download | linux-07ccb7bf2c928fef4fea2cda69ba2e23479578db.tar.xz linux-07ccb7bf2c928fef4fea2cda69ba2e23479578db.zip |
GFS2: Fix bmap allocation corner-case bug
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>
-rw-r--r-- | fs/gfs2/bmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 6d47379e794b..583e823307ae 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -541,7 +541,7 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, *ptr++ = cpu_to_be64(bn++); break; } - } while (state != ALLOC_DATA); + } while ((state != ALLOC_DATA) || !dblock); ip->i_height = height; gfs2_add_inode_blocks(&ip->i_inode, alloced); |