Commit 3edb027f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] xattr: blockdev inode selection fix

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.
parent 574dd596
......@@ -973,7 +973,8 @@ ext2_xattr_cache_find(struct inode *inode, struct ext2_xattr_header *header)
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 *inode, struct ext2_xattr_header *header)
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;
}
......
......@@ -1010,7 +1010,8 @@ ext3_xattr_cache_find(struct inode *inode, struct ext3_xattr_header *header)
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 *inode, struct ext3_xattr_header *header)
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment