From 683f87ea85b1ce78b04a4cee5e2b581e44be181c Mon Sep 17 00:00:00 2001 From: Anthony Iliopoulos Date: Tue, 18 Feb 2025 15:34:59 +0100 Subject: [PATCH] mkfs: fix filesize function compilation error on 32-bit archs Signed-off-by: Anthony Iliopoulos --- ...e-function-compilation-error-on-32-b.patch | 35 +++++++++++++++++++ xfsprogs.changes | 6 ++++ xfsprogs.spec | 1 + 3 files changed, 42 insertions(+) create mode 100644 mkfs-fix-filesize-function-compilation-error-on-32-b.patch diff --git a/mkfs-fix-filesize-function-compilation-error-on-32-b.patch b/mkfs-fix-filesize-function-compilation-error-on-32-b.patch new file mode 100644 index 0000000..21211cd --- /dev/null +++ b/mkfs-fix-filesize-function-compilation-error-on-32-b.patch @@ -0,0 +1,35 @@ +From c849e53e4389da08901cef99a9d9dcd0cb4b0ef1 Mon Sep 17 00:00:00 2001 +From: Anthony Iliopoulos +Date: Tue, 18 Feb 2025 15:06:29 +0100 +Subject: mkfs: fix filesize function compilation error on 32-bit archs + +Commit 73fb78e5ee89 changed the return type of filesize() from long to +off_t, without changing the corresponding earlier declaration of the +function. + +On 32-bit archs this breaks compilation as the off_t type is 8 bytes +(since the unit is compiled with -D_FILE_OFFSET_BITS=64) and that is +causing a conflicting type mismatch with the long type declaration. + +Fixes: 73fb78e5ee89 ("mkfs: support copying in large or sparse files") +Signed-off-by: Anthony Iliopoulos +--- + mkfs/proto.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mkfs/proto.c b/mkfs/proto.c +index 6dd3a2005b15..981f5b11567f 100644 +--- a/mkfs/proto.c ++++ b/mkfs/proto.c +@@ -20,7 +20,7 @@ static struct xfs_trans * getres(struct xfs_mount *mp, uint blocks); + static void rsvfile(xfs_mount_t *mp, xfs_inode_t *ip, long long len); + static int newregfile(char **pp, char **fname); + static void rtinit(xfs_mount_t *mp); +-static long filesize(int fd); ++static off_t filesize(int fd); + static int slashes_are_spaces; + + /* +-- +2.47.0 + diff --git a/xfsprogs.changes b/xfsprogs.changes index 370df21..fee174d 100644 --- a/xfsprogs.changes +++ b/xfsprogs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Feb 18 14:56:17 UTC 2025 - Anthony Iliopoulos + +- mkfs: fix filesize function compilation error on 32-bit archs + - add mkfs-fix-filesize-function-compilation-error-on-32-b.patch + ------------------------------------------------------------------- Mon Feb 17 13:15:41 UTC 2025 - Anthony Iliopoulos diff --git a/xfsprogs.spec b/xfsprogs.spec index a4c114e..0e72406 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -37,6 +37,7 @@ Source2: %{name}.keyring Source3: module-setup.sh.in Source4: dracut-fsck-help.txt Patch0: xfsprogs-docdir.diff +Patch1: mkfs-fix-filesize-function-compilation-error-on-32-b.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++