Skip to contentSkip to conversation

btrfs-tools: handle rename of inode_includes() from e2fsprogs 1.47.1

PATCH New [email protected] 1 participant 2 messages Jun 24, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs-tools: handle rename of inode_includes() from e2fsprogs 1.47.1

From: Wang Mingyu <[email protected]>

To fix the do_compile error, use the new prefixed macro and add backward compatibility that would still use inode_includes().

---
 ...ename-of-inode_includes-from-e2fspro.patch | 64 +++++++++++++++++++
 .../btrfs-tools/btrfs-tools_6.8.1.bb          |  1 +
 2 files changed, 65 insertions(+)
 create mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-convert-handle-rename-of-inode_includes-from-e2fspro.patch
meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-convert-handle-rename-of-inode_includes-from-e2fspro.patch new file +64 -0
new file mode 100644
index 0000000000..6fefbb2bca
@@ -0,0 +1,64 @@
+From f9ba9752ba5fd72441bc2018b2453967e75460d4 Mon Sep 17 00:00:00 2001
+From: Wang Mingyu <[email protected]>
+Date: Mon, 24 Jun 2024 02:00:11 +0000
+Subject: [PATCH] convert: handle rename of inode_includes() from e2fsprogs
+ 1.47.1
+
+Upstream-Status: Backport
+[https://kernel.googlesource.com/pub/scm/linux/kernel/git/kdave/btrfs-progs/+/bcb887a4de2c56426a7a7de8d440b6ad75579f10%5E%21/#F0]
+
+Signed-off-by: Wang Mingyu <[email protected]>
+---
+ configure.ac          |  3 ++-
+ convert/source-ext2.c | 11 +++++++++--
+ 2 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 007d29b..816dd36 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -312,7 +312,8 @@ AS_IF([test "x$have_ext4_epoch_mask_define" = xno], [
+             AC_DEFINE([EXT4_EPOCH_BITS], [2],[for encode and decode tv_nsec in ext2 inode])
+             AC_DEFINE([EXT4_EPOCH_MASK], [((1U << EXT4_EPOCH_BITS) - 1)], [For encode and decode tv_nsec info in ext2 inode])
+             AC_DEFINE([EXT4_NSEC_MASK],  [(~0UL << EXT4_EPOCH_BITS)], [For encode and decode tv_nsec info in ext2 inode])
+-            AC_DEFINE([inode_includes(size, field)],[m4_normalize[(size >= (sizeof(((struct ext2_inode_large *)0)->field) + offsetof(struct ext2_inode_large, field)))]],
++            # Use name from 1.47.1, backward compatibility is handled in convert/source-ext2.c
++            AC_DEFINE([ext2fs_inode_includes(size, field)],[m4_normalize[(size >= (sizeof(((struct ext2_inode_large *)0)->field) + offsetof(struct ext2_inode_large, field)))]],
+                 [For encode and decode tv_nsec info in ext2 inode])
+         ],
+         [AC_MSG_WARN([It seems that ext2_inode_large don't includes tv_nsec related info, probably old e2fsprogs, no 64bit time precision of converted images])],
+diff --git a/convert/source-ext2.c b/convert/source-ext2.c
+index 2186b25..bba81e4 100644
+--- a/convert/source-ext2.c
++++ b/convert/source-ext2.c
+@@ -727,10 +727,17 @@ static inline void ext4_decode_extra_time(__le32 * tv_sec, __le32 * tv_nsec,
+         *tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS;
+ }
+ 
++/*
++ * In e2fsprogs < 1.47.1 it's inode_includes, from >= on it's with ext2fs_ prefix.
++ */
++#ifndef ext2fs_inode_includes
++#define ext2fs_inode_includes(size, field)	inode_includes(size, field)
++#endif
++
+ #define EXT4_COPY_XTIME(xtime, dst, tv_sec, tv_nsec)					\
+ do {											\
+ 	tv_sec = src->i_ ## xtime ;							\
+-	if (inode_includes(inode_size, i_ ## xtime ## _extra)) {			\
++	if (ext2fs_inode_includes(inode_size, i_ ## xtime ## _extra)) {			\
+ 		tv_sec = src->i_ ## xtime ;						\
+ 		ext4_decode_extra_time(&tv_sec, &tv_nsec, src->i_ ## xtime ## _extra);	\
+ 		btrfs_set_stack_timespec_sec(&dst->xtime , tv_sec);			\
+@@ -771,7 +778,7 @@ static int ext4_copy_inode_timespec_extra(struct btrfs_inode_item *dst,
+ 	EXT4_COPY_XTIME(ctime, dst, tv_sec, tv_nsec);
+ 
+ 	tv_sec = src->i_crtime;
+-	if (inode_includes(inode_size, i_crtime_extra)) {
++	if (ext2fs_inode_includes(inode_size, i_crtime_extra)) {
+ 		tv_sec = src->i_crtime;
+ 		ext4_decode_extra_time(&tv_sec, &tv_nsec, src->i_crtime_extra);
+ 		btrfs_set_stack_timespec_sec(&dst->otime, tv_sec);
+-- 
+2.34.1
+
meta/recipes-devtools/btrfs-tools/btrfs-tools_6.8.1.bb +1 -0
index fac9f8f7ef..d61d956a70 100644
@@ -17,6 +17,7 @@ DEPENDS = "util-linux zlib"
 
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git;branch=master;protocol=https \
            file://0001-Add-a-possibility-to-specify-where-python-modules-ar.patch \
+           file://0001-convert-handle-rename-of-inode_includes-from-e2fspro.patch \
            "
 SRCREV = "5d97c32d6f94cf6f473a5f82964e3edaeb1b146e"
 S = "${WORKDIR}/git"
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/1 rt-tests: upgrade 2.6 -> 2.7

From: Wang Mingyu <[email protected]>

0001-Makefile-Allow-for-CC-and-AR-to-be-overridden.patch refreshed for 2.7

---
 .../0001-Makefile-Allow-for-CC-and-AR-to-be-overridden.patch  | 4 ++--
 meta/recipes-rt/rt-tests/rt-tests.inc                         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
meta/recipes-rt/rt-tests/files/0001-Makefile-Allow-for-CC-and-AR-to-be-overridden.patch +2 -2
index a1fc9e26a0..d5bd7fe523 100644
@@ -18,8 +18,8 @@ diff --git a/Makefile b/Makefile
 index 223a839..a735584 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -1,6 +1,6 @@
- VERSION = 2.6
+@@ -2,6 +2,6 @@
+ VERSION = 2.7
 -CC = $(CROSS_COMPILE)gcc
 -AR = $(CROSS_COMPILE)ar
 +CC ?= $(CROSS_COMPILE)gcc
meta/recipes-rt/rt-tests/rt-tests.inc +2 -2
index 70315c4694..3fbdfa2038 100644
@@ -1,5 +1,5 @@
-SRCREV = "217cd8518c5f7777d490892aa9c765a6b2782cb5"
-PV = "2.6"
+SRCREV = "5bd94923ffda2ab326d081926dbfc6775fb5050b"
+PV = "2.7"
 PE = "1"
 
 SRC_URI = "git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git;branch=main;protocol=https"
Signature · 1 line
2.34.1