Whamcloud - gitweb
LU-5022 ldiskfs: enable support for RHEL7
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel7 / ext4-inode-version.patch
1 Index: linux-3.10.0-123.el7.x86_64/fs/ext4/inode.c
2 ===================================================================
3 --- linux-3.10.0-123.el7.x86_64.orig/fs/ext4/inode.c
4 +++ linux-3.10.0-123.el7.x86_64/fs/ext4/inode.c
5 @@ -4286,10 +4286,10 @@ struct inode *ext4_iget(struct super_blo
6         EXT4_EINODE_GET_XTIME(i_crtime, ei, raw_inode);
7  
8         if (likely(!test_opt2(inode->i_sb, HURD_COMPAT))) {
9 -               inode->i_version = le32_to_cpu(raw_inode->i_disk_version);
10 +               ei->i_fs_version = le32_to_cpu(raw_inode->i_disk_version);
11                 if (EXT4_INODE_SIZE(inode->i_sb) > EXT4_GOOD_OLD_INODE_SIZE) {
12                         if (EXT4_FITS_IN_INODE(raw_inode, ei, i_version_hi))
13 -                               inode->i_version |=
14 +                               ei->i_fs_version |=
15                     (__u64)(le32_to_cpu(raw_inode->i_version_hi)) << 32;
16                 }
17         }
18 @@ -4506,11 +4506,11 @@ static int ext4_do_update_inode(handle_t
19         }
20  
21         if (likely(!test_opt2(inode->i_sb, HURD_COMPAT))) {
22 -               raw_inode->i_disk_version = cpu_to_le32(inode->i_version);
23 +               raw_inode->i_disk_version = cpu_to_le32(ei->i_fs_version);
24                 if (ei->i_extra_isize) {
25                         if (EXT4_FITS_IN_INODE(raw_inode, ei, i_version_hi))
26                                 raw_inode->i_version_hi =
27 -                                       cpu_to_le32(inode->i_version >> 32);
28 +                                       cpu_to_le32(ei->i_fs_version >> 32);
29                         raw_inode->i_extra_isize =
30                                 cpu_to_le16(ei->i_extra_isize);
31                 }
32 Index: linux-3.10.0-123.el7.x86_64/fs/ext4/ialloc.c
33 ===================================================================
34 --- linux-3.10.0-123.el7.x86_64.orig/fs/ext4/ialloc.c
35 +++ linux-3.10.0-123.el7.x86_64/fs/ext4/ialloc.c
36 @@ -898,6 +898,7 @@ got:
37         ei->i_dtime = 0;
38         ei->i_block_group = group;
39         ei->i_last_alloc_group = ~0;
40 +       ei->i_fs_version = 0;
41  
42         ext4_set_inode_flags(inode);
43         if (IS_DIRSYNC(inode))
44 Index: linux-3.10.0-123.el7.x86_64/fs/ext4/ext4.h
45 ===================================================================
46 --- linux-3.10.0-123.el7.x86_64.orig/fs/ext4/ext4.h
47 +++ linux-3.10.0-123.el7.x86_64/fs/ext4/ext4.h
48 @@ -921,6 +921,8 @@ struct ext4_inode_info {
49         tid_t i_sync_tid;
50         tid_t i_datasync_tid;
51  
52 +       __u64 i_fs_version;
53 +
54         /* Precomputed uuid+inum+igen checksum for seeding inode checksums */
55         __u32 i_csum_seed;
56  };