xfsprogs/0006-xfs_db-fix-crc-invalidation-segfault.patch
lightmouse 24b4ee7dcb backport bugfix patches from community
Author:    wuguanghao <wuguanghao3@huawei.com>
Date:      Mon Mar 14 20:12:17 2022 +0800
(cherry picked from commit feb7ea39582af46f13599e1678473c98965b05c7)
2022-05-31 16:16:28 +08:00

42 lines
1.2 KiB
Diff

From a19679ec0fa23fd360c510f21c498dd37d35713c Mon Sep 17 00:00:00 2001
From: Anthony Iliopoulos <ailiop@suse.com>
Date: Tue, 26 May 2020 14:35:51 -0400
Subject: [PATCH] xfs_db: fix crc invalidation segfault
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.
Fixes: b64af2c48220c8 ("xfs_db: add crc manipulation commands")
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
db/crc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/db/crc.c b/db/crc.c
index 95161c6d..b23417a1 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.27.0