All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] allow for more than one data extent when creating xattr
@ 2014-03-10 21:08 Tariq Saeed
  2014-03-10 21:59 ` Srinivas Eeda
  2014-03-12 21:37 ` Andrew Morton
  0 siblings, 2 replies; 3+ messages in thread
From: Tariq Saeed @ 2014-03-10 21:08 UTC (permalink / raw
  To: ocfs2-devel

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>
---
 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 5b8d944..bfa1c37 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -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)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH] allow for more than one data extent when creating xattr
  2014-03-10 21:08 [Ocfs2-devel] [PATCH] allow for more than one data extent when creating xattr Tariq Saeed
@ 2014-03-10 21:59 ` Srinivas Eeda
  2014-03-12 21:37 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Eeda @ 2014-03-10 21:59 UTC (permalink / raw
  To: ocfs2-devel

looks good to me.
Reviewed-by: Srinivas Eeda <srinivas.eeda@oracle.com>

On 03/10/2014 02:08 PM, Tariq Saeed 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 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>
> ---
>   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 5b8d944..bfa1c37 100644
> --- a/fs/ocfs2/xattr.c
> +++ b/fs/ocfs2/xattr.c
> @@ -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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH] allow for more than one data extent when creating xattr
  2014-03-10 21:08 [Ocfs2-devel] [PATCH] allow for more than one data extent when creating xattr Tariq Saeed
  2014-03-10 21:59 ` Srinivas Eeda
@ 2014-03-12 21:37 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2014-03-12 21:37 UTC (permalink / raw
  To: ocfs2-devel

On Mon, 10 Mar 2014 14:08:20 -0700 Tariq Saeed <tariq.x.saeed@oracle.com> 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 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>
> ---
>  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 5b8d944..bfa1c37 100644
> --- a/fs/ocfs2/xattr.c
> +++ b/fs/ocfs2/xattr.c
> @@ -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;
> +		}

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-12 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10 21:08 [Ocfs2-devel] [PATCH] allow for more than one data extent when creating xattr Tariq Saeed
2014-03-10 21:59 ` Srinivas Eeda
2014-03-12 21:37 ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.