* [PATCH] libext2fs: Fix fsync(2) detection
@ 2017-06-07 13:31 Jan Kara
2017-06-08 16:04 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2017-06-07 13:31 UTC (permalink / raw)
To: Ted Tso; +Cc: linux-ext4, Jan Kara
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 <jack@suse.cz>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] libext2fs: Fix fsync(2) detection
2017-06-07 13:31 [PATCH] libext2fs: Fix fsync(2) detection Jan Kara
@ 2017-06-08 16:04 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2017-06-08 16:04 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-ext4
On Wed, Jun 07, 2017 at 03:31:14PM +0200, Jan Kara wrote:
> 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 <jack@suse.cz>
Thanks for tracking down this regression. This bug was introduced by
my cherry-picking in changes from the Android AOSP version of
e2fsprogs a few weeks ago. I was wondering why generic/405 had
regressed.
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-08 16:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-07 13:31 [PATCH] libext2fs: Fix fsync(2) detection Jan Kara
2017-06-08 16:04 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).