diff --git a/configure.ac b/configure.ac
index dd4adedf..1b0e92f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -251,6 +251,11 @@ 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])])
+
 dnl Define <NAME>_LIBS= and <NAME>_CFLAGS= by pkg-config
 dnl
 dnl The default PKG_CHECK_MODULES() action-if-not-found is end the
diff --git a/convert/source-ext2.c b/convert/source-ext2.c
index f5c8029c..d00ca602 100644
--- a/convert/source-ext2.c
+++ b/convert/source-ext2.c
@@ -692,6 +692,8 @@ 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
+
 /*
  * Copied and modified from fs/ext4/ext4.h
  */
@@ -761,6 +763,25 @@ out:
 	return ret;
 }
 
+#else /* HAVE_OWN_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,
+				ext2_filsys ext2_fs)
+{
+	static int warn = 0;
+
+	if (!warn) {
+		warning(
+"extended inode (size %u) found but e2fsprogs don't support reading extra timespec",
+			s_inode_size);
+		warn = 1;
+	}
+	return 0;
+}
+
+#endif /* !HAVE_OWN_EXT4_EPOCH_MASK_DEFINE */
+
 static int ext2_check_state(struct btrfs_convert_context *cctx)
 {
 	ext2_filsys fs = cctx->fs_data;