aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@google.com>2015-04-29 12:04:55 -0400
committerMister Oyster <oysterized@gmail.com>2017-05-27 19:39:59 +0200
commit1e01fa72a23c64d065bdb4cc49dcf2899e446279 (patch)
tree7dc01354c6349ac16e04819eac1e64b898a2e2b8 /scripts
parent7050805346f9513d9a3b1802d50e849e30ba606f (diff)
ext4: make fsync to sync parent dir in no-journal for real this time
(cherry picked from commit e12fb97222fc41e8442896934f76d39ef99b590a) (needed to avoid patch conflicts with further ext4 crypto patches) Previously commit 14ece1028b3ed53ffec1b1213ffc6acaf79ad77c 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. Change-Id: I742fb1c5304986cb990352a2471186bcd2c77ceb 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> Cc: stable@vger.kernel.org Signed-off-by: Theodore Ts'o <tytso@google.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions