cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] gfs2: use reservation rgd, not inode rgd for allocating blocks
       [not found] <1186035137.43601549.1529345828415.JavaMail.zimbra@redhat.com>
@ 2018-06-18 18:17 ` Bob Peterson
  2018-06-20 19:22   ` Andreas Gruenbacher
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2018-06-18 18:17 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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 <rpeterso@redhat.com>
---
 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;



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [GFS2 PATCH] gfs2: use reservation rgd, not inode rgd for allocating blocks
  2018-06-18 18:17 ` [Cluster-devel] [GFS2 PATCH] gfs2: use reservation rgd, not inode rgd for allocating blocks Bob Peterson
@ 2018-06-20 19:22   ` Andreas Gruenbacher
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Gruenbacher @ 2018-06-20 19:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Bob,

On 18 June 2018 at 20:17, Bob Peterson <rpeterso@redhat.com> wrote:
> 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 <rpeterso@redhat.com>
> ---
>  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;
>

I think we can do better than that; see the two patches I've just posted.

Thanks,
Andreas



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-20 19:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1186035137.43601549.1529345828415.JavaMail.zimbra@redhat.com>
2018-06-18 18:17 ` [Cluster-devel] [GFS2 PATCH] gfs2: use reservation rgd, not inode rgd for allocating blocks Bob Peterson
2018-06-20 19:22   ` Andreas Gruenbacher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).