All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Iliopoulos <ailiop@suse.com>
To: sandeen@sandeen.net
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH] xfs_db: fix crc invalidation segfault
Date: Mon, 20 Apr 2020 21:52:35 +0200	[thread overview]
Message-ID: <20200420195235.14260-1-ailiop@suse.com> (raw)

The nowrite_ops var is declared within nested block scope but used
outside that scope, causing xfs_db to crash while trying to defererence
the verify_write pointer. Fix it by lifting the declaration to the outer
scope, where it is accessed.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
---
 db/crc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/db/crc.c b/db/crc.c
index 95161c6df..b23417a11 100644
--- a/db/crc.c
+++ b/db/crc.c
@@ -53,6 +53,7 @@ crc_f(
 	char		**argv)
 {
 	const struct xfs_buf_ops *stashed_ops = NULL;
+	struct xfs_buf_ops nowrite_ops;
 	extern char	*progname;
 	const field_t	*fields;
 	const ftattr_t	*fa;
@@ -127,7 +128,6 @@ crc_f(
 	}
 
 	if (invalidate) {
-		struct xfs_buf_ops nowrite_ops;
 		flist_t		*sfl;
 		int		bit_length;
 		int		parentoffset;
-- 
2.26.1


             reply	other threads:[~2020-04-20 19:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20 19:52 Anthony Iliopoulos [this message]
2020-04-20 20:33 ` [PATCH] xfs_db: fix crc invalidation segfault Eric Sandeen
2020-04-21  0:05   ` Darrick J. Wong
2020-04-21  0:26     ` Eric Sandeen
2020-05-12 14:16 Anthony Iliopoulos
2020-05-12 15:08 ` Eric Sandeen

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=20200420195235.14260-1-ailiop@suse.com \
    --to=ailiop@suse.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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.