From 24bc6eb5cd59ac1034ce4583526f7b57d3e98566 Mon Sep 17 00:00:00 2001 From: OBS User leonardocf Date: Fri, 23 Jun 2017 14:38:54 +0000 Subject: [PATCH] Set link to e2fsprogs.4950 via maintenance_release request Rev SUSE:SLE-12:Update/4 Md5 77de51717b09016f51c9b6c9e37903f0 2017-06-23 14:38:54 leonardocf None --- e2fsprogs.changes | 12 ++++ e2fsprogs.spec | 12 ++-- libext2fs-Fix-fsync-2-detection.patch | 36 ++++++++++ libext2fs-don-t-ignore-fsync-errors.patch | 86 +++++++++++++++++++++++ 4 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 libext2fs-Fix-fsync-2-detection.patch create mode 100644 libext2fs-don-t-ignore-fsync-errors.patch diff --git a/e2fsprogs.changes b/e2fsprogs.changes index 3bc460f..8cdf8cc 100644 --- a/e2fsprogs.changes +++ b/e2fsprogs.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Wed Jun 7 13:06:21 UTC 2017 - jack@suse.cz + +- libext2fs-don-t-ignore-fsync-errors.patch: libext2fs: don't ignore fsync + errors (bsc#1038194) + +------------------------------------------------------------------- +Wed May 31 13:34:50 UTC 2017 - jack@suse.cz + +- libext2fs-Fix-fsync-2-detection.patch: libext2fs: Fix fsync(2) detection + (bsc#1038194) + ------------------------------------------------------------------- Thu Nov 24 15:41:57 UTC 2016 - jack@suse.cz diff --git a/e2fsprogs.spec b/e2fsprogs.spec index 4651c7c..f07c336 100644 --- a/e2fsprogs.spec +++ b/e2fsprogs.spec @@ -1,7 +1,7 @@ # # spec file for package e2fsprogs # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -65,6 +65,8 @@ Patch7: e2fsck-fix-free-pointer-dereferences.patch Patch8: libext2fs-avoid-buffer-overflow-if-s_first_meta_bg-i.patch Patch9: libext2fs-fix-potential-buffer-overflow-in-closefs.patch Patch10: resize2fs-Fix-32-64-bit-overflow-when-multiplying-by-blocks-cl.patch +Patch11: libext2fs-don-t-ignore-fsync-errors.patch +Patch12: libext2fs-Fix-fsync-2-detection.patch # Do not suppress make commands BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -76,9 +78,9 @@ mklost+found, tune2fs, e2fsck, resize2fs, and badblocks. %package devel Summary: Dummy development package +# bug437293 License: LGPL-2.0 Group: Development/Libraries/C and C++ -# bug437293 %ifarch ppc64 Obsoletes: e2fsprogs-devel-64bit %endif @@ -110,9 +112,9 @@ Development files for libext2fs. %package -n libcom_err2 Summary: E2fsprogs error reporting library +# bug437293 License: MIT Group: System/Filesystems -# bug437293 %ifarch ppc64 Obsoletes: libcom_err-64bit Obsoletes: libcom_err2-64bit @@ -126,9 +128,9 @@ com_err is an error message display library. %package -n libcom_err-devel Summary: Development files for libcom_err +# bug437293 License: MIT Group: Development/Libraries/C and C++ -# bug437293 %ifarch ppc64 Obsoletes: libcom_err-devel-64bit %endif @@ -152,6 +154,8 @@ Development files for the com_err error message display library. %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 -p1 cp %{SOURCE2} . %build diff --git a/libext2fs-Fix-fsync-2-detection.patch b/libext2fs-Fix-fsync-2-detection.patch new file mode 100644 index 0000000..22b40a0 --- /dev/null +++ b/libext2fs-Fix-fsync-2-detection.patch @@ -0,0 +1,36 @@ +From: Jan Kara +Date: Wed, 31 May 2017 14:49:18 +0200 +Subject: [PATCH] libext2fs: Fix fsync(2) detection +References: bsc#1038194 + +For some reason lib/config.h.in was missing a definition of HAVE_FSYNC +and as a result lib/config.h never had HAVE_FSYNC defined. As a result +we never called fsync(2) for example from +lib/ext2fs/unix_io.c:unix_flush() when we finished creating filesystem +and could miss IO errors happening during creating of the filesystem. +Test generic/405 exposes this problem. + +Fix the problem by defining HAVE_FSYNC in lib/config.h.in. + +Signed-off-by: Jan Kara +--- + lib/config.h.in | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/config.h.in b/lib/config.h.in +index 37d0c461338a..91e869e7d3d7 100644 +--- a/lib/config.h.in ++++ b/lib/config.h.in +@@ -470,6 +470,9 @@ + /* Define to 1 if you have the `sync_file_range' function. */ + #undef HAVE_SYNC_FILE_RANGE + ++/* Define to 1 if you have the 'fsync' function. */ ++#undef HAVE_FSYNC ++ + /* Define to 1 if you have the `sysconf' function. */ + #undef HAVE_SYSCONF + +-- +2.12.3 + diff --git a/libext2fs-don-t-ignore-fsync-errors.patch b/libext2fs-don-t-ignore-fsync-errors.patch new file mode 100644 index 0000000..695cc10 --- /dev/null +++ b/libext2fs-don-t-ignore-fsync-errors.patch @@ -0,0 +1,86 @@ +From: Eric Sandeen +Date: Tue, 20 Dec 2016 09:23:29 -0600 +Subject: [PATCH] libext2fs: don't ignore fsync errors +Git-commit: 025d31b17a67953ce96741588bd911e6e66b6e03 +References: bsc#1038194 + +Today, if mke2fs experiences IO errors (say, on a thin device +which filled up during mkfs), mke2fs is silent and returns +success even though the filesystem was not properly created. + +Catch errors from the io_channel_flush() callchain to +fix this up. Fix formatting of the printed error as +well: + +... +Creating journal (262144 blocks): done +Writing superblocks and filesystem accounting information: +Warning, had trouble writing out superblocks. +# echo $? +5 + +Signed-off-by: Eric Sandeen +Signed-off-by: Theodore Ts'o +Acked-by: Jan Kara +--- + lib/ext2fs/closefs.c | 10 ++++++++-- + lib/ext2fs/unix_io.c | 3 ++- + misc/mke2fs.c | 2 +- + 3 files changed, 11 insertions(+), 4 deletions(-) + +Index: e2fsprogs-1.42.11/lib/ext2fs/closefs.c +=================================================================== +--- e2fsprogs-1.42.11.orig/lib/ext2fs/closefs.c ++++ e2fsprogs-1.42.11/lib/ext2fs/closefs.c +@@ -418,16 +418,22 @@ write_primary_superblock_only: + ext2fs_swap_super(super_shadow); + #endif + +- if (!(flags & EXT2_FLAG_FLUSH_NO_SYNC)) ++ if (!(flags & EXT2_FLAG_FLUSH_NO_SYNC)) { + retval = io_channel_flush(fs->io); ++ if (retval) ++ goto errout; ++ } + retval = write_primary_superblock(fs, super_shadow); + if (retval) + goto errout; + + fs->flags &= ~EXT2_FLAG_DIRTY; + +- if (!(flags & EXT2_FLAG_FLUSH_NO_SYNC)) ++ if (!(flags & EXT2_FLAG_FLUSH_NO_SYNC)) { + retval = io_channel_flush(fs->io); ++ if (retval) ++ goto errout; ++ } + errout: + fs->super->s_state = fs_state; + #ifdef WORDS_BIGENDIAN +Index: e2fsprogs-1.42.11/lib/ext2fs/unix_io.c +=================================================================== +--- e2fsprogs-1.42.11.orig/lib/ext2fs/unix_io.c ++++ e2fsprogs-1.42.11/lib/ext2fs/unix_io.c +@@ -843,7 +843,8 @@ static errcode_t unix_flush(io_channel c + #ifndef NO_IO_CACHE + retval = flush_cached_blocks(channel, data, 0); + #endif +- fsync(data->dev); ++ if (!retval && fsync(data->dev) != 0) ++ return errno; + return retval; + } + +Index: e2fsprogs-1.42.11/misc/mke2fs.c +=================================================================== +--- e2fsprogs-1.42.11.orig/misc/mke2fs.c ++++ e2fsprogs-1.42.11/misc/mke2fs.c +@@ -2925,7 +2925,7 @@ no_journal: + retval = ext2fs_close_free(&fs); + if (retval) { + fprintf(stderr, "%s", +- _("\nWarning, had trouble writing out superblocks.")); ++ _("\nWarning, had trouble writing out superblocks.\n")); + } else if (!quiet) { + printf("%s", _("done\n\n")); + if (!getenv("MKE2FS_SKIP_CHECK_MSG"))