Whamcloud - gitweb
b=20581 MDS returns full hash for readdir to decrease hash collision
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-ea-expand-lose-block.patch
1 Date: Mon, 12 May 2008 11:24:40 +0800
2 From: Tiger Yang <tiger.yang@oracle.com>
3 Subject: [PATCH] ext3/4: fix uninitialized bs in ext3/4_xattr_set_handle()
4 To: linux-ext4@vger.kernel.org
5 Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
6
7 This fix the uninitialized bs when we try to replace a xattr entry in ibody
8 with the new value which require more than free space.
9
10 Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
11
12
13 diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
14 --- a/fs/ext3/xattr.c
15 +++ b/fs/ext3/xattr.c
16 @@ -1000,6 +1000,11 @@ ext3_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
17                         i.value = NULL;
18                         error = ext3_xattr_block_set(handle, inode, &i, &bs);
19                 } else if (error == -ENOSPC) {
20 +                       if (EXT3_I(inode)->i_file_acl && !bs.s.base) {
21 +                               error = ext3_xattr_block_find(inode, &i, &bs);
22 +                               if (error)
23 +                                       goto cleanup;
24 +                       }
25                         error = ext3_xattr_block_set(handle, inode, &i, &bs);
26                         if (error)
27                                 goto cleanup;