Linux NFS development
 help / color / mirror / Atom feed
* [PATCH v2 1/3] fh_key_file: fix missing string.h inclusion
@ 2026-04-08 17:35 Giulio Benetti
  2026-04-08 17:35 ` [PATCH v2 2/3] Introduce compat.h file to deal with old Linux api and fix build failure due to missing NETLINK_EXT_ACK Giulio Benetti
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Giulio Benetti @ 2026-04-08 17:35 UTC (permalink / raw)
  To: linux-nfs; +Cc: Giulio Benetti

Add #include <string.h> to fix build failure.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
V1->V2:
* no changes
---
 support/nfs/fh_key_file.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/support/nfs/fh_key_file.c b/support/nfs/fh_key_file.c
index 5f5eafc1..81ea1500 100644
--- a/support/nfs/fh_key_file.c
+++ b/support/nfs/fh_key_file.c
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <errno.h>
+#include <string.h>
 #include <uuid/uuid.h>
 
 #include "nfslib.h"
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/3] Introduce compat.h file to deal with old Linux api and fix build failure due to missing NETLINK_EXT_ACK
  2026-04-08 17:35 [PATCH v2 1/3] fh_key_file: fix missing string.h inclusion Giulio Benetti
@ 2026-04-08 17:35 ` Giulio Benetti
  2026-05-15 12:52   ` Steve Dickson
  2026-04-08 17:35 ` [PATCH v2 3/3] support/backend_sqlite.c: fix getrandom() fallback Giulio Benetti
  2026-05-15 12:52 ` [PATCH v2 1/3] fh_key_file: fix missing string.h inclusion Steve Dickson
  2 siblings, 1 reply; 6+ messages in thread
From: Giulio Benetti @ 2026-04-08 17:35 UTC (permalink / raw)
  To: linux-nfs; +Cc: Giulio Benetti

In "compat.h" check if NETLINK_EXT_ACK exists, otherwise define it to fix
build failure and where at the moment <linux/netlink.h> is included
let's include "compat.h"

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
V1->V2:
* include "compat.h" in place of <linux/netlink.h>
---
 support/export/cache.c       |  2 +-
 support/export/cache_flush.c |  2 ++
 support/include/compat.h     | 10 ++++++++++
 utils/nfsdctl/nfsdctl.c      |  1 +
 4 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 support/include/compat.h

diff --git a/support/export/cache.c b/support/export/cache.c
index 2f128d7d..65008f51 100644
--- a/support/export/cache.c
+++ b/support/export/cache.c
@@ -40,7 +40,7 @@
 #include <netlink/genl/ctrl.h>
 #include <netlink/msg.h>
 #include <netlink/attr.h>
-#include <linux/netlink.h>
+#include "compat.h"
 
 #ifdef USE_SYSTEM_NFSD_NETLINK_H
 #include <linux/nfsd_netlink.h>
diff --git a/support/export/cache_flush.c b/support/export/cache_flush.c
index ed7b964f..2a24dec7 100644
--- a/support/export/cache_flush.c
+++ b/support/export/cache_flush.c
@@ -38,6 +38,8 @@ extern int no_netlink;
 #include "sunrpc_netlink.h"
 #endif
 
+#include "compat.h"
+
 static int nl_send_flush(struct nl_sock *sock, int family, int cmd)
 {
 	struct nl_msg *msg;
diff --git a/support/include/compat.h b/support/include/compat.h
new file mode 100644
index 00000000..83229b65
--- /dev/null
+++ b/support/include/compat.h
@@ -0,0 +1,10 @@
+#ifndef COMPAT_H
+#define COMPAT_H
+
+#include <linux/netlink.h>
+
+#ifndef NETLINK_EXT_ACK
+#define NETLINK_EXT_ACK 11
+#endif
+
+#endif /* COMPAT_H */
diff --git a/utils/nfsdctl/nfsdctl.c b/utils/nfsdctl/nfsdctl.c
index 016dd2eb..c7126748 100644
--- a/utils/nfsdctl/nfsdctl.c
+++ b/utils/nfsdctl/nfsdctl.c
@@ -26,6 +26,7 @@
 #include <netlink/msg.h>
 #include <netlink/attr.h>
 #include <linux/netlink.h>
+#include "compat.h"
 
 #include <readline/readline.h>
 #include <readline/history.h>
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 3/3] support/backend_sqlite.c: fix getrandom() fallback
  2026-04-08 17:35 [PATCH v2 1/3] fh_key_file: fix missing string.h inclusion Giulio Benetti
  2026-04-08 17:35 ` [PATCH v2 2/3] Introduce compat.h file to deal with old Linux api and fix build failure due to missing NETLINK_EXT_ACK Giulio Benetti
