cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Drop inadequate rgrps from the reservation tree
Date: Tue, 05 Nov 2013 11:04:00 +0000	[thread overview]
Message-ID: <1383649440.2713.15.camel@menhir> (raw)
In-Reply-To: <1944013634.15902000.1383584035435.JavaMail.root@redhat.com>

Hi,

Looks good. Thanks,

Steve.

On Mon, 2013-11-04 at 11:53 -0500, Bob Peterson wrote:
> Hi,
> 
> This patch fixes a bug in the GFS2 block allocation code. The problem
> starts if a process already has a multi-block reservation, but for
> some reason, another process disqualifies it from further allocations.
> For example, the other process might set on the GFS2_RDF_ERROR bit.
> The process holding the reservation jumps to label skip_rgrp, but
> that label comes after the code that removes the reservation from the
> tree. Therefore, the no longer usable reservation is not removed from
> the rgrp's reservations tree; it's lost. Eventually, the lost reservation
> causes the count of reserved blocks to get off, and eventually that
> causes a BUG_ON(rs->rs_rbm.rgd->rd_reserved < rs->rs_free) to trigger.
> This patch moves the call to after label skip_rgrp so that the
> disqualified reservation is properly removed from the tree, thus keeping
> the rgrp rd_reserved count sane.
> 
> Regards,
> 
> Bob Peterson
> Red Hat File Systems
> 
> Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
> ---
> diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
> index 711e835..ddcddce 100644
> --- a/fs/gfs2/rgrp.c
> +++ b/fs/gfs2/rgrp.c
> @@ -1949,15 +1949,16 @@ int gfs2_inplace_reserve(struct gfs2_inode *ip, const struct gfs2_alloc_parms *a
>  			return 0;
>  		}
>  
> -		/* Drop reservation, if we couldn't use reserved rgrp */
> -		if (gfs2_rs_active(rs))
> -			gfs2_rs_deltree(rs);
>  check_rgrp:
>  		/* Check for unlinked inodes which can be reclaimed */
>  		if (rs->rs_rbm.rgd->rd_flags & GFS2_RDF_CHECK)
>  			try_rgrp_unlink(rs->rs_rbm.rgd, &last_unlinked,
>  					ip->i_no_addr);
>  skip_rgrp:
> +		/* Drop reservation, if we couldn't use reserved rgrp */
> +		if (gfs2_rs_active(rs))
> +			gfs2_rs_deltree(rs);
> +
>  		/* Unlock rgrp if required */
>  		if (!rg_locked)
>  			gfs2_glock_dq_uninit(&rs->rs_rgd_gh);
> 




      reply	other threads:[~2013-11-05 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <638877571.15901094.1383583999843.JavaMail.root@redhat.com>
2013-11-04 16:53 ` [Cluster-devel] [GFS2 PATCH] GFS2: Drop inadequate rgrps from the reservation tree Bob Peterson
2013-11-05 11:04   ` Steven Whitehouse [this message]

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=1383649440.2713.15.camel@menhir \
    --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).