allow for more than one data extent when creating xattr
PATCH 1/1 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.
--- fs/ocfs2/xattr.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
fs/ocfs2/xattr.c +8 -1
@@ -3207,8 +3207,15 @@ meta_guess: clusters_add +=1 ; } }else { - meta_add +=1 ; credits +=OCFS2_XATTR_BLOCK_CREATE_CREDITS ; +if (xi->xi_value_len >OCFS2_XATTR_INLINE_SIZE ) { +struct ocfs2_extent_list *el = &def_xv.xv.xr_list; + meta_add +=ocfs2_extend_meta_needed (el); + credits +=ocfs2_calc_extend_credits (inode->i_sb, + el,1 ); + }else { + meta_add +=1 ; + } } out:if (clusters_need)
Signature · 1 line
1.7.1
PATCH 1/1 allow for more than one data extent when creating xattr
looks good to me.
Quoted 36 lines · Tariq Saeed
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 caseocfs2_add_clusters_in_btree()finds no space to store more than one extent record and therefore fails returningRESTART_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 <[email protected]>--- fs/ocfs2/xattr.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)fs/ocfs2/xattr.c +8
-1@@ -3207,8 +3207,15 @@ meta_guess: clusters_add +=1 ; } }else { - meta_add +=1 ; credits +=OCFS2_XATTR_BLOCK_CREATE_CREDITS ; +if (xi->xi_value_len >OCFS2_XATTR_INLINE_SIZE ) { +struct ocfs2_extent_list *el = &def_xv.xv.xr_list; + meta_add +=ocfs2_extend_meta_needed (el); + credits +=ocfs2_calc_extend_credits (inode->i_sb, + el,1 ); + }else { + meta_add +=1 ; + } } out:if (clusters_need)
PATCH 1/1 allow for more than one data extent when creating xattr
In reply to Tariq SaeedQuoted 23 lines · On Mon, 10 Mar 2014 14:08:20 -0700 Tariq Saeed <[email protected]> wrote:
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 caseocfs2_add_clusters_in_btree()finds no space to store more than one extent record and therefore fails returningRESTART_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 <[email protected]>--- fs/ocfs2/xattr.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)fs/ocfs2/xattr.c +0
-0@@ -3207,8 +3207,15 @@ meta_guess: clusters_add +=1 ; } }else {
fs/ocfs2/xattr.c meta_guess: · line 3218
Quoted 10 lines
fs/ocfs2/xattr.c +8
-1- meta_add +=1 ; credits +=OCFS2_XATTR_BLOCK_CREATE_CREDITS ; +if (xi->xi_value_len >OCFS2_XATTR_INLINE_SIZE ) { +struct ocfs2_extent_list *el = &def_xv.xv.xr_list; + meta_add +=ocfs2_extend_meta_needed (el); + credits +=ocfs2_calc_extend_credits (inode->i_sb, + el,1 ); + }else { + meta_add +=1 ; + }
fs/ocfs2/xattr.c: In function 'ocfs2_calc_xattr_set_need':fs/ocfs2/xattr.c:3208: error: too many arguments to function 'ocfs2_calc_extend_credits'
I could just remove the arg, but something has obviously gone wrong with testing here so I'll drop the patch.