rebase to v4.9-rc2
[ext4-patch-queue.git] / reenable-per-file-data-journalling-and-delalloc
bloba0383a1057922b44d721258e81e5edd50850074d
1 ext4: re-enable per-file data journaling and delayed allocation
3 From: Daeho Jeong <daeho.jeong@samsung.com>
5 Several problems occurred when per-file data journaling is enabled on
6 "delalloc" mode, so the per-file data journaling was permanently
7 deactivated by commit 3d2b15826282 ("ext4: ignore
8 EXT4_INODE_JOURNAL_DATA flag with delalloc"). But, those are not
9 problems for only "delalloc" mode and when you execute xfstest on
10 "nodelalloc" mode, same problems happen on "nodelalloc" mode. We always
11 execute xfstest on "delalloc" mode, which is default mode, so we
12 haven't realized problems of per-file data journaling feature. Finally,
13 problems of per-file data journaling feature were fixed by
14 commit 9c02ac97989d ("ext4: fix xfstest generic/269 double revoked
15 buffer bug with bigalloc") and previous patchset. Now, we can re-enable
16 the feature on "delalloc" mode.
18 Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
19 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
20 Reviewed-by: Jan Kara <jack@suse.cz>
21 ---
22  fs/ext4/ext4_jbd2.h |    4 +---
23  1 file changed, 1 insertion(+), 3 deletions(-)
25 diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h
26 index 5f58462..9463bb8 100644
27 --- a/fs/ext4/ext4_jbd2.h
28 +++ b/fs/ext4/ext4_jbd2.h
29 @@ -393,12 +393,10 @@ static inline int ext4_inode_journal_mode(struct inode *inode)
30  {
31         if (EXT4_JOURNAL(inode) == NULL)
32                 return EXT4_INODE_WRITEBACK_DATA_MODE;  /* writeback */
33 -       /* We do not support data journalling with delayed allocation */
34         if (!S_ISREG(inode->i_mode) ||
35             test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
36                 return EXT4_INODE_JOURNAL_DATA_MODE;    /* journal data */
37 -       if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA) &&
38 -           !test_opt(inode->i_sb, DELALLOC))
39 +       if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA))
40                 return EXT4_INODE_JOURNAL_DATA_MODE;    /* journal data */
41         if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
42                 return EXT4_INODE_ORDERED_DATA_MODE;    /* ordered */
43 -- 
44 1.7.9.5