summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.c
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2008-11-19 09:48:41 +0100
committerMark Fasheh <mfasheh@suse.com>2009-01-05 17:36:55 +0100
commit97aff52ae13d3c11a074bbbfc80ad0b59cb8cdeb (patch)
tree2ac3992a8dfe6c7b94653f47548975503c3998f4 /fs/ocfs2/xattr.c
parentocfs2: Remove JBD compatibility layer (diff)
downloadlinux-97aff52ae13d3c11a074bbbfc80ad0b59cb8cdeb.tar.xz
linux-97aff52ae13d3c11a074bbbfc80ad0b59cb8cdeb.zip
ocfs2/xattr: Fix a bug in xattr allocation estimation
When we extend one xattr's value to a large size, the old value size might be smaller than the size of a value root. In those cases, 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> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to '')
-rw-r--r--fs/ocfs2/xattr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 8af29b3bd6de..d0b94edb9662 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 {
/*