From: Pierre Labastie <pierre.labastie@neuf.fr>
To: linux-btrfs@vger.kernel.org
Subject: Subject: [PATCH] btrfs-progs: Fix the test for EXT4_EPOCH_MASK
Date: Thu, 11 Mar 2021 22:55:33 +0100 [thread overview]
Message-ID: <d7b1445f25866bf5c8d5016b7cd7a94e68f67dd8.camel@neuf.fr> (raw)
Commit b3df561fbf has introduced the ability to convert extended
inode time precision on ext4, but this breaks builds on older distros,
where ext4 does not have the nsec time precision.
Commit c615287cc tried to fix that by testing the availability of
the EXT4_EPOCH_MASK macro, but the test is not complete.
This patch aims at fixing the macro test, and changes the
name of the associated HAVE_ macro, since the logic is reverted.
This fixes #353 when ext4 has nsec time precision. Note that
the test fails when ext4 does not have the nsec time precision.
Maybe the test shouldn't be run in that case?
Issue: #353
Signed-off-by: Pierre Labastie <pierre.labastie@neuf.fr>
---
configure.ac | 8 ++++----
convert/source-ext2.c | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 612a3f87..dd6a5de7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -251,10 +251,10 @@ else
AC_DEFINE([HAVE_OWN_FIEMAP_EXTENT_SHARED_DEFINE], [0], [We did not define
FIEMAP_EXTENT_SHARED])
fi
-HAVE_OWN_EXT4_EPOCH_MASK_DEFINE=0
-AX_CHECK_DEFINE([ext2fs/ext2_fs.h], [EXT4_EPOCH_MASK], [],
- [HAVE_OWN_EXT4_EPOCH_MASK_DEFINE=1
- AC_MSG_WARN([no definition of EXT4_EPOCH_MASK found, probably
old e2fsprogs, will use own definition, no 64bit time precision of converted
images])])
+AX_CHECK_DEFINE([ext2fs/ext2_fs.h], [EXT4_EPOCH_MASK],
+ [AC_DEFINE([HAVE_EXT4_EPOCH_MASK_DEFINE], [1],
+ [Define to 1 if e2fsprogs defines EXT4_EPOCH_MASK])],
+ [AC_MSG_WARN([no definition of EXT4_EPOCH_MASK found, probably
old e2fsprogs, will use own definition, no 64bit time precision of converted
images])])
dnl Define <NAME>_LIBS= and <NAME>_CFLAGS= by pkg-config
dnl
diff --git a/convert/source-ext2.c b/convert/source-ext2.c
index bd872086..fb655ec0 100644
--- a/convert/source-ext2.c
+++ b/convert/source-ext2.c
@@ -698,7 +698,7 @@ static void ext2_copy_inode_item(struct btrfs_inode_item
*dst,
memset(&dst->reserved, 0, sizeof(dst->reserved));
}
-#if HAVE_OWN_EXT4_EPOCH_MASK_DEFINE
+#if HAVE_EXT4_EPOCH_MASK_DEFINE
/*
* Copied and modified from fs/ext4/ext4.h
@@ -769,7 +769,7 @@ out:
return ret;
}
-#else /* HAVE_OWN_EXT4_EPOCH_MASK_DEFINE */
+#else /* HAVE_EXT4_EPOCH_MASK_DEFINE */
static int ext4_copy_inode_timespec_extra(struct btrfs_inode_item *dst,
ext2_ino_t ext2_ino, u32 s_inode_size,
@@ -786,7 +786,7 @@ static int ext4_copy_inode_timespec_extra(struct
btrfs_inode_item *dst,
return 0;
}
-#endif /* !HAVE_OWN_EXT4_EPOCH_MASK_DEFINE */
+#endif /* !HAVE_EXT4_EPOCH_MASK_DEFINE */
static int ext2_check_state(struct btrfs_convert_context *cctx)
{
--
2.30.1
next reply other threads:[~2021-03-11 22:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 21:55 Pierre Labastie [this message]
2021-03-14 18:49 ` [PATCH v2] btrfs-progs: build system: Fix the test for EXT4_EPOCH_MASK Pierre Labastie
2021-03-15 14:53 ` David Sterba
2021-03-15 22:19 ` Pierre Labastie
2021-03-15 23:18 ` David Sterba
2021-03-15 15:24 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d7b1445f25866bf5c8d5016b7cd7a94e68f67dd8.camel@neuf.fr \
--to=pierre.labastie@neuf.fr \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox