xfsprogs/xfs_io-stat-treat-statfs.f_flags-as-optional.patch

82 lines
2.4 KiB
Diff
Raw Normal View History

Accepting request 542710 from home:jeff_mahoney:branches:filesystems - Fix building on SLE11 - Added xfs_io-stat-fix-typo-in-statfs-f_flags.patch - Added xfs_io-stat-treat-statfs.f_flags-as-optional.patch - Update to 4.13.1 * mkfs: don't overflow the subopts array - Update to 4.13.0 * xfs_repair: handle missing extent states * mkfs: pass a custom cowextsize into the created filesystem * xfs_db: version command misses RMAPBT feature string * xfs_repair: don't use do_warn for normal log message * libxfs: remove getcwd/chdir dance from initialization * xfs_repair: take the ag_lock before recording rmap for a bmbt record * mkfs.xfs: Don't stagger AG for a single disk * xfs: fix inobt inode allocation search optimization * xfs_io: clarify the fsmap documentation * fiemap: Fix semantics of max_extents (-n arguments) * xfs_repair: fix thread creation failure recovery * xfs_repair: add prefetch trace calls to debug thread creation failures * xfs_repair: clear pthread_t when pthread_create fails * xfs_io: add seek consistency checks * fsr: fix uninitialized fs usage after timeout * xfs_db: bit fuzzing should read the right bit when flipping * xfs_db: make write/fuzz -c and -d work on non-crc filesystems * xfs_db: free field list when failing out of fuzz * xfs_db: reset metadump output flag * xfs_db: btdump should avoid eval for push and pop of cursor * xfs_db: use TYP_F_CRC_FUNC for inodes & dquots * xfs_db: introduce fuzz command * xfs_db: write values into dir/attr blocks and recalculate CRCs OBS-URL: https://build.opensuse.org/request/show/542710 OBS-URL: https://build.opensuse.org/package/show/filesystems/xfsprogs?expand=0&rev=54
2017-11-17 21:03:23 +01:00
From 1c2113fd2f67bad534d75900ca5db0a7826cb8d7 Mon Sep 17 00:00:00 2001
From: Jeff Mahoney <jeffm@suse.com>
Date: Fri, 17 Nov 2017 14:39:52 -0500
Subject: [PATCH] xfs_io: stat: treat statfs.f_flags as optional
Kernels prior to 2.6.36 didn't contain statfs.f_flags. Distros with
initial releases with kernels prior to this may not have updated
headers with this member. Only attempt to print it if we have the
header with the member defined.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
configure.ac | 1 +
include/builddefs.in | 1 +
io/stat.c | 2 ++
m4/package_libcdev.m4 | 14 ++++++++++++++
4 files changed, 18 insertions(+)
diff --git a/configure.ac b/configure.ac
index 4161c3b4..939d802b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -143,6 +143,7 @@ AC_HAVE_FSETXATTR
AC_HAVE_MREMAP
AC_NEED_INTERNAL_FSXATTR
AC_HAVE_GETFSMAP
+AC_HAVE_STATFS_FLAGS
if test "$enable_blkid" = yes; then
AC_HAVE_BLKID_TOPO
diff --git a/include/builddefs.in b/include/builddefs.in
index ec630bd9..13756d79 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -113,6 +113,7 @@ HAVE_FSETXATTR = @have_fsetxattr@
HAVE_MREMAP = @have_mremap@
NEED_INTERNAL_FSXATTR = @need_internal_fsxattr@
HAVE_GETFSMAP = @have_getfsmap@
+HAVE_STATFS_FLAGS = @have_statfs_flags@
GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
# -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
diff --git a/io/stat.c b/io/stat.c
index 6ab10abf..1ca5b0d6 100644
--- a/io/stat.c
+++ b/io/stat.c
@@ -199,7 +199,9 @@ statfs_f(
printf(_("statfs.f_bavail = %lld\n"), (long long) st.f_bavail);
printf(_("statfs.f_files = %lld\n"), (long long) st.f_files);
printf(_("statfs.f_ffree = %lld\n"), (long long) st.f_ffree);
+#ifdef HAVE_STATFS_FLAGS
printf(_("statfs.f_flags = 0x%llx\n"), (long long) st.f_flags);
+#endif
}
if (file->flags & IO_FOREIGN)
return 0;
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
index fa5b6397..bc395acd 100644
--- a/m4/package_libcdev.m4
+++ b/m4/package_libcdev.m4
@@ -297,3 +297,17 @@ AC_DEFUN([AC_HAVE_GETFSMAP],
AC_MSG_RESULT(no))
AC_SUBST(have_getfsmap)
])
+
+AC_DEFUN([AC_HAVE_STATFS_FLAGS],
+ [
+ AC_CHECK_TYPE(struct statfs,
+ [
+ AC_CHECK_MEMBER(struct statfs.f_flags,
+ have_statfs_flags=yes,,
+ [#include <sys/vfs.h>]
+ )
+ ],,
+ [#include <sys/vfs.h>]
+ )
+ AC_SUBST(have_statfs_flags)
+ ])
--
2.14.2