* [Ocfs2-devel] [PATCH] ocfs2/xattr: Fix a bug in xattr allocation guess.
2008-11-19 8:52 [Ocfs2-devel] [PATCH 0/2] 2 bug fix for xattr set transaction merge Tao Ma
@ 2008-11-19 8:48 ` Tao Ma
2008-11-19 8:48 ` [Ocfs2-devel] [PATCH] ocfs2/xattr: Restore not_found in xis Tao Ma
2008-11-19 23:32 ` [Ocfs2-devel] [PATCH 0/2] 2 bug fix for xattr set transaction merge Mark Fasheh
1 sibling, 1 reply; 5+ messages in thread
From: Tao Ma @ 2008-11-19 8:48 UTC (permalink / raw)
To: ocfs2-devel
When we extend one xattr's value to a large size, in case
the old value size is smaller than the size of value root,
we still need to guess the metadata allocation.
Reported-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Tao Ma <tao.ma@oracle.com>
---
fs/ocfs2/xattr.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 8195450..1504c6b 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -2270,6 +2270,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
value_size);
xv = (struct ocfs2_xattr_value_root *)
(base + name_offset + name_len);
+ value_size = OCFS2_XATTR_ROOT_SIZE;
} else
xv = &def_xv.xv;
@@ -2283,7 +2284,8 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
&xv->xr_list,
new_clusters -
old_clusters);
- goto out;
+ if (value_size >= OCFS2_XATTR_ROOT_SIZE)
+ goto out;
}
} else {
/*
--
1.5.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2/xattr: Restore not_found in xis.
2008-11-19 8:48 ` [Ocfs2-devel] [PATCH] ocfs2/xattr: Fix a bug in xattr allocation guess Tao Ma
@ 2008-11-19 8:48 ` Tao Ma
2008-11-19 14:25 ` Tiger Yang
0 siblings, 1 reply; 5+ messages in thread
From: Tao Ma @ 2008-11-19 8:48 UTC (permalink / raw)
To: ocfs2-devel
In xattr set, when we move a xattr which was stored in inode to
the outside bucket, we have to delete it and it will use the old
"xis->not_found", but it is removed by the ocfs2_calc_xattr_set_need.
So restore it.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
---
fs/ocfs2/xattr.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 1504c6b..7d6307f 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -2414,7 +2414,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
struct ocfs2_xattr_search *xbs,
struct ocfs2_xattr_set_ctxt *ctxt)
{
- int ret = 0, credits;
+ int ret = 0, credits, old_found;
if (!xi->value) {
/* Remove existing extended attribute */
@@ -2433,6 +2433,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
xi->value = NULL;
xi->value_len = 0;
+ old_found = xis->not_found;
xis->not_found = -ENODATA;
ret = ocfs2_calc_xattr_set_need(inode,
di,
@@ -2442,6 +2443,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
NULL,
NULL,
&credits);
+ xis->not_found = old_found;
if (ret) {
mlog_errno(ret);
goto out;
@@ -2462,6 +2464,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
if (ret)
goto out;
+ old_found = xis->not_found;
xis->not_found = -ENODATA;
ret = ocfs2_calc_xattr_set_need(inode,
di,
@@ -2471,6 +2474,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
NULL,
NULL,
&credits);
+ xis->not_found = old_found;
if (ret) {
mlog_errno(ret);
goto out;
--
1.5.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Ocfs2-devel] [PATCH 0/2] 2 bug fix for xattr set transaction merge.
@ 2008-11-19 8:52 Tao Ma
2008-11-19 8:48 ` [Ocfs2-devel] [PATCH] ocfs2/xattr: Fix a bug in xattr allocation guess Tao Ma
2008-11-19 23:32 ` [Ocfs2-devel] [PATCH 0/2] 2 bug fix for xattr set transaction merge Mark Fasheh
0 siblings, 2 replies; 5+ messages in thread
From: Tao Ma @ 2008-11-19 8:52 UTC (permalink / raw)
To: ocfs2-devel
Hi Mark,
The 2 patches are 2 bug fix for my xattr set transaction merge patches.
I don't know why tristan's powerful xattr test can't find it, and I will
ask him to include the test case in it. The good news is that the merge
patch set is still in your merge_window, so the bug fixes are not too
late. They are both straightforward, so please push them to your
merge_window.
Regards,
Tao
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2/xattr: Restore not_found in xis.
2008-11-19 8:48 ` [Ocfs2-devel] [PATCH] ocfs2/xattr: Restore not_found in xis Tao Ma
@ 2008-11-19 14:25 ` Tiger Yang
0 siblings, 0 replies; 5+ messages in thread
From: Tiger Yang @ 2008-11-19 14:25 UTC (permalink / raw)
To: ocfs2-devel
how quickly you solve this problem! I also found this problem with my
test script but forgot to tell you when you address the first problem.
thanks,
tiger
Tao Ma wrote:
> In xattr set, when we move a xattr which was stored in inode to
> the outside bucket, we have to delete it and it will use the old
> "xis->not_found", but it is removed by the ocfs2_calc_xattr_set_need.
> So restore it.
>
> Signed-off-by: Tao Ma <tao.ma@oracle.com>
> ---
> fs/ocfs2/xattr.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
> index 1504c6b..7d6307f 100644
> --- a/fs/ocfs2/xattr.c
> +++ b/fs/ocfs2/xattr.c
> @@ -2414,7 +2414,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
> struct ocfs2_xattr_search *xbs,
> struct ocfs2_xattr_set_ctxt *ctxt)
> {
> - int ret = 0, credits;
> + int ret = 0, credits, old_found;
>
> if (!xi->value) {
> /* Remove existing extended attribute */
> @@ -2433,6 +2433,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
> xi->value = NULL;
> xi->value_len = 0;
>
> + old_found = xis->not_found;
> xis->not_found = -ENODATA;
> ret = ocfs2_calc_xattr_set_need(inode,
> di,
> @@ -2442,6 +2443,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
> NULL,
> NULL,
> &credits);
> + xis->not_found = old_found;
> if (ret) {
> mlog_errno(ret);
> goto out;
> @@ -2462,6 +2464,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
> if (ret)
> goto out;
>
> + old_found = xis->not_found;
> xis->not_found = -ENODATA;
> ret = ocfs2_calc_xattr_set_need(inode,
> di,
> @@ -2471,6 +2474,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
> NULL,
> NULL,
> &credits);
> + xis->not_found = old_found;
> if (ret) {
> mlog_errno(ret);
> goto out;
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Ocfs2-devel] [PATCH 0/2] 2 bug fix for xattr set transaction merge.
2008-11-19 8:52 [Ocfs2-devel] [PATCH 0/2] 2 bug fix for xattr set transaction merge Tao Ma
2008-11-19 8:48 ` [Ocfs2-devel] [PATCH] ocfs2/xattr: Fix a bug in xattr allocation guess Tao Ma
@ 2008-11-19 23:32 ` Mark Fasheh
1 sibling, 0 replies; 5+ messages in thread
From: Mark Fasheh @ 2008-11-19 23:32 UTC (permalink / raw)
To: ocfs2-devel
On Wed, Nov 19, 2008 at 04:52:53PM +0800, Tao Ma wrote:
> Hi Mark,
> The 2 patches are 2 bug fix for my xattr set transaction merge
> patches. I don't know why tristan's powerful xattr test can't find it, and
> I will ask him to include the test case in it. The good news is that the
> merge patch set is still in your merge_window, so the bug fixes are not too
> late. They are both straightforward, so please push them to your
> merge_window.
Yep, looks good. They're in merge_window now.
--Mark
--
Mark Fasheh
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-11-19 23:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-19 8:52 [Ocfs2-devel] [PATCH 0/2] 2 bug fix for xattr set transaction merge Tao Ma
2008-11-19 8:48 ` [Ocfs2-devel] [PATCH] ocfs2/xattr: Fix a bug in xattr allocation guess Tao Ma
2008-11-19 8:48 ` [Ocfs2-devel] [PATCH] ocfs2/xattr: Restore not_found in xis Tao Ma
2008-11-19 14:25 ` Tiger Yang
2008-11-19 23:32 ` [Ocfs2-devel] [PATCH 0/2] 2 bug fix for xattr set transaction merge Mark Fasheh
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.