diff options
author | Frank Mayhar <fmayhar@google.com> | 2010-05-17 08:00:00 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-05-17 08:00:00 -0400 |
commit | 14ece1028b3ed53ffec1b1213ffc6acaf79ad77c (patch) | |
tree | 8f5a13487139c68ef775c9d39b7be83386fdae06 /fs/ext4/ext4.h | |
parent | 60e6679e28518ccd67169c4a539d8cc7490eb8a6 (diff) |
ext4: Make fsync sync new parent directories in no-journal mode
Add a new ext4 state to tell us when a file has been newly created; use
that state in ext4_sync_file in no-journal mode to tell us when we need
to sync the parent directory as well as the inode and data itself. This
fixes a problem in which a panic or power failure may lose the entire
file even when using fsync, since the parent directory entry is lost.
Addresses-Google-Bug: #2480057
Signed-off-by: Frank Mayhar <fmayhar@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 124ef771a618..60bd31026e7c 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -1180,6 +1180,7 @@ enum { | |||
1180 | EXT4_STATE_DA_ALLOC_CLOSE, /* Alloc DA blks on close */ | 1180 | EXT4_STATE_DA_ALLOC_CLOSE, /* Alloc DA blks on close */ |
1181 | EXT4_STATE_EXT_MIGRATE, /* Inode is migrating */ | 1181 | EXT4_STATE_EXT_MIGRATE, /* Inode is migrating */ |
1182 | EXT4_STATE_DIO_UNWRITTEN, /* need convert on dio done*/ | 1182 | EXT4_STATE_DIO_UNWRITTEN, /* need convert on dio done*/ |
1183 | EXT4_STATE_NEWENTRY, /* File just added to dir */ | ||
1183 | }; | 1184 | }; |
1184 | 1185 | ||
1185 | #define EXT4_INODE_BIT_FNS(name, field) \ | 1186 | #define EXT4_INODE_BIT_FNS(name, field) \ |