add patch return-eio-on-read-error-in-ext4_find_dentry
[ext4-patch-queue.git] / xattr-in-inode-support
blob325e5e1ea9ee04e0274444e20a6615c0a5aef171
1 ext4: xattr-in-inode support
3 From: Andreas Dilger <andreas.dilger@intel.com>
5 Large xattr support is implemented for EXT4_FEATURE_INCOMPAT_EA_INODE.
7 If the size of an xattr value is larger than will fit in a single
8 external block, then the xattr value will be saved into the body
9 of an external xattr inode.
11 The also helps support a larger number of xattr, since only the headers
12 will be stored in the in-inode space or the single external block.
14 The inode is referenced from the xattr header via "e_value_inum",
15 which was formerly "e_value_block", but that field was never used.
16 The e_value_size still contains the xattr size so that listing
17 xattrs does not need to look up the inode if the data is not accessed.
19 struct ext4_xattr_entry {
20         __u8    e_name_len;     /* length of name */
21         __u8    e_name_index;   /* attribute name index */
22         __le16  e_value_offs;   /* offset in disk block of value */
23         __le32  e_value_inum;   /* inode in which value is stored */
24         __le32  e_value_size;   /* size of attribute value */
25         __le32  e_hash;         /* hash value of name and value */
26         char    e_name[0];      /* attribute name */
29 The xattr inode is marked with the EXT4_EA_INODE_FL flag and also
30 holds a back-reference to the owning inode in its i_mtime field,
31 allowing the ext4/e2fsck to verify the correct inode is accessed.
33 Lustre-Jira: https://jira.hpdd.intel.com/browse/LU-80
34 Lustre-bugzilla: https://bugzilla.lustre.org/show_bug.cgi?id=4424
35 Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
36 Signed-off-by: James Simmons <uja.ornl@gmail.com>
37 Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
38 Signed-off-by: Tahsin Erdogan <tahsin@google.com>
39 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
40 ---
41  fs/ext4/ext4.h   |  12 ++
42  fs/ext4/ialloc.c |   1 -
43  fs/ext4/inline.c |   2 +-
44  fs/ext4/inode.c  |  49 ++++-
45  fs/ext4/xattr.c  | 565 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
46  fs/ext4/xattr.h  |  33 +++-
47  6 files changed, 606 insertions(+), 56 deletions(-)
49 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
50 index 32191548abed..24ef56b4572f 100644
51 --- a/fs/ext4/ext4.h
52 +++ b/fs/ext4/ext4.h
53 @@ -1797,6 +1797,7 @@ EXT4_FEATURE_INCOMPAT_FUNCS(encrypt,              ENCRYPT)
54                                          EXT4_FEATURE_INCOMPAT_EXTENTS| \
55                                          EXT4_FEATURE_INCOMPAT_64BIT| \
56                                          EXT4_FEATURE_INCOMPAT_FLEX_BG| \
57 +                                        EXT4_FEATURE_INCOMPAT_EA_INODE| \
58                                          EXT4_FEATURE_INCOMPAT_MMP | \
59                                          EXT4_FEATURE_INCOMPAT_INLINE_DATA | \
60                                          EXT4_FEATURE_INCOMPAT_ENCRYPT | \
61 @@ -2219,6 +2220,12 @@ struct mmpd_data {
62   */
63  #define EXT4_MMP_MAX_CHECK_INTERVAL    300UL
65 +/*
66 + * Maximum size of xattr attributes for FEATURE_INCOMPAT_EA_INODE 1Mb
67 + * This limit is arbitrary, but is reasonable for the xattr API.
68 + */
69 +#define EXT4_XATTR_MAX_LARGE_EA_SIZE    (1024 * 1024)
71  /*
72   * Function prototypes
73   */
74 @@ -2231,6 +2238,10 @@ struct mmpd_data {
75  # define ATTRIB_NORET  __attribute__((noreturn))
76  # define NORET_AND     noreturn,
78 +struct ext4_xattr_ino_array {
79 +       unsigned int xia_count;         /* # of used item in the array */
80 +       unsigned int xia_inodes[0];
81 +};
82  /* bitmap.c */
83  extern unsigned int ext4_count_free(char *bitmap, unsigned numchars);
84  void ext4_inode_bitmap_csum_set(struct super_block *sb, ext4_group_t group,
85 @@ -2478,6 +2489,7 @@ extern int ext4_truncate_restart_trans(handle_t *, struct inode *, int nblocks);
86  extern void ext4_set_inode_flags(struct inode *);
87  extern int ext4_alloc_da_blocks(struct inode *inode);
88  extern void ext4_set_aops(struct inode *inode);
89 +extern int ext4_meta_trans_blocks(struct inode *, int nrblocks, int chunk);
90  extern int ext4_writepage_trans_blocks(struct inode *);
91  extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks);
92  extern int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,
93 diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
94 index 98ac2f1f23b3..e2eb3cc06820 100644
95 --- a/fs/ext4/ialloc.c
96 +++ b/fs/ext4/ialloc.c
97 @@ -294,7 +294,6 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
98          * as writing the quota to disk may need the lock as well.
99          */
100         dquot_initialize(inode);
101 -       ext4_xattr_delete_inode(handle, inode);
102         dquot_free_inode(inode);
103         dquot_drop(inode);
105 diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
106 index 8d141c0c8ff9..28c5c3abddb3 100644
107 --- a/fs/ext4/inline.c
108 +++ b/fs/ext4/inline.c
109 @@ -61,7 +61,7 @@ static int get_max_inline_xattr_value_size(struct inode *inode,
111         /* Compute min_offs. */
112         for (; !IS_LAST_ENTRY(entry); entry = EXT4_XATTR_NEXT(entry)) {
113 -               if (!entry->e_value_block && entry->e_value_size) {
114 +               if (!entry->e_value_inum && entry->e_value_size) {
115                         size_t offs = le16_to_cpu(entry->e_value_offs);
116                         if (offs < min_offs)
117                                 min_offs = offs;
118 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
119 index 5cf82d03968c..e5535e5b3dc5 100644
120 --- a/fs/ext4/inode.c
121 +++ b/fs/ext4/inode.c
122 @@ -139,8 +139,6 @@ static void ext4_invalidatepage(struct page *page, unsigned int offset,
123                                 unsigned int length);
124  static int __ext4_journalled_writepage(struct page *page, unsigned int len);
125  static int ext4_bh_delay_or_unwritten(handle_t *handle, struct buffer_head *bh);
126 -static int ext4_meta_trans_blocks(struct inode *inode, int lblocks,
127 -                                 int pextents);
129  /*
130   * Test whether an inode is a fast symlink.
131 @@ -189,6 +187,8 @@ void ext4_evict_inode(struct inode *inode)
133         handle_t *handle;
134         int err;
135 +       int extra_credits = 3;
136 +       struct ext4_xattr_ino_array *lea_ino_array = NULL;
138         trace_ext4_evict_inode(inode);
140 @@ -238,8 +238,8 @@ void ext4_evict_inode(struct inode *inode)
141          * protection against it
142          */
143         sb_start_intwrite(inode->i_sb);
144 -       handle = ext4_journal_start(inode, EXT4_HT_TRUNCATE,
145 -                                   ext4_blocks_for_truncate(inode)+3);
147 +       handle = ext4_journal_start(inode, EXT4_HT_TRUNCATE, extra_credits);
148         if (IS_ERR(handle)) {
149                 ext4_std_error(inode->i_sb, PTR_ERR(handle));
150                 /*
151 @@ -251,9 +251,36 @@ void ext4_evict_inode(struct inode *inode)
152                 sb_end_intwrite(inode->i_sb);
153                 goto no_delete;
154         }
156         if (IS_SYNC(inode))
157                 ext4_handle_sync(handle);
159 +       /*
160 +        * Delete xattr inode before deleting the main inode.
161 +        */
162 +       err = ext4_xattr_delete_inode(handle, inode, &lea_ino_array);
163 +       if (err) {
164 +               ext4_warning(inode->i_sb,
165 +                            "couldn't delete inode's xattr (err %d)", err);
166 +               goto stop_handle;
167 +       }
169 +       if (!IS_NOQUOTA(inode))
170 +               extra_credits += 2 * EXT4_QUOTA_DEL_BLOCKS(inode->i_sb);
172 +       if (!ext4_handle_has_enough_credits(handle,
173 +                       ext4_blocks_for_truncate(inode) + extra_credits)) {
174 +               err = ext4_journal_extend(handle,
175 +                       ext4_blocks_for_truncate(inode) + extra_credits);
176 +               if (err > 0)
177 +                       err = ext4_journal_restart(handle,
178 +                       ext4_blocks_for_truncate(inode) + extra_credits);
179 +               if (err != 0) {
180 +                       ext4_warning(inode->i_sb,
181 +                                    "couldn't extend journal (err %d)", err);
182 +                       goto stop_handle;
183 +               }
184 +       }
186         inode->i_size = 0;
187         err = ext4_mark_inode_dirty(handle, inode);
188         if (err) {
189 @@ -277,10 +304,10 @@ void ext4_evict_inode(struct inode *inode)
190          * enough credits left in the handle to remove the inode from
191          * the orphan list and set the dtime field.
192          */
193 -       if (!ext4_handle_has_enough_credits(handle, 3)) {
194 -               err = ext4_journal_extend(handle, 3);
195 +       if (!ext4_handle_has_enough_credits(handle, extra_credits)) {
196 +               err = ext4_journal_extend(handle, extra_credits);
197                 if (err > 0)
198 -                       err = ext4_journal_restart(handle, 3);
199 +                       err = ext4_journal_restart(handle, extra_credits);
200                 if (err != 0) {
201                         ext4_warning(inode->i_sb,
202                                      "couldn't extend journal (err %d)", err);
203 @@ -315,8 +342,12 @@ void ext4_evict_inode(struct inode *inode)
204                 ext4_clear_inode(inode);
205         else
206                 ext4_free_inode(handle, inode);
208         ext4_journal_stop(handle);
209         sb_end_intwrite(inode->i_sb);
211 +       if (lea_ino_array != NULL)
212 +               ext4_xattr_inode_array_free(inode, lea_ino_array);
213         return;
214  no_delete:
215         ext4_clear_inode(inode);        /* We must guarantee clearing of inode... */
216 @@ -5504,7 +5535,7 @@ static int ext4_index_trans_blocks(struct inode *inode, int lblocks,
217   *
218   * Also account for superblock, inode, quota and xattr blocks
219   */
220 -static int ext4_meta_trans_blocks(struct inode *inode, int lblocks,
221 +int ext4_meta_trans_blocks(struct inode *inode, int lblocks,
222                                   int pextents)
224         ext4_group_t groups, ngroups = ext4_get_groups_count(inode->i_sb);
225 diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
226 index 5d3c2536641c..444be5c7a1d5 100644
227 --- a/fs/ext4/xattr.c
228 +++ b/fs/ext4/xattr.c
229 @@ -177,9 +177,8 @@ ext4_xattr_check_entries(struct ext4_xattr_entry *entry, void *end,
231         /* Check the values */
232         while (!IS_LAST_ENTRY(entry)) {
233 -               if (entry->e_value_block != 0)
234 -                       return -EFSCORRUPTED;
235 -               if (entry->e_value_size != 0) {
236 +               if (entry->e_value_size != 0 &&
237 +                   entry->e_value_inum == 0) {
238                         u16 offs = le16_to_cpu(entry->e_value_offs);
239                         u32 size = le32_to_cpu(entry->e_value_size);
240                         void *value;
241 @@ -269,6 +268,99 @@ ext4_xattr_find_entry(struct ext4_xattr_entry **pentry, int name_index,
242         return cmp ? -ENODATA : 0;
246 + * Read the EA value from an inode.
247 + */
248 +static int
249 +ext4_xattr_inode_read(struct inode *ea_inode, void *buf, size_t *size)
251 +       unsigned long block = 0;
252 +       struct buffer_head *bh = NULL;
253 +       int blocksize;
254 +       size_t csize, ret_size = 0;
256 +       if (*size == 0)
257 +               return 0;
259 +       blocksize = ea_inode->i_sb->s_blocksize;
261 +       while (ret_size < *size) {
262 +               csize = (*size - ret_size) > blocksize ? blocksize :
263 +                                                       *size - ret_size;
264 +               bh = ext4_bread(NULL, ea_inode, block, 0);
265 +               if (IS_ERR(bh)) {
266 +                       *size = ret_size;
267 +                       return PTR_ERR(bh);
268 +               }
269 +               memcpy(buf, bh->b_data, csize);
270 +               brelse(bh);
272 +               buf += csize;
273 +               block += 1;
274 +               ret_size += csize;
275 +       }
277 +       *size = ret_size;
279 +       return 0;
282 +struct inode *ext4_xattr_inode_iget(struct inode *parent, unsigned long ea_ino, int *err)
284 +       struct inode *ea_inode = NULL;
286 +       ea_inode = ext4_iget(parent->i_sb, ea_ino);
287 +       if (IS_ERR(ea_inode) || is_bad_inode(ea_inode)) {
288 +               int rc = IS_ERR(ea_inode) ? PTR_ERR(ea_inode) : 0;
289 +               ext4_error(parent->i_sb, "error while reading EA inode %lu "
290 +                          "/ %d %d", ea_ino, rc, is_bad_inode(ea_inode));
291 +               *err = rc != 0 ? rc : -EIO;
292 +               return NULL;
293 +       }
295 +       if (EXT4_XATTR_INODE_GET_PARENT(ea_inode) != parent->i_ino ||
296 +           ea_inode->i_generation != parent->i_generation) {
297 +               ext4_error(parent->i_sb, "Backpointer from EA inode %lu "
298 +                          "to parent invalid.", ea_ino);
299 +               *err = -EINVAL;
300 +               goto error;
301 +       }
303 +       if (!(EXT4_I(ea_inode)->i_flags & EXT4_EA_INODE_FL)) {
304 +               ext4_error(parent->i_sb, "EA inode %lu does not have "
305 +                          "EXT4_EA_INODE_FL flag set.\n", ea_ino);
306 +               *err = -EINVAL;
307 +               goto error;
308 +       }
310 +       *err = 0;
311 +       return ea_inode;
313 +error:
314 +       iput(ea_inode);
315 +       return NULL;
319 + * Read the value from the EA inode.
320 + */
321 +static int
322 +ext4_xattr_inode_get(struct inode *inode, unsigned long ea_ino, void *buffer,
323 +                    size_t *size)
325 +       struct inode *ea_inode = NULL;
326 +       int err;
328 +       ea_inode = ext4_xattr_inode_iget(inode, ea_ino, &err);
329 +       if (err)
330 +               return err;
332 +       err = ext4_xattr_inode_read(ea_inode, buffer, size);
333 +       iput(ea_inode);
335 +       return err;
338  static int
339  ext4_xattr_block_get(struct inode *inode, int name_index, const char *name,
340                      void *buffer, size_t buffer_size)
341 @@ -308,8 +400,16 @@ ext4_xattr_block_get(struct inode *inode, int name_index, const char *name,
342                 error = -ERANGE;
343                 if (size > buffer_size)
344                         goto cleanup;
345 -               memcpy(buffer, bh->b_data + le16_to_cpu(entry->e_value_offs),
346 -                      size);
347 +               if (entry->e_value_inum) {
348 +                       error = ext4_xattr_inode_get(inode,
349 +                                            le32_to_cpu(entry->e_value_inum),
350 +                                            buffer, &size);
351 +                       if (error)
352 +                               goto cleanup;
353 +               } else {
354 +                       memcpy(buffer, bh->b_data +
355 +                              le16_to_cpu(entry->e_value_offs), size);
356 +               }
357         }
358         error = size;
360 @@ -350,8 +450,16 @@ ext4_xattr_ibody_get(struct inode *inode, int name_index, const char *name,
361                 error = -ERANGE;
362                 if (size > buffer_size)
363                         goto cleanup;
364 -               memcpy(buffer, (void *)IFIRST(header) +
365 -                      le16_to_cpu(entry->e_value_offs), size);
366 +               if (entry->e_value_inum) {
367 +                       error = ext4_xattr_inode_get(inode,
368 +                                            le32_to_cpu(entry->e_value_inum),
369 +                                            buffer, &size);
370 +                       if (error)
371 +                               goto cleanup;
372 +               } else {
373 +                       memcpy(buffer, (void *)IFIRST(header) +
374 +                              le16_to_cpu(entry->e_value_offs), size);
375 +               }
376         }
377         error = size;
379 @@ -620,7 +728,7 @@ static size_t ext4_xattr_free_space(struct ext4_xattr_entry *last,
380                                     size_t *min_offs, void *base, int *total)
382         for (; !IS_LAST_ENTRY(last); last = EXT4_XATTR_NEXT(last)) {
383 -               if (last->e_value_size) {
384 +               if (!last->e_value_inum && last->e_value_size) {
385                         size_t offs = le16_to_cpu(last->e_value_offs);
386                         if (offs < *min_offs)
387                                 *min_offs = offs;
388 @@ -631,16 +739,173 @@ static size_t ext4_xattr_free_space(struct ext4_xattr_entry *last,
389         return (*min_offs - ((void *)last - base) - sizeof(__u32));
392 -static int
393 -ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s)
395 + * Write the value of the EA in an inode.
396 + */
397 +static int ext4_xattr_inode_write(handle_t *handle, struct inode *ea_inode,
398 +                                 const void *buf, int bufsize)
400 +       struct buffer_head *bh = NULL;
401 +       unsigned long block = 0;
402 +       unsigned blocksize = ea_inode->i_sb->s_blocksize;
403 +       unsigned max_blocks = (bufsize + blocksize - 1) >> ea_inode->i_blkbits;
404 +       int csize, wsize = 0;
405 +       int ret = 0;
406 +       int retries = 0;
408 +retry:
409 +       while (ret >= 0 && ret < max_blocks) {
410 +               struct ext4_map_blocks map;
411 +               map.m_lblk = block += ret;
412 +               map.m_len = max_blocks -= ret;
414 +               ret = ext4_map_blocks(handle, ea_inode, &map,
415 +                                     EXT4_GET_BLOCKS_CREATE);
416 +               if (ret <= 0) {
417 +                       ext4_mark_inode_dirty(handle, ea_inode);
418 +                       if (ret == -ENOSPC &&
419 +                           ext4_should_retry_alloc(ea_inode->i_sb, &retries)) {
420 +                               ret = 0;
421 +                               goto retry;
422 +                       }
423 +                       break;
424 +               }
425 +       }
427 +       if (ret < 0)
428 +               return ret;
430 +       block = 0;
431 +       while (wsize < bufsize) {
432 +               if (bh != NULL)
433 +                       brelse(bh);
434 +               csize = (bufsize - wsize) > blocksize ? blocksize :
435 +                                                               bufsize - wsize;
436 +               bh = ext4_getblk(handle, ea_inode, block, 0);
437 +               if (IS_ERR(bh)) {
438 +                       ret = PTR_ERR(bh);
439 +                       goto out;
440 +               }
441 +               ret = ext4_journal_get_write_access(handle, bh);
442 +               if (ret)
443 +                       goto out;
445 +               memcpy(bh->b_data, buf, csize);
446 +               set_buffer_uptodate(bh);
447 +               ext4_handle_dirty_metadata(handle, ea_inode, bh);
449 +               buf += csize;
450 +               wsize += csize;
451 +               block += 1;
452 +       }
454 +       inode_lock(ea_inode);
455 +       i_size_write(ea_inode, wsize);
456 +       ext4_update_i_disksize(ea_inode, wsize);
457 +       inode_unlock(ea_inode);
459 +       ext4_mark_inode_dirty(handle, ea_inode);
461 +out:
462 +       brelse(bh);
464 +       return ret;
468 + * Create an inode to store the value of a large EA.
469 + */
470 +static struct inode *ext4_xattr_inode_create(handle_t *handle,
471 +                                            struct inode *inode)
473 +       struct inode *ea_inode = NULL;
475 +       /*
476 +        * Let the next inode be the goal, so we try and allocate the EA inode
477 +        * in the same group, or nearby one.
478 +        */
479 +       ea_inode = ext4_new_inode(handle, inode->i_sb->s_root->d_inode,
480 +                                 S_IFREG | 0600, NULL, inode->i_ino + 1, NULL);
481 +       if (!IS_ERR(ea_inode)) {
482 +               ea_inode->i_op = &ext4_file_inode_operations;
483 +               ea_inode->i_fop = &ext4_file_operations;
484 +               ext4_set_aops(ea_inode);
485 +               ea_inode->i_generation = inode->i_generation;
486 +               EXT4_I(ea_inode)->i_flags |= EXT4_EA_INODE_FL;
488 +               /*
489 +                * A back-pointer from EA inode to parent inode will be useful
490 +                * for e2fsck.
491 +                */
492 +               EXT4_XATTR_INODE_SET_PARENT(ea_inode, inode->i_ino);
493 +               unlock_new_inode(ea_inode);
494 +       }
496 +       return ea_inode;
500 + * Unlink the inode storing the value of the EA.
501 + */
502 +int ext4_xattr_inode_unlink(struct inode *inode, unsigned long ea_ino)
504 +       struct inode *ea_inode = NULL;
505 +       int err;
507 +       ea_inode = ext4_xattr_inode_iget(inode, ea_ino, &err);
508 +       if (err)
509 +               return err;
511 +       clear_nlink(ea_inode);
512 +       iput(ea_inode);
514 +       return 0;
518 + * Add value of the EA in an inode.
519 + */
520 +static int ext4_xattr_inode_set(handle_t *handle, struct inode *inode,
521 +                               unsigned long *ea_ino, const void *value,
522 +                               size_t value_len)
524 +       struct inode *ea_inode;
525 +       int err;
527 +       /* Create an inode for the EA value */
528 +       ea_inode = ext4_xattr_inode_create(handle, inode);
529 +       if (IS_ERR(ea_inode))
530 +               return PTR_ERR(ea_inode);
532 +       err = ext4_xattr_inode_write(handle, ea_inode, value, value_len);
533 +       if (err)
534 +               clear_nlink(ea_inode);
535 +       else
536 +               *ea_ino = ea_inode->i_ino;
538 +       iput(ea_inode);
540 +       return err;
543 +static int ext4_xattr_set_entry(struct ext4_xattr_info *i,
544 +                               struct ext4_xattr_search *s,
545 +                               handle_t *handle, struct inode *inode)
547         struct ext4_xattr_entry *last;
548         size_t free, min_offs = s->end - s->base, name_len = strlen(i->name);
549 +       int in_inode = i->in_inode;
550 +       int rc;
552 +       if (ext4_has_feature_ea_inode(inode->i_sb) &&
553 +           (EXT4_XATTR_SIZE(i->value_len) >
554 +            EXT4_XATTR_MIN_LARGE_EA_SIZE(inode->i_sb->s_blocksize)))
555 +               in_inode = 1;
557         /* Compute min_offs and last. */
558         last = s->first;
559         for (; !IS_LAST_ENTRY(last); last = EXT4_XATTR_NEXT(last)) {
560 -               if (last->e_value_size) {
561 +               if (!last->e_value_inum && last->e_value_size) {
562                         size_t offs = le16_to_cpu(last->e_value_offs);
563                         if (offs < min_offs)
564                                 min_offs = offs;
565 @@ -648,15 +913,20 @@ ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s)
566         }
567         free = min_offs - ((void *)last - s->base) - sizeof(__u32);
568         if (!s->not_found) {
569 -               if (s->here->e_value_size) {
570 +               if (!in_inode &&
571 +                   !s->here->e_value_inum && s->here->e_value_size) {
572                         size_t size = le32_to_cpu(s->here->e_value_size);
573                         free += EXT4_XATTR_SIZE(size);
574                 }
575                 free += EXT4_XATTR_LEN(name_len);
576         }
577         if (i->value) {
578 -               if (free < EXT4_XATTR_LEN(name_len) +
579 -                          EXT4_XATTR_SIZE(i->value_len))
580 +               size_t value_len = EXT4_XATTR_SIZE(i->value_len);
582 +               if (in_inode)
583 +                       value_len = 0;
585 +               if (free < EXT4_XATTR_LEN(name_len) + value_len)
586                         return -ENOSPC;
587         }
589 @@ -670,7 +940,8 @@ ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s)
590                 s->here->e_name_len = name_len;
591                 memcpy(s->here->e_name, i->name, name_len);
592         } else {
593 -               if (s->here->e_value_size) {
594 +               if (!s->here->e_value_inum && s->here->e_value_size &&
595 +                   s->here->e_value_offs > 0) {
596                         void *first_val = s->base + min_offs;
597                         size_t offs = le16_to_cpu(s->here->e_value_offs);
598                         void *val = s->base + offs;
599 @@ -704,12 +975,18 @@ ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s)
600                         last = s->first;
601                         while (!IS_LAST_ENTRY(last)) {
602                                 size_t o = le16_to_cpu(last->e_value_offs);
603 -                               if (last->e_value_size && o < offs)
604 +                               if (!last->e_value_inum &&
605 +                                   last->e_value_size && o < offs)
606                                         last->e_value_offs =
607                                                 cpu_to_le16(o + size);
608                                 last = EXT4_XATTR_NEXT(last);
609                         }
610                 }
611 +               if (s->here->e_value_inum) {
612 +                       ext4_xattr_inode_unlink(inode,
613 +                                           le32_to_cpu(s->here->e_value_inum));
614 +                       s->here->e_value_inum = 0;
615 +               }
616                 if (!i->value) {
617                         /* Remove the old name. */
618                         size_t size = EXT4_XATTR_LEN(name_len);
619 @@ -722,11 +999,20 @@ ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s)
621         if (i->value) {
622                 /* Insert the new value. */
623 -               s->here->e_value_size = cpu_to_le32(i->value_len);
624 -               if (i->value_len) {
625 +               if (in_inode) {
626 +                       unsigned long ea_ino =
627 +                               le32_to_cpu(s->here->e_value_inum);
628 +                       rc = ext4_xattr_inode_set(handle, inode, &ea_ino,
629 +                                                 i->value, i->value_len);
630 +                       if (rc)
631 +                               goto out;
632 +                       s->here->e_value_inum = cpu_to_le32(ea_ino);
633 +                       s->here->e_value_offs = 0;
634 +               } else if (i->value_len) {
635                         size_t size = EXT4_XATTR_SIZE(i->value_len);
636                         void *val = s->base + min_offs - size;
637                         s->here->e_value_offs = cpu_to_le16(min_offs - size);
638 +                       s->here->e_value_inum = 0;
639                         if (i->value == EXT4_ZERO_XATTR_VALUE) {
640                                 memset(val, 0, size);
641                         } else {
642 @@ -736,8 +1022,11 @@ ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s)
643                                 memcpy(val, i->value, i->value_len);
644                         }
645                 }
646 +               s->here->e_value_size = cpu_to_le32(i->value_len);
647         }
648 -       return 0;
650 +out:
651 +       return rc;
654  struct ext4_xattr_block_find {
655 @@ -801,8 +1090,6 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
657  #define header(x) ((struct ext4_xattr_header *)(x))
659 -       if (i->value && i->value_len > sb->s_blocksize)
660 -               return -ENOSPC;
661         if (s->base) {
662                 BUFFER_TRACE(bs->bh, "get_write_access");
663                 error = ext4_journal_get_write_access(handle, bs->bh);
664 @@ -821,7 +1108,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
665                         mb_cache_entry_delete_block(ext4_mb_cache, hash,
666                                                     bs->bh->b_blocknr);
667                         ea_bdebug(bs->bh, "modifying in-place");
668 -                       error = ext4_xattr_set_entry(i, s);
669 +                       error = ext4_xattr_set_entry(i, s, handle, inode);
670                         if (!error) {
671                                 if (!IS_LAST_ENTRY(s->first))
672                                         ext4_xattr_rehash(header(s->base),
673 @@ -870,7 +1157,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
674                 s->end = s->base + sb->s_blocksize;
675         }
677 -       error = ext4_xattr_set_entry(i, s);
678 +       error = ext4_xattr_set_entry(i, s, handle, inode);
679         if (error == -EFSCORRUPTED)
680                 goto bad_block;
681         if (error)
682 @@ -1070,7 +1357,7 @@ int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode,
684         if (EXT4_I(inode)->i_extra_isize == 0)
685                 return -ENOSPC;
686 -       error = ext4_xattr_set_entry(i, s);
687 +       error = ext4_xattr_set_entry(i, s, handle, inode);
688         if (error) {
689                 if (error == -ENOSPC &&
690                     ext4_has_inline_data(inode)) {
691 @@ -1082,7 +1369,7 @@ int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode,
692                         error = ext4_xattr_ibody_find(inode, i, is);
693                         if (error)
694                                 return error;
695 -                       error = ext4_xattr_set_entry(i, s);
696 +                       error = ext4_xattr_set_entry(i, s, handle, inode);
697                 }
698                 if (error)
699                         return error;
700 @@ -1098,7 +1385,7 @@ int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode,
701         return 0;
704 -static int ext4_xattr_ibody_set(struct inode *inode,
705 +static int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode,
706                                 struct ext4_xattr_info *i,
707                                 struct ext4_xattr_ibody_find *is)
709 @@ -1108,7 +1395,7 @@ static int ext4_xattr_ibody_set(struct inode *inode,
711         if (EXT4_I(inode)->i_extra_isize == 0)
712                 return -ENOSPC;
713 -       error = ext4_xattr_set_entry(i, s);
714 +       error = ext4_xattr_set_entry(i, s, handle, inode);
715         if (error)
716                 return error;
717         header = IHDR(inode, ext4_raw_inode(&is->iloc));
718 @@ -1155,7 +1442,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
719                 .name = name,
720                 .value = value,
721                 .value_len = value_len,
723 +               .in_inode = 0,
724         };
725         struct ext4_xattr_ibody_find is = {
726                 .s = { .not_found = -ENODATA, },
727 @@ -1204,7 +1491,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
728         }
729         if (!value) {
730                 if (!is.s.not_found)
731 -                       error = ext4_xattr_ibody_set(inode, &i, &is);
732 +                       error = ext4_xattr_ibody_set(handle, inode, &i, &is);
733                 else if (!bs.s.not_found)
734                         error = ext4_xattr_block_set(handle, inode, &i, &bs);
735         } else {
736 @@ -1215,7 +1502,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
737                 if (!bs.s.not_found && ext4_xattr_value_same(&bs.s, &i))
738                         goto cleanup;
740 -               error = ext4_xattr_ibody_set(inode, &i, &is);
741 +               error = ext4_xattr_ibody_set(handle, inode, &i, &is);
742                 if (!error && !bs.s.not_found) {
743                         i.value = NULL;
744                         error = ext4_xattr_block_set(handle, inode, &i, &bs);
745 @@ -1226,11 +1513,20 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
746                                         goto cleanup;
747                         }
748                         error = ext4_xattr_block_set(handle, inode, &i, &bs);
749 +                       if (ext4_has_feature_ea_inode(inode->i_sb) &&
750 +                           error == -ENOSPC) {
751 +                               /* xattr not fit to block, store at external
752 +                                * inode */
753 +                               i.in_inode = 1;
754 +                               error = ext4_xattr_ibody_set(handle, inode,
755 +                                                            &i, &is);
756 +                       }
757                         if (error)
758                                 goto cleanup;
759                         if (!is.s.not_found) {
760                                 i.value = NULL;
761 -                               error = ext4_xattr_ibody_set(inode, &i, &is);
762 +                               error = ext4_xattr_ibody_set(handle, inode, &i,
763 +                                                            &is);
764                         }
765                 }
766         }
767 @@ -1269,12 +1565,26 @@ ext4_xattr_set(struct inode *inode, int name_index, const char *name,
768                const void *value, size_t value_len, int flags)
770         handle_t *handle;
771 +       struct super_block *sb = inode->i_sb;
772         int error, retries = 0;
773         int credits = ext4_jbd2_credits_xattr(inode);
775         error = dquot_initialize(inode);
776         if (error)
777                 return error;
779 +       if ((value_len >= EXT4_XATTR_MIN_LARGE_EA_SIZE(sb->s_blocksize)) &&
780 +           ext4_has_feature_ea_inode(sb)) {
781 +               int nrblocks = (value_len + sb->s_blocksize - 1) >>
782 +                                       sb->s_blocksize_bits;
784 +               /* For new inode */
785 +               credits += EXT4_SINGLEDATA_TRANS_BLOCKS(sb) + 3;
787 +               /* For data blocks of EA inode */
788 +               credits += ext4_meta_trans_blocks(inode, nrblocks, 0);
789 +       }
791  retry:
792         handle = ext4_journal_start(inode, EXT4_HT_XATTR, credits);
793         if (IS_ERR(handle)) {
794 @@ -1286,7 +1596,7 @@ ext4_xattr_set(struct inode *inode, int name_index, const char *name,
795                                               value, value_len, flags);
796                 error2 = ext4_journal_stop(handle);
797                 if (error == -ENOSPC &&
798 -                   ext4_should_retry_alloc(inode->i_sb, &retries))
799 +                   ext4_should_retry_alloc(sb, &retries))
800                         goto retry;
801                 if (error == 0)
802                         error = error2;
803 @@ -1311,7 +1621,7 @@ static void ext4_xattr_shift_entries(struct ext4_xattr_entry *entry,
805         /* Adjust the value offsets of the entries */
806         for (; !IS_LAST_ENTRY(last); last = EXT4_XATTR_NEXT(last)) {
807 -               if (last->e_value_size) {
808 +               if (!last->e_value_inum && last->e_value_size) {
809                         new_offs = le16_to_cpu(last->e_value_offs) +
810                                                         value_offs_shift;
811                         last->e_value_offs = cpu_to_le16(new_offs);
812 @@ -1372,7 +1682,7 @@ static int ext4_xattr_move_to_block(handle_t *handle, struct inode *inode,
813                 goto out;
815         /* Remove the chosen entry from the inode */
816 -       error = ext4_xattr_ibody_set(inode, &i, is);
817 +       error = ext4_xattr_ibody_set(handle, inode, &i, is);
818         if (error)
819                 goto out;
821 @@ -1572,21 +1882,135 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
825 +#define EIA_INCR 16 /* must be 2^n */
826 +#define EIA_MASK (EIA_INCR - 1)
827 +/* Add the large xattr @ino into @lea_ino_array for later deletion.
828 + * If @lea_ino_array is new or full it will be grown and the old
829 + * contents copied over.
830 + */
831 +static int
832 +ext4_expand_ino_array(struct ext4_xattr_ino_array **lea_ino_array, __u32 ino)
834 +       if (*lea_ino_array == NULL) {
835 +               /*
836 +                * Start with 15 inodes, so it fits into a power-of-two size.
837 +                * If *lea_ino_array is NULL, this is essentially offsetof()
838 +                */
839 +               (*lea_ino_array) =
840 +                       kmalloc(offsetof(struct ext4_xattr_ino_array,
841 +                                        xia_inodes[EIA_MASK]),
842 +                               GFP_NOFS);
843 +               if (*lea_ino_array == NULL)
844 +                       return -ENOMEM;
845 +               (*lea_ino_array)->xia_count = 0;
846 +       } else if (((*lea_ino_array)->xia_count & EIA_MASK) == EIA_MASK) {
847 +               /* expand the array once all 15 + n * 16 slots are full */
848 +               struct ext4_xattr_ino_array *new_array = NULL;
849 +               int count = (*lea_ino_array)->xia_count;
851 +               /* if new_array is NULL, this is essentially offsetof() */
852 +               new_array = kmalloc(
853 +                               offsetof(struct ext4_xattr_ino_array,
854 +                                        xia_inodes[count + EIA_INCR]),
855 +                               GFP_NOFS);
856 +               if (new_array == NULL)
857 +                       return -ENOMEM;
858 +               memcpy(new_array, *lea_ino_array,
859 +                      offsetof(struct ext4_xattr_ino_array,
860 +                               xia_inodes[count]));
861 +               kfree(*lea_ino_array);
862 +               *lea_ino_array = new_array;
863 +       }
864 +       (*lea_ino_array)->xia_inodes[(*lea_ino_array)->xia_count++] = ino;
865 +       return 0;
868 +/**
869 + * Add xattr inode to orphan list
870 + */
871 +static int
872 +ext4_xattr_inode_orphan_add(handle_t *handle, struct inode *inode,
873 +                       int credits, struct ext4_xattr_ino_array *lea_ino_array)
875 +       struct inode *ea_inode = NULL;
876 +       int idx = 0, error = 0;
878 +       if (lea_ino_array == NULL)
879 +               return 0;
881 +       for (; idx < lea_ino_array->xia_count; ++idx) {
882 +               if (!ext4_handle_has_enough_credits(handle, credits)) {
883 +                       error = ext4_journal_extend(handle, credits);
884 +                       if (error > 0)
885 +                               error = ext4_journal_restart(handle, credits);
887 +                       if (error != 0) {
888 +                               ext4_warning(inode->i_sb,
889 +                                       "couldn't extend journal "
890 +                                       "(err %d)", error);
891 +                               return error;
892 +                       }
893 +               }
894 +               ea_inode = ext4_xattr_inode_iget(inode,
895 +                               lea_ino_array->xia_inodes[idx], &error);
896 +               if (error)
897 +                       continue;
898 +               ext4_orphan_add(handle, ea_inode);
899 +               /* the inode's i_count will be released by caller */
900 +       }
902 +       return 0;
905  /*
906   * ext4_xattr_delete_inode()
907   *
908 - * Free extended attribute resources associated with this inode. This
909 + * Free extended attribute resources associated with this inode. Traverse
910 + * all entries and unlink any xattr inodes associated with this inode. This
911   * is called immediately before an inode is freed. We have exclusive
912 - * access to the inode.
913 + * access to the inode. If an orphan inode is deleted it will also delete any
914 + * xattr block and all xattr inodes. They are checked by ext4_xattr_inode_iget()
915 + * to ensure they belong to the parent inode and were not deleted already.
916   */
917 -void
918 -ext4_xattr_delete_inode(handle_t *handle, struct inode *inode)
919 +int
920 +ext4_xattr_delete_inode(handle_t *handle, struct inode *inode,
921 +                       struct ext4_xattr_ino_array **lea_ino_array)
923         struct buffer_head *bh = NULL;
924 +       struct ext4_xattr_ibody_header *header;
925 +       struct ext4_inode *raw_inode;
926 +       struct ext4_iloc iloc;
927 +       struct ext4_xattr_entry *entry;
928 +       int credits = 3, error = 0;
930 -       if (!EXT4_I(inode)->i_file_acl)
931 +       if (!ext4_test_inode_state(inode, EXT4_STATE_XATTR))
932 +               goto delete_external_ea;
934 +       error = ext4_get_inode_loc(inode, &iloc);
935 +       if (error)
936 +               goto cleanup;
937 +       raw_inode = ext4_raw_inode(&iloc);
938 +       header = IHDR(inode, raw_inode);
939 +       for (entry = IFIRST(header); !IS_LAST_ENTRY(entry);
940 +            entry = EXT4_XATTR_NEXT(entry)) {
941 +               if (!entry->e_value_inum)
942 +                       continue;
943 +               if (ext4_expand_ino_array(lea_ino_array,
944 +                                         entry->e_value_inum) != 0) {
945 +                       brelse(iloc.bh);
946 +                       goto cleanup;
947 +               }
948 +               entry->e_value_inum = 0;
949 +       }
950 +       brelse(iloc.bh);
952 +delete_external_ea:
953 +       if (!EXT4_I(inode)->i_file_acl) {
954 +               /* add xattr inode to orphan list */
955 +               ext4_xattr_inode_orphan_add(handle, inode, credits,
956 +                                               *lea_ino_array);
957                 goto cleanup;
958 +       }
959         bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
960         if (!bh) {
961                 EXT4_ERROR_INODE(inode, "block %llu read error",
962 @@ -1599,11 +2023,69 @@ ext4_xattr_delete_inode(handle_t *handle, struct inode *inode)
963                                  EXT4_I(inode)->i_file_acl);
964                 goto cleanup;
965         }
967 +       for (entry = BFIRST(bh); !IS_LAST_ENTRY(entry);
968 +            entry = EXT4_XATTR_NEXT(entry)) {
969 +               if (!entry->e_value_inum)
970 +                       continue;
971 +               if (ext4_expand_ino_array(lea_ino_array,
972 +                                         entry->e_value_inum) != 0)
973 +                       goto cleanup;
974 +               entry->e_value_inum = 0;
975 +       }
977 +       /* add xattr inode to orphan list */
978 +       error = ext4_xattr_inode_orphan_add(handle, inode, credits,
979 +                                       *lea_ino_array);
980 +       if (error != 0)
981 +               goto cleanup;
983 +       if (!IS_NOQUOTA(inode))
984 +               credits += 2 * EXT4_QUOTA_DEL_BLOCKS(inode->i_sb);
986 +       if (!ext4_handle_has_enough_credits(handle, credits)) {
987 +               error = ext4_journal_extend(handle, credits);
988 +               if (error > 0)
989 +                       error = ext4_journal_restart(handle, credits);
990 +               if (error != 0) {
991 +                       ext4_warning(inode->i_sb,
992 +                               "couldn't extend journal (err %d)", error);
993 +                       goto cleanup;
994 +               }
995 +       }
997         ext4_xattr_release_block(handle, inode, bh);
998         EXT4_I(inode)->i_file_acl = 0;
1000  cleanup:
1001         brelse(bh);
1003 +       return error;
1006 +void
1007 +ext4_xattr_inode_array_free(struct inode *inode,
1008 +                           struct ext4_xattr_ino_array *lea_ino_array)
1010 +       struct inode    *ea_inode = NULL;
1011 +       int             idx = 0;
1012 +       int             err;
1014 +       if (lea_ino_array == NULL)
1015 +               return;
1017 +       for (; idx < lea_ino_array->xia_count; ++idx) {
1018 +               ea_inode = ext4_xattr_inode_iget(inode,
1019 +                               lea_ino_array->xia_inodes[idx], &err);
1020 +               if (err)
1021 +                       continue;
1022 +               /* for inode's i_count get from ext4_xattr_delete_inode */
1023 +               if (!list_empty(&EXT4_I(ea_inode)->i_orphan))
1024 +                       iput(ea_inode);
1025 +               clear_nlink(ea_inode);
1026 +               iput(ea_inode);
1027 +       }
1028 +       kfree(lea_ino_array);
1031  /*
1032 @@ -1655,10 +2137,9 @@ ext4_xattr_cmp(struct ext4_xattr_header *header1,
1033                     entry1->e_name_index != entry2->e_name_index ||
1034                     entry1->e_name_len != entry2->e_name_len ||
1035                     entry1->e_value_size != entry2->e_value_size ||
1036 +                   entry1->e_value_inum != entry2->e_value_inum ||
1037                     memcmp(entry1->e_name, entry2->e_name, entry1->e_name_len))
1038                         return 1;
1039 -               if (entry1->e_value_block != 0 || entry2->e_value_block != 0)
1040 -                       return -EFSCORRUPTED;
1041                 if (memcmp((char *)header1 + le16_to_cpu(entry1->e_value_offs),
1042                            (char *)header2 + le16_to_cpu(entry2->e_value_offs),
1043                            le32_to_cpu(entry1->e_value_size)))
1044 @@ -1730,7 +2211,7 @@ static inline void ext4_xattr_hash_entry(struct ext4_xattr_header *header,
1045                        *name++;
1046         }
1048 -       if (entry->e_value_size != 0) {
1049 +       if (!entry->e_value_inum && entry->e_value_size) {
1050                 __le32 *value = (__le32 *)((char *)header +
1051                         le16_to_cpu(entry->e_value_offs));
1052                 for (n = (le32_to_cpu(entry->e_value_size) +
1053 diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h
1054 index 099c8b670ef5..6e10ff9393d4 100644
1055 --- a/fs/ext4/xattr.h
1056 +++ b/fs/ext4/xattr.h
1057 @@ -44,7 +44,7 @@ struct ext4_xattr_entry {
1058         __u8    e_name_len;     /* length of name */
1059         __u8    e_name_index;   /* attribute name index */
1060         __le16  e_value_offs;   /* offset in disk block of value */
1061 -       __le32  e_value_block;  /* disk block attribute is stored on (n/i) */
1062 +       __le32  e_value_inum;   /* inode in which the value is stored */
1063         __le32  e_value_size;   /* size of attribute value */
1064         __le32  e_hash;         /* hash value of name and value */
1065         char    e_name[0];      /* attribute name */
1066 @@ -69,6 +69,26 @@ struct ext4_xattr_entry {
1067                 EXT4_I(inode)->i_extra_isize))
1068  #define IFIRST(hdr) ((struct ext4_xattr_entry *)((hdr)+1))
1071 + * Link EA inode back to parent one using i_mtime field.
1072 + * Extra integer type conversion added to ignore higher
1073 + * bits in i_mtime.tv_sec which might be set by ext4_get()
1074 + */
1075 +#define EXT4_XATTR_INODE_SET_PARENT(inode, inum)      \
1076 +do {                                                  \
1077 +      (inode)->i_mtime.tv_sec = inum;                 \
1078 +} while(0)
1080 +#define EXT4_XATTR_INODE_GET_PARENT(inode)            \
1081 +((__u32)(inode)->i_mtime.tv_sec)
1084 + * The minimum size of EA value when you start storing it in an external inode
1085 + * size of block - size of header - size of 1 entry - 4 null bytes
1087 +#define EXT4_XATTR_MIN_LARGE_EA_SIZE(b)                                        \
1088 +       ((b) - EXT4_XATTR_LEN(3) - sizeof(struct ext4_xattr_header) - 4)
1090  #define BHDR(bh) ((struct ext4_xattr_header *)((bh)->b_data))
1091  #define ENTRY(ptr) ((struct ext4_xattr_entry *)(ptr))
1092  #define BFIRST(bh) ENTRY(BHDR(bh)+1)
1093 @@ -77,10 +97,11 @@ struct ext4_xattr_entry {
1094  #define EXT4_ZERO_XATTR_VALUE ((void *)-1)
1096  struct ext4_xattr_info {
1097 -       int name_index;
1098         const char *name;
1099         const void *value;
1100         size_t value_len;
1101 +       int name_index;
1102 +       int in_inode;
1103  };
1105  struct ext4_xattr_search {
1106 @@ -140,7 +161,13 @@ extern int ext4_xattr_get(struct inode *, int, const char *, void *, size_t);
1107  extern int ext4_xattr_set(struct inode *, int, const char *, const void *, size_t, int);
1108  extern int ext4_xattr_set_handle(handle_t *, struct inode *, int, const char *, const void *, size_t, int);
1110 -extern void ext4_xattr_delete_inode(handle_t *, struct inode *);
1111 +extern struct inode *ext4_xattr_inode_iget(struct inode *parent, unsigned long ea_ino,
1112 +                                          int *err);
1113 +extern int ext4_xattr_inode_unlink(struct inode *inode, unsigned long ea_ino);
1114 +extern int ext4_xattr_delete_inode(handle_t *handle, struct inode *inode,
1115 +                                  struct ext4_xattr_ino_array **array);
1116 +extern void ext4_xattr_inode_array_free(struct inode *inode,
1117 +                                       struct ext4_xattr_ino_array *array);
1119  extern int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
1120                             struct ext4_inode *raw_inode, handle_t *handle);
1121 -- 
1122 2.13.1.611.g7e3b11ae1-goog