]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Tao Ma <tao.ma@oracle.com> |
2 | Date: Wed, 12 Nov 2008 08:26:57 +0800 | |
3 | Subject: ocfs2/xattr: Only extend xattr bucket in need. | |
4 | Patch-mainline: 2.6.29 | |
5 | ||
6 | When the first block of a bucket is filled up with xattr | |
7 | entries, we normally extend the bucket. But if we are | |
8 | just replace one xattr with small length, we don't need | |
9 | to extend it. This is important since we will calculate | |
10 | what we need before the transaction and in this situation | |
11 | no resources will be allocated. | |
12 | ||
13 | Signed-off-by: Tao Ma <tao.ma@oracle.com> | |
14 | Signed-off-by: Mark Fasheh <mfasheh@suse.com> | |
15 | --- | |
16 | fs/ocfs2/xattr.c | 4 +++- | |
17 | 1 files changed, 3 insertions(+), 1 deletions(-) | |
18 | ||
19 | diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c | |
20 | index d8fc714..4501c63 100644 | |
21 | --- a/fs/ocfs2/xattr.c | |
22 | +++ b/fs/ocfs2/xattr.c | |
23 | @@ -4564,7 +4564,9 @@ try_again: | |
24 | free, need, max_free, le16_to_cpu(xh->xh_free_start), | |
25 | le16_to_cpu(xh->xh_name_value_len)); | |
26 | ||
27 | - if (free < need || count == ocfs2_xattr_max_xe_in_bucket(inode->i_sb)) { | |
28 | + if (free < need || | |
29 | + (xs->not_found && | |
30 | + count == ocfs2_xattr_max_xe_in_bucket(inode->i_sb))) { | |
31 | if (need <= max_free && | |
32 | count < ocfs2_xattr_max_xe_in_bucket(inode->i_sb)) { | |
33 | /* | |
34 | -- | |
35 | 1.5.6 | |
36 |