From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Mon, 18 Jun 2018 14:17:45 -0400 (EDT) Subject: [Cluster-devel] [GFS2 PATCH] gfs2: use reservation rgd, not inode rgd for allocating blocks In-Reply-To: <1186035137.43601549.1529345828415.JavaMail.zimbra@redhat.com> Message-ID: <849251789.43602062.1529345865779.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Before this patch, function gfs2_alloc_blocks used ip->i_rgd as its starting rgrp for block allocations. In most cases that's correct. However, whenever an rlist is used, it can change the i_rgd value for better performance. Therefore, we should always use the reservation rgd instead. If we don't, the gfs2_rbm_eq function may not determine that the rgd for allocations is the same as the reservation, and therefore, the reservation won't be properly adjusted. Signed-off-by: Bob Peterson --- fs/gfs2/rgrp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 9958a926cf72..5f695b8de30c 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -2361,7 +2361,7 @@ int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *nblocks, { struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); struct buffer_head *dibh; - struct gfs2_rbm rbm = { .rgd = ip->i_rgd, }; + struct gfs2_rbm rbm = { .rgd = ip->i_res.rs_rbm.rgd, }; unsigned int ndata; u64 block; /* block, within the file system scope */ int error;