diff options
author | Tao Ma <tao.ma@oracle.com> | 2008-11-19 03:48:41 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:36:55 -0500 |
commit | 97aff52ae13d3c11a074bbbfc80ad0b59cb8cdeb (patch) | |
tree | 2ac3992a8dfe6c7b94653f47548975503c3998f4 /fs/ocfs2 | |
parent | 53ef99cad9878f02f27bb30bc304fc42af8bdd6e (diff) |
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 'fs/ocfs2')
-rw-r--r-- | 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 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, | |||
2270 | value_size); | 2270 | value_size); |
2271 | xv = (struct ocfs2_xattr_value_root *) | 2271 | xv = (struct ocfs2_xattr_value_root *) |
2272 | (base + name_offset + name_len); | 2272 | (base + name_offset + name_len); |
2273 | value_size = OCFS2_XATTR_ROOT_SIZE; | ||
2273 | } else | 2274 | } else |
2274 | xv = &def_xv.xv; | 2275 | xv = &def_xv.xv; |
2275 | 2276 | ||
@@ -2283,7 +2284,8 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode, | |||
2283 | &xv->xr_list, | 2284 | &xv->xr_list, |
2284 | new_clusters - | 2285 | new_clusters - |
2285 | old_clusters); | 2286 | old_clusters); |
2286 | goto out; | 2287 | if (value_size >= OCFS2_XATTR_ROOT_SIZE) |
2288 | goto out; | ||
2287 | } | 2289 | } |
2288 | } else { | 2290 | } else { |
2289 | /* | 2291 | /* |