From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 7/9] gfs2: Fix marking bitmaps non-full
Date: Fri, 12 Oct 2018 10:15:14 +0100 [thread overview]
Message-ID: <c8165d7b-3a97-32b4-c6f6-c2811564fbe1@redhat.com> (raw)
In-Reply-To: <20181011192045.20546-8-agruenba@redhat.com>
Hi,
On 11/10/18 20:20, Andreas Gruenbacher wrote:
> Reservations in gfs can span multiple gfs2_bitmaps (but they won't span
> multiple resource groups). When removing a reservation, we want to
> clear the GBF_FULL flags of all involved gfs2_bitmaps, not just that of
> the first bitmap.
>
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> ---
> fs/gfs2/rgrp.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
The series looks good I think. This one though looks like a bug fix and
should probably go to -stable too?
Steve.
>
> diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
> index f47c76d9d9d0..7c5904c49a6a 100644
> --- a/fs/gfs2/rgrp.c
> +++ b/fs/gfs2/rgrp.c
> @@ -641,7 +641,10 @@ static void __rs_deltree(struct gfs2_blkreserv *rs)
> RB_CLEAR_NODE(&rs->rs_node);
>
> if (rs->rs_free) {
> - struct gfs2_bitmap *bi = rbm_bi(&rs->rs_rbm);
> + u64 last_block = gfs2_rbm_to_block(&rs->rs_rbm) +
> + rs->rs_free - 1;
> + struct gfs2_rbm last_rbm = { .rgd = rs->rs_rbm.rgd, };
> + struct gfs2_bitmap *start, *last;
>
> /* return reserved blocks to the rgrp */
> BUG_ON(rs->rs_rbm.rgd->rd_reserved < rs->rs_free);
> @@ -652,7 +655,13 @@ static void __rs_deltree(struct gfs2_blkreserv *rs)
> it will force the number to be recalculated later. */
> rgd->rd_extfail_pt += rs->rs_free;
> rs->rs_free = 0;
> - clear_bit(GBF_FULL, &bi->bi_flags);
> + if (gfs2_rbm_from_block(&last_rbm, last_block))
> + return;
> + start = rbm_bi(&rs->rs_rbm);
> + last = rbm_bi(&last_rbm);
> + do
> + clear_bit(GBF_FULL, &start->bi_flags);
> + while (start++ != last);
> }
> }
>
next prev parent reply other threads:[~2018-10-12 9:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 19:20 [Cluster-devel] [PATCH 0/9] gfs2: Minor cleanups and fixes Andreas Gruenbacher
2018-10-11 19:20 ` [Cluster-devel] [PATCH 1/9] gfs2: Always check the result of gfs2_rbm_from_block Andreas Gruenbacher
2018-10-11 19:20 ` [Cluster-devel] [PATCH 2/9] gfs2: Clean up out-of-bounds check in gfs2_rbm_from_block Andreas Gruenbacher
2018-10-11 19:20 ` [Cluster-devel] [PATCH 3/9] gfs2: Move rs_{sizehint, rgd_gh} fields into the inode Andreas Gruenbacher
2018-10-11 19:20 ` [Cluster-devel] [PATCH 4/9] gfs2: Remove unused RGRP_RSRV_MINBYTES definition Andreas Gruenbacher
2018-10-11 19:20 ` [Cluster-devel] [PATCH 5/9] gfs2: Rename bitmap.bi_{len => bytes} Andreas Gruenbacher
2018-10-11 19:20 ` [Cluster-devel] [PATCH 6/9] gfs2: Fix some minor typos Andreas Gruenbacher
2018-10-11 19:20 ` [Cluster-devel] [PATCH 7/9] gfs2: Fix marking bitmaps non-full Andreas Gruenbacher
2018-10-12 9:15 ` Steven Whitehouse [this message]
2018-10-12 11:40 ` Andreas Gruenbacher
2018-10-12 12:06 ` Bob Peterson
2018-10-12 12:07 ` Steven Whitehouse
2018-10-11 19:20 ` [Cluster-devel] [PATCH 8/9] gfs2: Remove unnecessary gfs2_rlist_alloc parameter Andreas Gruenbacher
2018-10-11 19:20 ` [Cluster-devel] [PATCH 9/9] gfs2: Pass resource group to rgblk_free Andreas Gruenbacher
2018-10-12 12:48 ` [Cluster-devel] [PATCH 0/9] gfs2: Minor cleanups and fixes Bob Peterson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c8165d7b-3a97-32b4-c6f6-c2811564fbe1@redhat.com \
--to=swhiteho@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).