diff --git a/0006-gfs2_jadd-Fix-static-analysis-warnings.patch b/0006-gfs2_jadd-Fix-static-analysis-warnings.patch new file mode 100644 index 0000000000000000000000000000000000000000..50ad7c62f03fbfa4fe95da30b532899c73dab513 --- /dev/null +++ b/0006-gfs2_jadd-Fix-static-analysis-warnings.patch @@ -0,0 +1,56 @@ +From 8a0b4b2183e05be4c92612b0a82ed64617e6a742 Mon Sep 17 00:00:00 2001 +From: Andrew Price +Date: Tue, 9 Jun 2020 15:24:28 +0100 +Subject: [PATCH] gfs2_jadd: Fix static analysis warnings + +Fix these warnings: + + gfs2/mkfs/main_jadd.c:264:8: warning: Although the value stored to + 'error' is used in the enclosing expression, the value is never actually + read from 'error' + gfs2/mkfs/main_jadd.c:514:15: warning: Assigned value is garbage or + undefined + +Signed-off-by: Andrew Price +--- + gfs2/mkfs/main_jadd.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c +index ea89c96b..03134a61 100644 +--- a/gfs2/mkfs/main_jadd.c ++++ b/gfs2/mkfs/main_jadd.c +@@ -241,7 +241,7 @@ static void print_results(struct jadd_opts *opts) + static int create_new_inode(struct jadd_opts *opts, uint64_t *addr) + { + char *name = opts->new_inode; +- int fd, error = 0; ++ int fd; + + for (;;) { + fd = open(name, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW | O_CLOEXEC, 0600); +@@ -261,9 +261,10 @@ static int create_new_inode(struct jadd_opts *opts, uint64_t *addr) + if (addr != NULL) { + struct stat st; + +- if ((error = fstat(fd, &st))) { ++ if (fstat(fd, &st) == -1) { + perror("fstat"); +- return close(fd); ++ close(fd); ++ return -1; + } + *addr = st.st_ino; + } +@@ -481,7 +482,7 @@ static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts) + unsigned int x, blocks = + sdp->jsize << (20 - sdp->sd_sb.sb_bsize_shift); + struct gfs2_log_header lh; +- uint64_t seq = RANDOM(blocks), addr; ++ uint64_t seq = RANDOM(blocks), addr = 0; + off_t off = 0; + + if ((fd = create_new_inode(opts, &addr)) < 0) +-- +2.33.0 + diff --git a/gfs2-utils.spec b/gfs2-utils.spec index b5605da847889b5fb191139332975f77b7143cd8..bfcee616c84e32f8294cabad8f922bccceaaf700 100644 --- a/gfs2-utils.spec +++ b/gfs2-utils.spec @@ -1,6 +1,6 @@ Name: gfs2-utils Version: 3.2.0 -Release: 10 +Release: 11 Summary: Global Filesystem Utilities License: GPLv2+ and LGPLv2+ @@ -12,6 +12,7 @@ Patch0002: 0002-libgfs2-Fix-gfs-2-_log_header-metadata-description.patch Patch0003: 0003-fsck.gfs2-Fix-segfault-in-build_and_check_metalist.patch Patch0004: 0004-gfs2_jadd-Handle-out-of-space-issues.patch Patch0005: 0005--gfs2_jadd-error-handling-overhaul.patch +Patch0006: 0006-gfs2_jadd-Fix-static-analysis-warnings.patch BuildRequires: ncurses-devel kernel-headers automake libtool zlib-devel gettext-devel BuildRequires: bison flex libblkid-devel libuuid-devel check-devel @@ -57,6 +58,9 @@ make -C gfs2 install DESTDIR=%{buildroot} %exclude %{_mandir}/man8/gfs2_lockcapture.8.gz %changelog +* Tue Dec 12 2023 liyuanyuan - 3.2.0-11 +- gfs2_jadd: Fix static analysis warningS + * Fri Nov 24 2023 liyuanyuan - 3.2.0-10 - gfs2_jadd: error handling overhaul