1 ext4: bail early when clearing inode journal flag fails
3 From: Jan Kara <jack@suse.cz>
5 When clearing inode journal flag, we call jbd2_journal_flush() to force
6 all the journalled data to their final locations. Currently we ignore
7 when this fails and continue clearing inode journal flag. This isn't a
8 big problem because when jbd2_journal_flush() fails, journal is likely
9 aborted anyway. But it can still lead to somewhat confusing results so
10 rather bail out early.
13 Signed-off-by: Jan Kara <jack@suse.cz>
14 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
16 fs/ext4/inode.c | 7 ++++++-
17 1 file changed, 6 insertions(+), 1 deletion(-)
19 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
20 index e9777f9..3356ab5 100644
23 @@ -4959,7 +4959,12 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val)
25 ext4_set_inode_flag(inode, EXT4_INODE_JOURNAL_DATA);
27 - jbd2_journal_flush(journal);
28 + err = jbd2_journal_flush(journal);
30 + jbd2_journal_unlock_updates(journal);
31 + ext4_inode_resume_unlocked_dio(inode);
34 ext4_clear_inode_flag(inode, EXT4_INODE_JOURNAL_DATA);