Patch from Andreas Gruenbacher Tony Dziedzic has found two bugs in the extended attributes code. Patches with explanations are attached. 1: Extended attribute sharing on ext2/ext3 not working The mb_cache_entry_insert function constantly returns an -EBUSY error instead of 0, which causes the xattr cache that is needed by the xattr sharing mechanism on ext2/ext3 to not share anything. This patch fixes the problem. (It is possible that after applying this fix we will hit bugs in code that wasn't used before.) 2: Oops in one of the xattr debug statements: The old_bh variable is NULL if an inode that previously had no EA's assigned would share an EA block with another inode. (This was hidden by the xattr sharing bug). fs/ext2/xattr.c | 2 +- fs/ext3/xattr.c | 2 +- fs/mbcache.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff -puN fs/ext2/xattr.c~xattr-bug-fixes fs/ext2/xattr.c --- 25/fs/ext2/xattr.c~xattr-bug-fixes 2003-03-07 10:26:52.000000000 -0800 +++ 25-akpm/fs/ext2/xattr.c 2003-03-07 10:26:52.000000000 -0800 @@ -731,7 +731,7 @@ ext2_xattr_set2(struct inode *inode, str * The old block will be released after updating * the inode. */ - ea_bdebug(old_bh, "reusing block %ld", + ea_bdebug(new_bh, "reusing block %ld", new_bh->b_blocknr); error = -EDQUOT; diff -puN fs/ext3/xattr.c~xattr-bug-fixes fs/ext3/xattr.c --- 25/fs/ext3/xattr.c~xattr-bug-fixes 2003-03-07 10:26:52.000000000 -0800 +++ 25-akpm/fs/ext3/xattr.c 2003-03-07 10:26:52.000000000 -0800 @@ -732,7 +732,7 @@ ext3_xattr_set_handle2(handle_t *handle, * The old block will be released after updating * the inode. */ - ea_bdebug(old_bh, "reusing block %ld", + ea_bdebug(new_bh, "reusing block %ld", new_bh->b_blocknr); error = -EDQUOT; diff -puN fs/mbcache.c~xattr-bug-fixes fs/mbcache.c --- 25/fs/mbcache.c~xattr-bug-fixes 2003-03-07 10:26:52.000000000 -0800 +++ 25-akpm/fs/mbcache.c 2003-03-07 10:26:52.000000000 -0800 @@ -433,6 +433,7 @@ mb_cache_entry_insert(struct mb_cache_en list_add(&ce->e_indexes[n].o_list, &cache->c_indexes_hash[n][bucket]); } + error = 0; out: spin_unlock(&mb_cache_spinlock); return error; _