From f4a48ca25da1c1504f8b667f65b82a2f45966020 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Wed, 21 May 2014 12:49:03 -0500 Subject: [PATCH] Fix large file handling on 32-bit machines --- e2fsprogs-1.42.10-largefile.patch | 42 +++++++++++++++++++++++++++++++ e2fsprogs.spec | 7 +++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 e2fsprogs-1.42.10-largefile.patch diff --git a/e2fsprogs-1.42.10-largefile.patch b/e2fsprogs-1.42.10-largefile.patch new file mode 100644 index 0000000..5a4c232 --- /dev/null +++ b/e2fsprogs-1.42.10-largefile.patch @@ -0,0 +1,42 @@ +[PATCH] mke2fs: use ext2fs_open_file() in check_plausibility() + +The commit: + +802146c mke2fs: create a regular file if necessary + +caused a regression on 32-bit machines; the open() fails if +the file size is > 4G. + +Using ext2fs_open_file() fixes it. + +Resolves: Red Hat Bugzilla #1099892 + +Signed-off-by: Eric Sandeen +--- + +V2: against master! Sorry, first patch was against the +bisection point. + +TBH I don't know if this should be using ext2fs_open_file(), +or some other magic like O_LARGEFILE, but this works for me, +and we use the stat/fstat wrapper here too, so ... + +diff --git a/misc/util.c b/misc/util.c +index 1c0818f..9475fc6 100644 +--- a/misc/util.c ++++ b/misc/util.c +@@ -194,10 +194,10 @@ int check_plausibility(const char *device, int flags, int *ret_is_dev) + char *fs_type = NULL; + char *fs_label = NULL; + +- fd = open(device, fl, 0666); ++ fd = ext2fs_open_file(device, fl, 0666); + if ((fd < 0) && (errno == ENOENT) && (flags & CREATE_FILE)) { + fl |= O_CREAT; +- fd = open(device, fl, 0666); ++ fd = ext2fs_open_file(device, fl, 0666); + if (fd >= 0 && (flags & VERBOSE_CREATE)) + printf(_("Creating regular file %s\n"), device); + } + + diff --git a/e2fsprogs.spec b/e2fsprogs.spec index 436e711..5bd6d38 100644 --- a/e2fsprogs.spec +++ b/e2fsprogs.spec @@ -1,7 +1,7 @@ Summary: Utilities for managing ext2, ext3, and ext4 filesystems Name: e2fsprogs Version: 1.42.10 -Release: 1%{?dist} +Release: 2%{?dist} # License tags based on COPYING file distinctions for various components License: GPLv2 @@ -11,6 +11,7 @@ Source1: ext2_types-wrapper.h Source2: e2fsck.conf Patch1: e2fsprogs-1.40.4-sb_feature_check_ignore.patch +Patch2: e2fsprogs-1.42.10-largefile.patch Url: http://e2fsprogs.sourceforge.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -150,6 +151,7 @@ It was originally inspired by the Multics SubSystem library. # mildly unsafe but 'til I get something better, avoid full fsck # after an selinux install... %patch1 -p1 -b .featurecheck +%patch2 -p1 %build %configure --enable-elf-shlibs --enable-nls --disable-uuidd --disable-fsck \ @@ -325,6 +327,9 @@ exit 0 %{_libdir}/pkgconfig/ss.pc %changelog +* Wed May 21 2014 Eric Sandeen 1.42.10-2 +- Fix large file handling on 32-bit builds + * Mon May 19 2014 Eric Sandeen 1.42.10-1 - New upstream release - Enable userspace quota