Gitweb:
http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=0eb46efa...
Commit: 0eb46efaeccbbf5f18da660e755fe193f4c325df
Parent: 443d8ee6df480d08db3e998a180b682ad0ed4210
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Aug 26 23:52:10 2014 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Fri Sep 5 14:57:46 2014 +0100
libgfs2: Fix alignment in lgfs2_rgsize_for_data
Align the result of this function such that it matches the alignment
done by other functions which calculate a resource group size. This
avoids a situation where the resource group size is smaller than the
contents meant to fill it (e.g. journal file extents).
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/rgrp.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 57551c6..8f96c9f 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -525,6 +525,7 @@ unsigned lgfs2_rgsize_for_data(uint64_t blksreq, unsigned bsize)
const uint32_t blks_rgrp = GFS2_NBBY * (bsize - sizeof(struct gfs2_rgrp));
const uint32_t blks_meta = GFS2_NBBY * (bsize - sizeof(struct gfs2_meta_header));
unsigned bitblocks = 1;
+ blksreq = (blksreq + 3) & ~3;
if (blksreq > blks_rgrp)
bitblocks += ((blksreq - blks_rgrp) + blks_meta - 1) / blks_meta;
return bitblocks + blksreq;