aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2008-11-19 03:48:42 -0500
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:36:55 -0500
commit9f868f16e40e9ad8e39aebff94a4be0d96520734 (patch)
tree1099a634a2cc283ca523947a816bd746ee3768a9 /fs
parent97aff52ae13d3c11a074bbbfc80ad0b59cb8cdeb (diff)
ocfs2/xattr: Restore not_found in xis
During an 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 value of xis->not_found. xis->not_found is removed by ocfs2_calc_xattr_set_need though, so we must restore it. Signed-off-by: Tao Ma <tao.ma@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/xattr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index d0b94edb9662..9cb71e1c7c60 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -2414,7 +2414,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
2414 struct ocfs2_xattr_search *xbs, 2414 struct ocfs2_xattr_search *xbs,
2415 struct ocfs2_xattr_set_ctxt *ctxt) 2415 struct ocfs2_xattr_set_ctxt *ctxt)
2416{ 2416{
2417 int ret = 0, credits; 2417 int ret = 0, credits, old_found;
2418 2418
2419 if (!xi->value) { 2419 if (!xi->value) {
2420 /* Remove existing extended attribute */ 2420 /* Remove existing extended attribute */
@@ -2433,6 +2433,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
2433 xi->value = NULL; 2433 xi->value = NULL;
2434 xi->value_len = 0; 2434 xi->value_len = 0;
2435 2435
2436 old_found = xis->not_found;
2436 xis->not_found = -ENODATA; 2437 xis->not_found = -ENODATA;
2437 ret = ocfs2_calc_xattr_set_need(inode, 2438 ret = ocfs2_calc_xattr_set_need(inode,
2438 di, 2439 di,
@@ -2442,6 +2443,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
2442 NULL, 2443 NULL,
2443 NULL, 2444 NULL,
2444 &credits); 2445 &credits);
2446 xis->not_found = old_found;
2445 if (ret) { 2447 if (ret) {
2446 mlog_errno(ret); 2448 mlog_errno(ret);
2447 goto out; 2449 goto out;
@@ -2462,6 +2464,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
2462 if (ret) 2464 if (ret)
2463 goto out; 2465 goto out;
2464 2466
2467 old_found = xis->not_found;
2465 xis->not_found = -ENODATA; 2468 xis->not_found = -ENODATA;
2466 ret = ocfs2_calc_xattr_set_need(inode, 2469 ret = ocfs2_calc_xattr_set_need(inode,
2467 di, 2470 di,
@@ -2471,6 +2474,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
2471 NULL, 2474 NULL,
2472 NULL, 2475 NULL,
2473 &credits); 2476 &credits);
2477 xis->not_found = old_found;
2474 if (ret) { 2478 if (ret) {
2475 mlog_errno(ret); 2479 mlog_errno(ret);
2476 goto out; 2480 goto out;