* [Cluster-devel] [libgfs2 PATCH] libgfs2: Check rgd->bits before referencing it
[not found] <543497282.28256766.1442251172899.JavaMail.zimbra@redhat.com>
@ 2015-09-14 17:20 ` Bob Peterson
2015-09-16 10:47 ` Andrew Price
0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2015-09-14 17:20 UTC (permalink / raw)
To: cluster-devel.redhat.com
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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [libgfs2 PATCH] libgfs2: Check rgd->bits before referencing it
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
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Price @ 2015-09-16 10:47 UTC (permalink / raw)
To: cluster-devel.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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-16 10:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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 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).