nfs: backport two bugfix patches

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
This commit is contained in:
Zhiqiang Liu 2023-08-29 20:53:00 +08:00
parent 8849dea9a5
commit 76da2c4955
3 changed files with 105 additions and 1 deletions

View File

@ -0,0 +1,64 @@
From 47e6d7667cd7cd82c9033a3176afbdd2341065b0 Mon Sep 17 00:00:00 2001
From: Steve Dickson <steved@redhat.com>
Date: Wed, 22 Sep 2021 11:29:34 -0400
Subject: [PATCH] Move version.h into a common include directory
Signed-off-by: Steve Dickson <steved@redhat.com>
---
support/include/version.h | 1 +
utils/gssd/svcgssd_krb5.c | 2 +-
utils/nfsd/nfssvc.c | 2 +-
utils/nfsdcld/nfsdcld.c | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
create mode 120000 support/include/version.h
diff --git a/support/include/version.h b/support/include/version.h
new file mode 120000
index 00000000..b7db0bbb
--- /dev/null
+++ b/support/include/version.h
@@ -0,0 +1 @@
+../../utils/mount/version.h
\ No newline at end of file
diff --git a/utils/gssd/svcgssd_krb5.c b/utils/gssd/svcgssd_krb5.c
index 305d4751..2503c384 100644
--- a/utils/gssd/svcgssd_krb5.c
+++ b/utils/gssd/svcgssd_krb5.c
@@ -46,7 +46,7 @@
#include "gss_oids.h"
#include "err_util.h"
#include "svcgssd_krb5.h"
-#include "../mount/version.h"
+#include "version.h"
#define MYBUFLEN 1024
diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
index 720bdd97..46452d97 100644
--- a/utils/nfsd/nfssvc.c
+++ b/utils/nfsd/nfssvc.c
@@ -25,7 +25,7 @@
#include "nfslib.h"
#include "xlog.h"
#include "nfssvc.h"
-#include "../mount/version.h"
+#include "version.h"
#ifndef NFSD_FS_DIR
#define NFSD_FS_DIR "/proc/fs/nfsd"
diff --git a/utils/nfsdcld/nfsdcld.c b/utils/nfsdcld/nfsdcld.c
index 636c3983..dbc7a57f 100644
--- a/utils/nfsdcld/nfsdcld.c
+++ b/utils/nfsdcld/nfsdcld.c
@@ -45,7 +45,7 @@
#include "cld.h"
#include "cld-internal.h"
#include "sqlite.h"
-#include "../mount/version.h"
+#include "version.h"
#include "conffile.h"
#include "legacy.h"
--
2.25.1

View File

@ -0,0 +1,35 @@
From feb3dfc7127cf1337530ccb06ed90e818b026a07 Mon Sep 17 00:00:00 2001
From: Steve Dickson <steved@redhat.com>
Date: Wed, 22 Sep 2021 11:31:56 -0400
Subject: [PATCH] mountd: only do NFSv4 logging on supported kernels.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1979816
Signed-off-by: Steve Dickson <steved@redhat.com>
---
support/export/v4clients.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/support/export/v4clients.c b/support/export/v4clients.c
index dd985463..5e4f1058 100644
--- a/support/export/v4clients.c
+++ b/support/export/v4clients.c
@@ -10,6 +10,7 @@
#include <sys/inotify.h>
#include <errno.h>
#include "export.h"
+#include "version.h"
/* search.h declares 'struct entry' and nfs_prot.h
* does too. Easiest fix is to trick search.h into
@@ -23,6 +24,8 @@ static int clients_fd = -1;
void v4clients_init(void)
{
+ if (linux_version_code() < MAKE_VERSION(5, 3, 0))
+ return;
if (clients_fd >= 0)
return;
clients_fd = inotify_init1(IN_NONBLOCK);
--
2.25.1

View File

@ -4,7 +4,7 @@
Name: nfs-utils
Version: 2.5.4
Release: 12
Release: 13
Epoch: 2
Summary: The Linux NFS userland utility package
License: MIT and GPLv2 and GPLv2+ and BSD
@ -26,6 +26,8 @@ Patch10: 0010-nfs-utils-Don-t-allow-junction-tests-to-trigger-auto.patch
Patch11: 0011-Covscan-Scan-Wrong-Check-of-Return-Value.patch
Patch12: 0012-rpcdebug-avoid-buffer-underflow-if-read-returns-0.patch
Patch13: 0013-export-Fix-rootdir-corner-case-in-next_mnt.patch
Patch14: 0014-Move-version.h-into-a-common-include-directory.patch
Patch15: 0015-mountd-only-do-NFSv4-logging-on-supported-kernels.patch
BuildRequires: libevent-devel,libcap-devel, libtirpc-devel libblkid-devel
BuildRequires: krb5-libs >= 1.4 autoconf >= 2.57 openldap-devel >= 2.2
@ -294,6 +296,9 @@ fi
%{_mandir}/*/*
%changelog
* Tue Aug 29 2023 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 2:2.5.4-13
- backport two bugfix patches
* Sun Jun 25 2023 wuguanghao <wuguanghao3@huawei.com> - 2:2.5.4-12
- backport patches from community