Whamcloud - gitweb
LU-13488 kernel: RHEL 8.2 server support
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel8.2 / ext4-attach-jinode-in-writepages.patch
1 Index: linux-4.18.0-193.el8/fs/ext4/inode.c
2 ===================================================================
3 --- linux-4.18.0-193.el8.orig/fs/ext4/inode.c
4 +++ linux-4.18.0-193.el8/fs/ext4/inode.c
5 @@ -731,6 +731,9 @@ out_sem:
6                                 (loff_t)map->m_lblk << inode->i_blkbits;
7                         loff_t length = (loff_t)map->m_len << inode->i_blkbits;
8  
9 +                       ret = ext4_inode_attach_jinode(inode);
10 +                       if (ret)
11 +                               return ret;
12                         if (flags & EXT4_GET_BLOCKS_IO_SUBMIT)
13                                 ret = ext4_jbd2_inode_add_wait(handle, inode,
14                                                 start_byte, length);
15 @@ -2815,6 +2818,9 @@ static int ext4_writepages(struct addres
16                 mpd.last_page = wbc->range_end >> PAGE_SHIFT;
17         }
18  
19 +       ret = ext4_inode_attach_jinode(inode);
20 +       if (ret)
21 +               goto out_writepages;
22         mpd.inode = inode;
23         mpd.wbc = wbc;
24         ext4_io_submit_init(&mpd.io_submit, wbc);
25 @@ -4442,6 +4448,7 @@ int ext4_inode_attach_jinode(struct inod
26                 jbd2_free_inode(jinode);
27         return 0;
28  }
29 +EXPORT_SYMBOL(ext4_inode_attach_jinode);
30  
31  /*
32   * ext4_truncate()
33 Index: linux-4.15.0/fs/ext4/ext4.h
34 ===================================================================
35 --- linux-4.15.0.orig/fs/ext4/ext4.h
36 +++ linux-4.15.0/fs/ext4/ext4.h
37 @@ -2595,6 +2595,7 @@ extern int ext4_trim_fs(struct super_blo
38  extern void ext4_process_freed_data(struct super_block *sb, tid_t commit_tid);
39  
40  /* inode.c */
41 +#define HAVE_LDISKFS_INFO_JINODE
42  int ext4_inode_is_fast_symlink(struct inode *inode);
43  struct buffer_head *ext4_getblk(handle_t *, struct inode *, ext4_lblk_t, int);
44  struct buffer_head *ext4_bread(handle_t *, struct inode *, ext4_lblk_t, int);