@ 2026-04-08 17:35 ` Giulio Benetti
  2026-05-15 12:52   ` Steve Dickson
  2026-05-15 12:52 ` [PATCH v2 1/3] fh_key_file: fix missing string.h inclusion Steve Dickson
  2 siblings, 1 reply; 6+ messages in thread
From: Giulio Benetti @ 2026-04-08 17:35 UTC (permalink / raw)
  To: linux-nfs; +Cc: Giulio Benetti

In old Linux/Glibc versions __NR_getrandom is defined in <sys/random.h>
so let's add it to fix build failure.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
V1->V2
* added patch
---
 support/reexport/backend_sqlite.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/support/reexport/backend_sqlite.c b/support/reexport/backend_sqlite.c
index 0eb5ea37..a1e981e4 100644
--- a/support/reexport/backend_sqlite.c
+++ b/support/reexport/backend_sqlite.c
@@ -9,6 +9,8 @@
 #include <string.h>
 #include <unistd.h>
 
+#include <sys/syscall.h>
+
 #ifdef HAVE_GETRANDOM
 # include <sys/random.h>
 # if !defined(SYS_getrandom) && defined(__NR_getrandom)
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/3] Introduce compat.h file to deal with old Linux api and fix build failure due to missing NETLINK_EXT_ACK
  2026-04-08 17:35 ` [PATCH v2 2/3] Introduce compat.h file to deal with old Linux api and fix build failure due to missing NETLINK_EXT_ACK Giulio Benetti
@ 2026-05-15 12:52   ` Steve Dickson
  0 siblings, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2026-05-15 12:52 UTC (permalink / raw)
  To: Giulio Benetti, linux-nfs



On 4/8/26 1:35 PM, Giulio Benetti wrote:
> In "compat.h" check if NETLINK_EXT_ACK exists, otherwise define it to fix
> build failure and where at the moment <linux/netlink.h> is included
> let's include "compat.h"
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Committed (tag: nfs-utils-2-9-2-rc3)

steved
> ---
> V1->V2:
> * include "compat.h" in place of <linux/netlink.h>
> ---
>   support/export/cache.c       |  2 +-
>   support/export/cache_flush.c |  2 ++
>   support/include/compat.h     | 10 ++++++++++
>   utils/nfsdctl/nfsdctl.c      |  1 +
>   4 files changed, 14 insertions(+), 1 deletion(-)
>   create mode 100644 support/include/compat.h
> 
> diff --git a/support/export/cache.c b/support/export/cache.c
> index 2f128d7d..65008f51 100644
> --- a/support/export/cache.c
> +++ b/support/export/cache.c
> @@ -40,7 +40,7 @@
>   #include <netlink/genl/ctrl.h>
>   #include <netlink/msg.h>
>   #include <netlink/attr.h>
> -#include <linux/netlink.h>
> +#include "compat.h"
>   
>   #ifdef USE_SYSTEM_NFSD_NETLINK_H
>   #include <linux/nfsd_netlink.h>
> diff --git a/support/export/cache_flush.c b/support/export/cache_flush.c
> index ed7b964f..2a24dec7 100644
> --- a/support/export/cache_flush.c
> +++ b/support/export/cache_flush.c
> @@ -38,6 +38,8 @@ extern int no_netlink;
>   #include "sunrpc_netlink.h"
>   #endif
>   
> +#include "compat.h"
> +
>   static int nl_send_flush(struct nl_sock *sock, int family, int cmd)
>   {
>   	struct nl_msg *msg;
> diff --git a/support/include/compat.h b/support/include/compat.h
> new file mode 100644
> index 00000000..83229b65
> --- /dev/null
> +++ b/support/include/compat.h
> @@ -0,0 +1,10 @@
> +#ifndef COMPAT_H
> +#define COMPAT_H
> +
> +#include <linux/netlink.h>
> +
> +#ifndef NETLINK_EXT_ACK
> +#define NETLINK_EXT_ACK 11
> +#endif
> +
> +#endif /* COMPAT_H */
> diff --git a/utils/nfsdctl/nfsdctl.c b/utils/nfsdctl/nfsdctl.c
> index 016dd2eb..c7126748 100644
> --- a/utils/nfsdctl/nfsdctl.c
> +++ b/utils/nfsdctl/nfsdctl.c
> @@ -26,6 +26,7 @@
>   #include <netlink/msg.h>
>   #include <netlink/attr.h>
>   #include <linux/netlink.h>
> +#include "compat.h"
>   
>   #include <readline/readline.h>
>   #include <readline/history.h>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 3/3] support/backend_sqlite.c: fix getrandom() fallback
  2026-04-08 17:35 ` [PATCH v2 3/3] support/backend_sqlite.c: fix getrandom() fallback Giulio Benetti
