Whamcloud - gitweb
LU-9510 ldiskfs: to not verify preallocation in umount path
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel8 / ext4-misc.patch
1 Index: linux-4.18.0-80.1.2.el8_0/fs/ext4/ext4.h
2 ===================================================================
3 --- linux-4.18.0-80.1.2.el8_0.orig/fs/ext4/ext4.h
4 +++ linux-4.18.0-80.1.2.el8_0/fs/ext4/ext4.h
5 @@ -1591,6 +1591,8 @@ static inline void ext4_clear_state_flag
6   */
7  #define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime
8  
9 +#define JOURNAL_START_HAS_3ARGS        1
10 +
11  /*
12   * Codes for operating systems
13   */
14 @@ -1805,7 +1807,21 @@ static inline bool ext4_has_unknown_ext#
15  
16  EXTN_FEATURE_FUNCS(2)
17  EXTN_FEATURE_FUNCS(3)
18 -EXTN_FEATURE_FUNCS(4)
19 +static inline bool ext4_has_unknown_ext4_compat_features(struct super_block *sb)
20 +{
21 +       return ((EXT4_SB(sb)->s_es->s_feature_compat &
22 +               cpu_to_le32(~EXT4_FEATURE_COMPAT_SUPP)) != 0);
23 +}
24 +static inline bool ext4_has_unknown_ext4_ro_compat_features(struct super_block *sb)
25 +{
26 +       return ((EXT4_SB(sb)->s_es->s_feature_ro_compat &
27 +               cpu_to_le32(~EXT4_FEATURE_RO_COMPAT_SUPP)) != 0);
28 +}
29 +static inline bool ext4_has_unknown_ext4_incompat_features(struct super_block *sb)
30 +{
31 +       return ((EXT4_SB(sb)->s_es->s_feature_incompat &
32 +               cpu_to_le32(~EXT4_FEATURE_INCOMPAT_SUPP)) != 0);
33 +}
34  
35  static inline bool ext4_has_compat_features(struct super_block *sb)
36  {
37 @@ -3111,6 +3127,11 @@ struct ext4_extent;
38  
39  extern int ext4_ext_tree_init(handle_t *handle, struct inode *);
40  extern int ext4_ext_writepage_trans_blocks(struct inode *, int);
41 +extern struct buffer_head *ext4_read_inode_bitmap(struct super_block *sb,
42 +                                                 ext4_group_t block_group);
43 +extern struct buffer_head *ext4_append(handle_t *handle,
44 +                                      struct inode *inode,
45 +                                      ext4_lblk_t *block);
46  extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents);
47  extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
48                                struct ext4_map_blocks *map, int flags);
49 Index: linux-4.18.0-80.1.2.el8_0/fs/ext4/ialloc.c
50 ===================================================================
51 --- linux-4.18.0-80.1.2.el8_0.orig/fs/ext4/ialloc.c
52 +++ linux-4.18.0-80.1.2.el8_0/fs/ext4/ialloc.c
53 @@ -114,7 +114,7 @@ verified:
54   *
55   * Return buffer_head of bitmap on success or NULL.
56   */
57 -static struct buffer_head *
58 +struct buffer_head *
59  ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
60  {
61         struct ext4_group_desc *desc;
62 @@ -211,6 +211,7 @@ out:
63         put_bh(bh);
64         return ERR_PTR(err);
65  }
66 +EXPORT_SYMBOL(ext4_read_inode_bitmap);
67  
68  /*
69   * NOTE! When we get the inode, we're the only people
70 Index: linux-4.18.0-80.1.2.el8_0/fs/ext4/inode.c
71 ===================================================================
72 --- linux-4.18.0-80.1.2.el8_0.orig/fs/ext4/inode.c
73 +++ linux-4.18.0-80.1.2.el8_0/fs/ext4/inode.c
74 @@ -6267,3 +6267,18 @@ int ext4_filemap_fault(struct vm_fault *
75  
76         return err;
77  }
78 +EXPORT_SYMBOL(ext4_map_blocks);
79 +EXPORT_SYMBOL(ext4_truncate);
80 +EXPORT_SYMBOL(ext4_iget);
81 +EXPORT_SYMBOL(ext4_bread);
82 +EXPORT_SYMBOL(ext4_itable_unused_count);
83 +EXPORT_SYMBOL(ext4_force_commit);
84 +EXPORT_SYMBOL(ext4_mark_inode_dirty);
85 +EXPORT_SYMBOL(ext4_get_group_desc);
86 +EXPORT_SYMBOL(__ext4_journal_get_write_access);
87 +EXPORT_SYMBOL(__ext4_journal_start_sb);
88 +EXPORT_SYMBOL(__ext4_journal_stop);
89 +EXPORT_SYMBOL(__ext4_handle_dirty_metadata);
90 +EXPORT_SYMBOL(__ext4_std_error);
91 +EXPORT_SYMBOL(ext4fs_dirhash);
92 +EXPORT_SYMBOL(ext4_get_inode_loc);
93 Index: linux-4.18.0-80.1.2.el8_0/fs/ext4/namei.c
94 ===================================================================
95 --- linux-4.18.0-80.1.2.el8_0.orig/fs/ext4/namei.c
96 +++ linux-4.18.0-80.1.2.el8_0/fs/ext4/namei.c
97 @@ -49,7 +49,7 @@
98  #define NAMEI_RA_BLOCKS  4
99  #define NAMEI_RA_SIZE       (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
100  
101 -static struct buffer_head *ext4_append(handle_t *handle,
102 +struct buffer_head *ext4_append(handle_t *handle,
103                                         struct inode *inode,
104                                         ext4_lblk_t *block)
105  {
106 @@ -160,6 +160,7 @@ static struct buffer_head *__ext4_read_d
107         }
108         return bh;
109  }
110 +EXPORT_SYMBOL(ext4_append);
111  
112  #ifndef assert
113  #define assert(test) J_ASSERT(test)
114 @@ -2415,23 +2416,25 @@ EXPORT_SYMBOL(ext4_delete_entry);
115   * for checking S_ISDIR(inode) (since the INODE_INDEX feature will not be set
116   * on regular files) and to avoid creating huge/slow non-HTREE directories.
117   */
118 -static void ext4_inc_count(handle_t *handle, struct inode *inode)
119 +void ext4_inc_count(handle_t *handle, struct inode *inode)
120  {
121         inc_nlink(inode);
122         if (is_dx(inode) &&
123             (inode->i_nlink > EXT4_LINK_MAX || inode->i_nlink == 2))
124                 set_nlink(inode, 1);
125  }
126 +EXPORT_SYMBOL(ext4_inc_count);
127  
128  /*
129   * If a directory had nlink == 1, then we should let it be 1. This indicates
130   * directory has >EXT4_LINK_MAX subdirs.
131   */
132 -static void ext4_dec_count(handle_t *handle, struct inode *inode)
133 +void ext4_dec_count(handle_t *handle, struct inode *inode)
134  {
135         if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
136                 drop_nlink(inode);
137  }
138 +EXPORT_SYMBOL(ext4_dec_count);
139  
140  
141  static int ext4_add_nondir(handle_t *handle,
142 Index: linux-4.18.0-80.1.2.el8_0/fs/ext4/super.c
143 ===================================================================
144 --- linux-4.18.0-80.1.2.el8_0.orig/fs/ext4/super.c
145 +++ linux-4.18.0-80.1.2.el8_0/fs/ext4/super.c
146 @@ -323,11 +323,11 @@ static void __save_error_info(struct sup
147                 return;
148         es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
149         es->s_last_error_time = cpu_to_le32(get_seconds());
150 -       strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
151 +       strlcpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
152         es->s_last_error_line = cpu_to_le32(line);
153         if (!es->s_first_error_time) {
154                 es->s_first_error_time = es->s_last_error_time;
155 -               strncpy(es->s_first_error_func, func,
156 +               strlcpy(es->s_first_error_func, func,
157                         sizeof(es->s_first_error_func));
158                 es->s_first_error_line = cpu_to_le32(line);
159                 es->s_first_error_ino = es->s_last_error_ino;
160 @@ -5957,16 +5957,12 @@ static int __init ext4_init_fs(void)
161         err = init_inodecache();
162         if (err)
163                 goto out1;
164 -       register_as_ext3();
165 -       register_as_ext2();
166         err = register_filesystem(&ext4_fs_type);
167         if (err)
168                 goto out;
169  
170         return 0;
171  out:
172 -       unregister_as_ext2();
173 -       unregister_as_ext3();
174         destroy_inodecache();
175  out1:
176         ext4_exit_mballoc();
177 @@ -5985,8 +5981,6 @@ out5:
178  static void __exit ext4_exit_fs(void)
179  {
180         ext4_destroy_lazyinit_thread();
181 -       unregister_as_ext2();
182 -       unregister_as_ext3();
183         unregister_filesystem(&ext4_fs_type);
184         destroy_inodecache();
185         ext4_exit_mballoc();