diff --git a/0005-fsck.gfs2-Fix-declaration-mismatch-for-invalidate_.patch b/0005-fsck.gfs2-Fix-declaration-mismatch-for-invalidate_.patch new file mode 100644 index 0000000000000000000000000000000000000000..74cf25076af03ac0d54f00fdd636df08ca1ed065 --- /dev/null +++ b/0005-fsck.gfs2-Fix-declaration-mismatch-for-invalidate_.patch @@ -0,0 +1,80 @@ +From fda789cef3097fd779e25b2236fa7c86646a0a04 Mon Sep 17 00:00:00 2001 +From: Andrew Price +Date: Tue, 27 Apr 2021 11:04:57 +0100 +Subject: [PATCH] fsck.gfs2: Fix declaration mismatch for invalidate_* + +Move the invalidate_fxns struct definition down so that the forward +declarations for those functions can be removed to avoid mismatches. + +Fixes sparse error: + + pass1.c:1146:12: error: symbol 'invalidate_data' redeclared with + different type (incompatible argument 6 (different base types)) + +Signed-off-by: Andrew Price +--- + gfs2/fsck/pass1.c | 34 ++++++++++------------------------ + 1 file changed, 10 insertions(+), 24 deletions(-) + +diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c +index 71d6a46d..0cd9b274 100644 +--- a/gfs2/fsck/pass1.c ++++ b/gfs2/fsck/pass1.c +@@ -68,20 +68,6 @@ static int check_extended_leaf_eattr(struct gfs2_inode *ip, int i, + void *private); + static int finish_eattr_indir(struct gfs2_inode *ip, int leaf_pointers, + int leaf_pointer_errors, void *private); +-static int invalidate_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h, +- int *is_valid, int *was_duplicate, void *private); +-static int invalidate_leaf(struct gfs2_inode *ip, uint64_t block, +- void *private); +-static int invalidate_data(struct gfs2_inode *ip, uint64_t metablock, +- uint64_t block, void *private, +- struct gfs2_buffer_head *bh, uint64_t *ptr); +-static int invalidate_eattr_indir(struct gfs2_inode *ip, uint64_t block, +- uint64_t parent, +- struct gfs2_buffer_head **bh, +- void *private); +-static int invalidate_eattr_leaf(struct gfs2_inode *ip, uint64_t block, +- uint64_t parent, struct gfs2_buffer_head **bh, +- void *private); + static int handle_ip(struct gfs2_sbd *sdp, struct gfs2_inode *ip); + static int delete_block(struct gfs2_inode *ip, uint64_t block, + struct gfs2_buffer_head **bh, const char *btype, +@@ -202,16 +188,6 @@ struct metawalk_fxns pass1_fxns = { + .delete_block = delete_block, + }; + +-struct metawalk_fxns invalidate_fxns = { +- .private = NULL, +- .check_metalist = invalidate_metadata, +- .check_data = invalidate_data, +- .check_leaf = invalidate_leaf, +- .check_eattr_indir = invalidate_eattr_indir, +- .check_eattr_leaf = invalidate_eattr_leaf, +- .delete_block = delete_block, +-}; +- + /* + * resuscitate_metalist - make sure a system directory entry's metadata blocks + * are marked "in use" in the bitmap. +@@ -1169,6 +1145,16 @@ static int invalidate_eattr_leaf(struct gfs2_inode *ip, uint64_t block, + NULL, NULL); + } + ++struct metawalk_fxns invalidate_fxns = { ++ .private = NULL, ++ .check_metalist = invalidate_metadata, ++ .check_data = invalidate_data, ++ .check_leaf = invalidate_leaf, ++ .check_eattr_indir = invalidate_eattr_indir, ++ .check_eattr_leaf = invalidate_eattr_leaf, ++ .delete_block = delete_block, ++}; ++ + /** + * Check for massive amounts of pointer corruption. If the block has + * lots of out-of-range pointers, we can't trust any of the pointers. +-- +2.33.0 + diff --git a/gfs2-utils.spec b/gfs2-utils.spec index 9732dbd11e27eaafe0ec425b8e21b8b02d439650..e149a1f98ff2bac70d1a7148ed98ff6d97a29bf0 100644 --- a/gfs2-utils.spec +++ b/gfs2-utils.spec @@ -1,6 +1,6 @@ Name: gfs2-utils Version: 3.4.1 -Release: 3 +Release: 4 Summary: Utilities for managing the global file system (GFS2) License: GPLv2+ and LGPLv2+ @@ -11,6 +11,7 @@ Patch0: 0001-gfs2-edit-always-use-s-style-format-for-printf-style.patch Patch1: 0002-fix-error-format-in-gfs2hex.patch Patch2: 0003-gfs2_jadd-Use-fallocate-to-preallocate-journals.patch Patch3: 0004-gfs2_jadd-Don-t-fsync-after-each-block-written.patch +Patch4: 0005-fsck.gfs2-Fix-declaration-mismatch-for-invalidate_.patch BuildRequires: ncurses-devel kernel-headers automake libtool zlib-devel gettext-devel BuildRequires: bison flex libblkid-devel libuuid-devel check-devel bzip2-devel make @@ -56,6 +57,9 @@ rm -f %{buildroot}%{_mandir}/man8/gfs2_lockcapture.8 %changelog +* Thu Dec 28 2023 liyuanyuan - 3.4.1-4 +- fsck.gfs2: Fix declaration mismatch for invalidate_* + * Mon Jan 9 2023 yaoguangzhong - 3.4.1-3 - backport gfs2_jadd: don't fsync after each block written