
From: Andreas Gruenbacher <agruen@suse.de>

The inode->i_bdev field is not the same as inode->i_sb->s_bdev or bh->b_bdev.
We must compare inode->i_sb->s_bdev with bh->b_bdev, or else equal extended
attribute block will not be found.



 fs/ext2/xattr.c |    5 +++--
 fs/ext3/xattr.c |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff -puN fs/ext2/xattr.c~xattr-sharing fs/ext2/xattr.c
--- 25/fs/ext2/xattr.c~xattr-sharing	2003-07-02 16:37:20.000000000 -0700
+++ 25-akpm/fs/ext2/xattr.c	2003-07-02 16:37:20.000000000 -0700
@@ -973,7 +973,8 @@ ext2_xattr_cache_find(struct inode *inod
 	if (!header->h_hash)
 		return NULL;  /* never share */
 	ea_idebug(inode, "looking for cached blocks [%x]", (int)hash);
-	ce = mb_cache_entry_find_first(ext2_xattr_cache, 0, inode->i_bdev, hash);
+	ce = mb_cache_entry_find_first(ext2_xattr_cache, 0,
+				       inode->i_sb->s_bdev, hash);
 	while (ce) {
 		struct buffer_head *bh = sb_bread(inode->i_sb, ce->e_block);
 
@@ -993,7 +994,7 @@ ext2_xattr_cache_find(struct inode *inod
 			return bh;
 		}
 		brelse(bh);
-		ce = mb_cache_entry_find_next(ce, 0, inode->i_bdev, hash);
+		ce = mb_cache_entry_find_next(ce, 0, inode->i_sb->s_bdev, hash);
 	}
 	return NULL;
 }
diff -puN fs/ext3/xattr.c~xattr-sharing fs/ext3/xattr.c
--- 25/fs/ext3/xattr.c~xattr-sharing	2003-07-02 16:37:20.000000000 -0700
+++ 25-akpm/fs/ext3/xattr.c	2003-07-02 16:37:20.000000000 -0700
@@ -1010,7 +1010,8 @@ ext3_xattr_cache_find(struct inode *inod
 	if (!header->h_hash)
 		return NULL;  /* never share */
 	ea_idebug(inode, "looking for cached blocks [%x]", (int)hash);
-	ce = mb_cache_entry_find_first(ext3_xattr_cache, 0, inode->i_bdev, hash);
+	ce = mb_cache_entry_find_first(ext3_xattr_cache, 0,
+				       inode->i_sb->s_bdev, hash);
 	while (ce) {
 		struct buffer_head *bh = sb_bread(inode->i_sb, ce->e_block);
 
@@ -1030,7 +1031,7 @@ ext3_xattr_cache_find(struct inode *inod
 			return bh;
 		}
 		brelse(bh);
-		ce = mb_cache_entry_find_next(ce, 0, inode->i_bdev, hash);
+		ce = mb_cache_entry_find_next(ce, 0, inode->i_sb->s_bdev, hash);
 	}
 	return NULL;
 }

_
