Files
linux/fs
Lukas Czerner b19efa7293 ext4: make fsync to sync parent dir in no-journal for real this time
commit e12fb97222 upstream.

Previously commit 14ece1028b added a
support for for syncing parent directory of newly created inodes to
make sure that the inode is not lost after a power failure in
no-journal mode.

However this does not work in majority of cases, namely:
 - if the directory has inline data
 - if the directory is already indexed
 - if the directory already has at least one block and:
	- the new entry fits into it
	- or we've successfully converted it to indexed

So in those cases we might lose the inode entirely even after fsync in
the no-journal mode. This also includes ext2 default mode obviously.

I've noticed this while running xfstest generic/321 and even though the
test should fail (we need to run fsck after a crash in no-journal mode)
I could not find a newly created entries even when if it was fsynced
before.

Fix this by adjusting the ext4_add_entry() successful exit paths to set
the inode EXT4_STATE_NEWENTRY so that fsync has the chance to fsync the
parent directory as well.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Frank Mayhar <fmayhar@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 21:59:15 +02:00
..
2013-10-24 23:43:27 -04:00
2014-11-21 09:23:06 -08:00
2014-01-25 03:13:02 -05:00
2014-01-23 18:54:14 +02:00
2015-03-26 15:06:53 +01:00
2014-01-26 11:51:09 +01:00
2014-02-02 16:24:07 -08:00
2013-12-04 12:27:46 +01:00
2014-02-13 15:56:05 -06:00
2013-09-16 18:20:25 -07:00
2014-01-25 03:14:05 -05:00
2014-01-25 03:13:03 -05:00
2013-10-24 23:34:54 -04:00
2013-11-23 22:33:47 -08:00
2013-09-10 18:56:31 -04:00
2014-10-09 12:21:29 -07:00
2013-10-24 23:34:54 -04:00
2013-11-09 00:16:20 -05:00
2013-10-24 23:34:54 -04:00
2014-01-26 08:26:40 -05:00
2014-03-30 19:18:51 -04:00
2013-11-23 22:33:47 -08:00
2014-05-06 07:59:36 -07:00
2013-10-24 23:34:54 -04:00
2014-01-22 19:36:57 +01:00
2013-11-09 00:16:31 -05:00