update to version 3.5.1
This commit is contained in:
parent
b69e835d02
commit
9cae5f8c92
@ -1,39 +0,0 @@
|
|||||||
From 17fb470356a6d55988f05ac70f06b382ef982604 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Sergei Trofimovich <slyich@gmail.com>
|
|
||||||
Date: Sun, 7 Nov 2021 09:00:31 +0000
|
|
||||||
Subject: [PATCH] gfs2/edit: always use "%s"-style format for printf()-style
|
|
||||||
functions
|
|
||||||
|
|
||||||
`ncurses-6.3` added printf-style function attributes and now makes
|
|
||||||
it easier to catch cases when user input is used in place of format
|
|
||||||
string when built with CFLAGS=-Werror=format-security:
|
|
||||||
|
|
||||||
hexedit.c:227:9: error: format not a string literal and no format arguments [-Werror=format-security]
|
|
||||||
227 | printw(s2);
|
|
||||||
| ^~~~~~
|
|
||||||
|
|
||||||
Let's wrap all the missing places with "%s" format.
|
|
||||||
---
|
|
||||||
gfs2/edit/hexedit.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
|
|
||||||
index 798639b5..88ee3e5f 100644
|
|
||||||
--- a/gfs2/edit/hexedit.c
|
|
||||||
+++ b/gfs2/edit/hexedit.c
|
|
||||||
@@ -221,10 +221,10 @@ static void gfs2instr(const char *s1, const char *s2)
|
|
||||||
{
|
|
||||||
COLORS_HIGHLIGHT;
|
|
||||||
move(line,0);
|
|
||||||
- printw(s1);
|
|
||||||
+ printw("%s", s1);
|
|
||||||
COLORS_NORMAL;
|
|
||||||
move(line,17);
|
|
||||||
- printw(s2);
|
|
||||||
+ printw("%s", s2);
|
|
||||||
line++;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.27.0
|
|
||||||
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
From f2cced91a440de26b30adf6a82f8bd459a04a4c2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: penelope <anchor_cool@163.com>
|
|
||||||
Date: Thu, 10 Mar 2022 21:30:47 +0800
|
|
||||||
Subject: [PATCH] fix error format in gfs2hex
|
|
||||||
|
|
||||||
---
|
|
||||||
gfs2/edit/gfs2hex.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
|
|
||||||
index 62d5cab..b8c027e 100644
|
|
||||||
--- a/gfs2/edit/gfs2hex.c
|
|
||||||
+++ b/gfs2/edit/gfs2hex.c
|
|
||||||
@@ -376,7 +376,7 @@ static void gfs2_inum_print2(const char *title,struct gfs2_inum *no)
|
|
||||||
if (termlines) {
|
|
||||||
check_highlight(TRUE);
|
|
||||||
move(line,2);
|
|
||||||
- printw(title);
|
|
||||||
+ printw("%s",title);
|
|
||||||
check_highlight(FALSE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
--
|
|
||||||
2.27.0
|
|
||||||
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
From 2010383c860ef8ca2a80e6394b9cb89942a426e0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrew Price <anprice@redhat.com>
|
|
||||||
Date: Thu, 18 Mar 2021 17:30:53 +0000
|
|
||||||
Subject: [PATCH] gfs2_jadd: Use fallocate to preallocate journals
|
|
||||||
|
|
||||||
Fall back to writes for ancient kernels and use larger writes in that
|
|
||||||
case to reduce the chance of fragmentation.
|
|
||||||
|
|
||||||
Signed-off-by: Andrew Price <anprice@redhat.com>
|
|
||||||
---
|
|
||||||
gfs2/mkfs/main_jadd.c | 48 +++++++++++++++++++++++++++++++++++--------
|
|
||||||
1 file changed, 40 insertions(+), 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
|
|
||||||
index 7583ba0f..0a18bfb2 100644
|
|
||||||
--- a/gfs2/mkfs/main_jadd.c
|
|
||||||
+++ b/gfs2/mkfs/main_jadd.c
|
|
||||||
@@ -480,6 +480,43 @@ static uint64_t find_block_address(int fd, off_t offset, unsigned bsize)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+static int alloc_new_journal(int fd, unsigned bytes)
|
|
||||||
+{
|
|
||||||
+#define ALLOC_BUF_SIZE (4 << 20)
|
|
||||||
+ unsigned left = bytes;
|
|
||||||
+ int error;
|
|
||||||
+ char *buf;
|
|
||||||
+
|
|
||||||
+ error = fallocate(fd, 0, 0, bytes);
|
|
||||||
+ if (error == 0)
|
|
||||||
+ return 0;
|
|
||||||
+ if (errno != EOPNOTSUPP)
|
|
||||||
+ goto out_errno;
|
|
||||||
+
|
|
||||||
+ /* No fallocate support, fall back to writes */
|
|
||||||
+ buf = calloc(1, ALLOC_BUF_SIZE);
|
|
||||||
+ if (buf == NULL)
|
|
||||||
+ goto out_errno;
|
|
||||||
+
|
|
||||||
+ while (left > 0) {
|
|
||||||
+ unsigned sz = ALLOC_BUF_SIZE;
|
|
||||||
+
|
|
||||||
+ if (left < ALLOC_BUF_SIZE)
|
|
||||||
+ sz = left;
|
|
||||||
+
|
|
||||||
+ if (pwrite(fd, buf, sz, bytes - left) != sz) {
|
|
||||||
+ free(buf);
|
|
||||||
+ goto out_errno;
|
|
||||||
+ }
|
|
||||||
+ left -= sz;
|
|
||||||
+ }
|
|
||||||
+ free(buf);
|
|
||||||
+ return 0;
|
|
||||||
+out_errno:
|
|
||||||
+ perror("Failed to allocate space for new journal");
|
|
||||||
+ return -1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
|
|
||||||
{
|
|
||||||
int fd, error = 0;
|
|
||||||
@@ -496,14 +533,9 @@ static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
|
|
||||||
if ((error = set_flags(fd, JA_FL_CLEAR, FS_JOURNAL_DATA_FL)))
|
|
||||||
goto close_fd;
|
|
||||||
|
|
||||||
- memset(buf, 0, sdp->bsize);
|
|
||||||
- for (x=0; x<blocks; x++) {
|
|
||||||
- if (write(fd, buf, sdp->bsize) != sdp->bsize) {
|
|
||||||
- perror("add_j write");
|
|
||||||
- error = -1;
|
|
||||||
- goto close_fd;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
+ error = alloc_new_journal(fd, sdp->jsize << 20);
|
|
||||||
+ if (error != 0)
|
|
||||||
+ goto close_fd;
|
|
||||||
|
|
||||||
if ((error = lseek(fd, 0, SEEK_SET)) < 0) {
|
|
||||||
perror("add_j lseek");
|
|
||||||
--
|
|
||||||
2.27.0
|
|
||||||
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
From 657bbcfb7114b0246c6ce72cde75fcacb9a0d61b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrew Price <anprice@redhat.com>
|
|
||||||
Date: Thu, 18 Mar 2021 17:50:16 +0000
|
|
||||||
Subject: [PATCH] gfs2_jadd: Don't fsync after each block written
|
|
||||||
|
|
||||||
gfs2_jadd has always called fsync() after writing each block of the
|
|
||||||
journal. There doesn't seem to be any need for that so take the fsync()
|
|
||||||
call out of the loop.
|
|
||||||
|
|
||||||
Add an additional fsync() after preallocation to make sure we're in good
|
|
||||||
shape before writing the log headers.
|
|
||||||
|
|
||||||
In my tests this reduces the time to add one journal from 5 minutes to
|
|
||||||
9 seconds.
|
|
||||||
|
|
||||||
Signed-off-by: Andrew Price <anprice@redhat.com>
|
|
||||||
---
|
|
||||||
gfs2/mkfs/main_jadd.c | 15 ++++++++++-----
|
|
||||||
1 file changed, 10 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
|
|
||||||
index 0a18bfb2..2bd0f7b0 100644
|
|
||||||
--- a/gfs2/mkfs/main_jadd.c
|
|
||||||
+++ b/gfs2/mkfs/main_jadd.c
|
|
||||||
@@ -537,6 +537,11 @@ static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
|
|
||||||
if (error != 0)
|
|
||||||
goto close_fd;
|
|
||||||
|
|
||||||
+ error = fsync(fd);
|
|
||||||
+ if (error != 0) {
|
|
||||||
+ perror("Failed to sync journal metadata");
|
|
||||||
+ goto close_fd;
|
|
||||||
+ }
|
|
||||||
if ((error = lseek(fd, 0, SEEK_SET)) < 0) {
|
|
||||||
perror("add_j lseek");
|
|
||||||
goto close_fd;
|
|
||||||
@@ -580,12 +585,12 @@ static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
|
|
||||||
seq = 0;
|
|
||||||
off += sdp->bsize;
|
|
||||||
|
|
||||||
- if ((error = fsync(fd))) {
|
|
||||||
- perror("add_j fsync");
|
|
||||||
- goto close_fd;
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+ error = fsync(fd);
|
|
||||||
+ if (error != 0) {
|
|
||||||
+ perror("Failed to sync journal metadata");
|
|
||||||
+ goto close_fd;
|
|
||||||
+ }
|
|
||||||
sprintf(new_name, "journal%u", opts->journals);
|
|
||||||
error = rename2system(opts, opts->jindex, new_name);
|
|
||||||
if (error < 0 && errno != EEXIST){
|
|
||||||
--
|
|
||||||
2.39.0.windows.2
|
|
||||||
|
|
||||||
Binary file not shown.
BIN
gfs2-utils-3.5.1.tar.gz
Normal file
BIN
gfs2-utils-3.5.1.tar.gz
Normal file
Binary file not shown.
@ -1,16 +1,11 @@
|
|||||||
Name: gfs2-utils
|
Name: gfs2-utils
|
||||||
Version: 3.4.1
|
Version: 3.5.1
|
||||||
Release: 4
|
Release: 1
|
||||||
Summary: Utilities for managing the global file system (GFS2)
|
Summary: Utilities for managing the global file system (GFS2)
|
||||||
|
|
||||||
License: GPLv2+ and LGPLv2+
|
License: GPLv2+ and LGPLv2+
|
||||||
URL: https://pagure.io/gfs2-utils
|
URL: https://pagure.io/gfs2-utils
|
||||||
Source0: https://releases.pagure.org/gfs2-utils/gfs2-utils-%{version}.tar.gz
|
Source0: https://releases.pagure.org/gfs2-utils/gfs2-utils-%{version}.tar.gz
|
||||||
# https://github.com/andyprice/gfs2-utils/commit/17fb470
|
|
||||||
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
|
|
||||||
|
|
||||||
BuildRequires: ncurses-devel kernel-headers automake libtool zlib-devel gettext-devel
|
BuildRequires: ncurses-devel kernel-headers automake libtool zlib-devel gettext-devel
|
||||||
BuildRequires: bison flex libblkid-devel libuuid-devel check-devel bzip2-devel make
|
BuildRequires: bison flex libblkid-devel libuuid-devel check-devel bzip2-devel make
|
||||||
@ -33,14 +28,18 @@ modifying, and correcting inconsistencies in GFS2 file systems.
|
|||||||
make check || { cat tests/testsuite.log; exit 1; }
|
make check || { cat tests/testsuite.log; exit 1; }
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make -C gfs2 install DESTDIR=%{buildroot}
|
%make_install
|
||||||
rm -f %{buildroot}/usr/sbin/gfs2_trace
|
rm -f %{buildroot}/usr/sbin/gfs2_trace
|
||||||
rm -f %{buildroot}/usr/sbin/gfs2_lockcapture
|
rm -f %{buildroot}/usr/sbin/gfs2_lockcapture
|
||||||
rm -f %{buildroot}%{_mandir}/man8/gfs2_trace.8
|
rm -f %{buildroot}%{_mandir}/man8/gfs2_trace.8
|
||||||
rm -f %{buildroot}%{_mandir}/man8/gfs2_lockcapture.8
|
rm -f %{buildroot}%{_mandir}/man8/gfs2_lockcapture.8
|
||||||
|
rm -f %{buildroot}%{_defaultdocdir}/gfs2-utils/COPYING.*
|
||||||
|
rm -f %{buildroot}%{_defaultdocdir}/gfs2-utils/COPYRIGHT
|
||||||
|
rm -f %{buildroot}%{_defaultdocdir}/gfs2-utils/README.licence
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license doc/COPYING.* doc/COPYRIGHT doc/README.licence
|
%license doc/COPYING.* doc/COPYRIGHT doc/README.licence
|
||||||
|
%doc doc/*.txt doc/README.contributing
|
||||||
%{_sbindir}/gfs2*
|
%{_sbindir}/gfs2*
|
||||||
%{_sbindir}/*.gfs2
|
%{_sbindir}/*.gfs2
|
||||||
%{_sbindir}/tunegfs2
|
%{_sbindir}/tunegfs2
|
||||||
@ -56,6 +55,9 @@ rm -f %{buildroot}%{_mandir}/man8/gfs2_lockcapture.8
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Oct 10 2023 Ge Wang <wang__ge@126.com> - 3.5.1-1
|
||||||
|
- Update to version 3.5.1
|
||||||
|
|
||||||
* Mon Jan 9 2023 yaoguangzhong <yaoguangzhong@xfusion.com> - 3.4.1-4
|
* Mon Jan 9 2023 yaoguangzhong <yaoguangzhong@xfusion.com> - 3.4.1-4
|
||||||
- backport gfs2_jadd: don't fsync after each block written
|
- backport gfs2_jadd: don't fsync after each block written
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user