@ 2026-05-15 12:52   ` Steve Dickson
  0 siblings, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2026-05-15 12:52 UTC (permalink / raw)
  To: Giulio Benetti, linux-nfs



On 4/8/26 1:35 PM, Giulio Benetti wrote:
> In old Linux/Glibc versions __NR_getrandom is defined in <sys/random.h>
> so let's add it to fix build failure.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Committed (tag: nfs-utils-2-9-2-rc3)

steved
> ---
> V1->V2
> * added patch
> ---
>   support/reexport/backend_sqlite.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/support/reexport/backend_sqlite.c b/support/reexport/backend_sqlite.c
> index 0eb5ea37..a1e981e4 100644
> --- a/support/reexport/backend_sqlite.c
> +++ b/support/reexport/backend_sqlite.c
> @@ -9,6 +9,8 @@
>   #include <string.h>
>   #include <unistd.h>
>   
> +#include <sys/syscall.h>
> +
>   #ifdef HAVE_GETRANDOM
>   # include <sys/random.h>
>   # if !defined(SYS_getrandom) && defined(__NR_getrandom)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/3] fh_key_file: fix missing string.h inclusion
  2026-04-08 17:35 [PATCH v2 1/3] fh_key_file: fix missing string.h inclusion Giulio Benetti
  2026-04-08 17:35 ` [PATCH v2 2/3] Introduce compat.h file to deal with old Linux api and fix build failure due to missing NETLINK_EXT_ACK Giulio Benetti
  2026-04-08 17:35 ` [PATCH v2 3/3] support/backend_sqlite.c: fix getrandom() fallback Giulio Benetti
@ 2026-05-15 12:52 ` Steve Dickson
  2 siblings, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2026-05-15 12:52 UTC (permalink / raw)
  To: Giulio Benetti, linux-nfs



On 4/8/26 1:35 PM, Giulio Benetti wrote:
> Add #include <string.h> to fix build failure.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Committed (tag: nfs-utils-2-9-2-rc3)

steved
> ---
> V1->V2:
> * no changes
> ---
>   support/nfs/fh_key_file.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/support/nfs/fh_key_file.c b/support/nfs/fh_key_file.c
> index 5f5eafc1..81ea1500 100644
> --- a/support/nfs/fh_key_file.c
> +++ b/support/nfs/fh_key_file.c
> @@ -26,6 +26,7 @@
>   #include <sys/types.h>
>   #include <unistd.h>
>   #include <errno.h>
> +#include <string.h>
>   #include <uuid/uuid.h>
>   
>   #include "nfslib.h"


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-15 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 17:35 [PATCH v2 1/3] fh_key_file: fix missing string.h inclusion Giulio Benetti
2026-04-08 17:35 ` [PATCH v2 2/3] Introduce compat.h file to deal with old Linux api and fix build failure due to missing NETLINK_EXT_ACK Giulio Benetti
2026-05-15 12:52   ` Steve Dickson
2026-04-08 17:35 ` [PATCH v2 3/3] support/backend_sqlite.c: fix getrandom() fallback Giulio Benetti
2026-05-15 12:52   ` Steve Dickson
2026-05-15 12:52 ` [PATCH v2 1/3] fh_key_file: fix missing string.h inclusion Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox