diff options
author | Jan Kara <jack@suse.cz> | 2014-10-30 10:53:17 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-10-30 10:53:17 -0400 |
commit | 4f879ca687a5f2473b952937ce92c795a39019b4 (patch) | |
tree | 82bc9483da48a41d56224a0236246543e8fd9b6d /fs | |
parent | 6050d47adcadbb53582434d919ed7f038d936712 (diff) |
ext4: bail early when clearing inode journal flag fails
When clearing inode journal flag, we call jbd2_journal_flush() to force
all the journalled data to their final locations. Currently we ignore
when this fails and continue clearing inode journal flag. This isn't a
big problem because when jbd2_journal_flush() fails, journal is likely
aborted anyway. But it can still lead to somewhat confusing results so
rather bail out early.
Coverity-id: 989044
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/inode.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index e9777f93cf05..3356ab5395f4 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -4959,7 +4959,12 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val) | |||
4959 | if (val) | 4959 | if (val) |
4960 | ext4_set_inode_flag(inode, EXT4_INODE_JOURNAL_DATA); | 4960 | ext4_set_inode_flag(inode, EXT4_INODE_JOURNAL_DATA); |
4961 | else { | 4961 | else { |
4962 | jbd2_journal_flush(journal); | 4962 | err = jbd2_journal_flush(journal); |
4963 | if (err < 0) { | ||
4964 | jbd2_journal_unlock_updates(journal); | ||
4965 | ext4_inode_resume_unlocked_dio(inode); | ||
4966 | return err; | ||
4967 | } | ||
4963 | ext4_clear_inode_flag(inode, EXT4_INODE_JOURNAL_DATA); | 4968 | ext4_clear_inode_flag(inode, EXT4_INODE_JOURNAL_DATA); |
4964 | } | 4969 | } |
4965 | ext4_set_aops(inode); | 4970 | ext4_set_aops(inode); |