All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [libgfs2 PATCH] libgfs2: Check rgd->bits before referencing it
Date: Wed, 16 Sep 2015 11:47:18 +0100	[thread overview]
Message-ID: <55F948B6.40206@redhat.com> (raw)
In-Reply-To: <1523098984.28256979.1442251211308.JavaMail.zimbra@redhat.com>

On 14/09/15 18:20, Bob Peterson wrote:
> Hi,
>
> This patch adds a check to function gfs2_rgrp_free to make sure
> rgd->bits is non-zero before attempting to reference it.
> This might be NULL because no buffers actually existed because
> it was concocted in an attempt to repair damaged rgrps in fsck.
>
> Regards,
>
> Bob Peterson
> Red Hat File Systems
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> ---
> diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
> index cf4385a..2a55523 100644
> --- a/gfs2/libgfs2/rgrp.c
> +++ b/gfs2/libgfs2/rgrp.c
> @@ -244,7 +244,7 @@ void gfs2_rgrp_free(struct osi_root *rgrp_tree)
>   	while ((n = osi_first(rgrp_tree))) {
>   		rgd = (struct rgrp_tree *)n;
>
> -		if (rgd->bits[0].bi_bh) { /* if a buffer exists */
> +		if (rgd->bits && rgd->bits[0].bi_bh) { /* if a buffer exists */
>   			rgs_since_sync++;
>   			if (rgs_since_sync >= RG_SYNC_TOLERANCE) {
>   				if (!sdp)
>

ACK,

Andy



      reply	other threads:[~2015-09-16 10:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <543497282.28256766.1442251172899.JavaMail.zimbra@redhat.com>
2015-09-14 17:20 ` [Cluster-devel] [libgfs2 PATCH] libgfs2: Check rgd->bits before referencing it Bob Peterson
2015-09-16 10:47   ` Andrew Price [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=55F948B6.40206@redhat.com \
    --to=anprice@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.