diff options
author | Tariq Saeed <tariq.x.saeed@oracle.com> | 2014-04-03 17:47:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 19:20:55 -0400 |
commit | 3ed2be719eb9770139da791342b190b20a7a9270 (patch) | |
tree | 1d8bfe464b454651400aef7158de91ff07cbab3a /fs | |
parent | a35ad97cd48cfab45f4ee5eb0e6f5787a05cab25 (diff) |
ocfs2: allow for more than one data extent when creating xattr
Orabug: 18108070
ocfs2_xattr_extend_allocation() hits panic when creating xattr during
data extent alloc phase. The problem occurs if due to local alloc
fragmentation, clusters are spread over multiple extents. In this case
ocfs2_add_clusters_in_btree() finds no space to store more than one
extent record and therefore fails returning RESTART_META. The situation
is anticipated for xattr update case but not xattr create case. This
fix simply ports that code to create case.
Signed-off-by: Tariq Saeed <tariq.x.saeed@oracle.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/xattr.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 185fa3b7f962..4217fedb2c11 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -3200,8 +3200,15 @@ meta_guess: | |||
3200 | clusters_add += 1; | 3200 | clusters_add += 1; |
3201 | } | 3201 | } |
3202 | } else { | 3202 | } else { |
3203 | meta_add += 1; | ||
3204 | credits += OCFS2_XATTR_BLOCK_CREATE_CREDITS; | 3203 | credits += OCFS2_XATTR_BLOCK_CREATE_CREDITS; |
3204 | if (xi->xi_value_len > OCFS2_XATTR_INLINE_SIZE) { | ||
3205 | struct ocfs2_extent_list *el = &def_xv.xv.xr_list; | ||
3206 | meta_add += ocfs2_extend_meta_needed(el); | ||
3207 | credits += ocfs2_calc_extend_credits(inode->i_sb, | ||
3208 | el); | ||
3209 | } else { | ||
3210 | meta_add += 1; | ||
3211 | } | ||
3205 | } | 3212 | } |
3206 | out: | 3213 | out: |
3207 | if (clusters_need) | 3214 | if (clusters_need) |