Whamcloud - gitweb
LU-11310 ldiskfs: Repair support for SUSE 15 GA and SP1
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / suse15 / ext4-attach-jinode-in-writepages.patch
1 ---
2  fs/ext4/ext4.h  |    1 +
3  fs/ext4/inode.c |    7 +++++++
4  2 files changed, 8 insertions(+)
5
6 --- a/fs/ext4/ext4.h
7 +++ b/fs/ext4/ext4.h
8 @@ -2633,6 +2633,7 @@ extern int ext4_group_add_blocks(handle_
9  extern int ext4_trim_fs(struct super_block *, struct fstrim_range *);
10  
11  /* inode.c */
12 +#define HAVE_LDISKFS_INFO_JINODE
13  int ext4_inode_is_fast_symlink(struct inode *inode);
14  struct buffer_head *ext4_getblk(handle_t *, struct inode *, ext4_lblk_t, int);
15  struct buffer_head *ext4_bread(handle_t *, struct inode *, ext4_lblk_t, int);
16 --- a/fs/ext4/inode.c
17 +++ b/fs/ext4/inode.c
18 @@ -749,6 +749,9 @@ out_sem:
19                                 (loff_t)map->m_lblk << inode->i_blkbits;
20                         loff_t length = (loff_t)map->m_len << inode->i_blkbits;
21  
22 +                       ret = ext4_inode_attach_jinode(inode);
23 +                        if (ret)
24 +                                return ret;
25                         if (flags & EXT4_GET_BLOCKS_IO_SUBMIT)
26                                 ret = ext4_jbd2_inode_add_wait(handle, inode,
27                                                 start_byte, length);
28 @@ -2795,6 +2798,9 @@ static int ext4_writepages(struct addres
29                 mpd.last_page = wbc->range_end >> PAGE_SHIFT;
30         }
31  
32 +       ret = ext4_inode_attach_jinode(inode);
33 +       if (ret)
34 +               goto out_writepages;
35         mpd.inode = inode;
36         mpd.wbc = wbc;
37         ext4_io_submit_init(&mpd.io_submit, wbc);
38 @@ -4339,6 +4345,7 @@ int ext4_inode_attach_jinode(struct inod
39                 jbd2_free_inode(jinode);
40         return 0;
41  }
42 +EXPORT_SYMBOL(ext4_inode_attach_jinode);
43  
44  /*
45   * ext4_truncate()