@@ -3118,7 +3118,7 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
struct ocfs2_group_desc *group;
struct buffer_head *group_bh = NULL;
u64 bg_blkno;
- int status;
+ int status, quiet = 0, released;
trace_ocfs2_test_suballoc_bit((unsigned long long)blkno,
(unsigned int)bit);
@@ -3134,11 +3134,15 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
bg_blkno = group_blkno ? group_blkno :
ocfs2_which_suballoc_group(blkno, bit);
- status = ocfs2_read_group_descriptor(suballoc, alloc_di, bg_blkno,
- &group_bh);
- if (status < 0) {
+ status = ocfs2_read_hint_group_descriptor(suballoc, alloc_di, bg_blkno,
+ &group_bh, &released);
+ if (released) {
+ quiet = 1;
+ status = -EINVAL;
+ goto bail;
+ } else if (status < 0) {
mlog(ML_ERROR, "read group %llu failed %d\n",
- (unsigned long long)bg_blkno, status);
+ (unsigned long long)bg_blkno, status);
goto bail;
}
@@ -3148,7 +3152,7 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
bail:
brelse(group_bh);
- if (status)
+ if (status && (!quiet))
mlog_errno(status);
return status;
}
@@ -3168,7 +3172,7 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
*/
int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res)
{
- int status;
+ int status, quiet = 0;
u64 group_blkno = 0;
u16 suballoc_bit = 0, suballoc_slot = 0;
struct inode *inode_alloc_inode;
@@ -3210,8 +3214,12 @@ int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res)
status = ocfs2_test_suballoc_bit(osb, inode_alloc_inode, alloc_bh,
group_blkno, blkno, suballoc_bit, res);
- if (status < 0)
- mlog(ML_ERROR, "test suballoc bit failed %d\n", status);
+ if (status < 0) {
+ if (status == -EINVAL)
+ quiet = 1;
+ else
+ mlog(ML_ERROR, "test suballoc bit failed %d\n", status);
+ }
ocfs2_inode_unlock(inode_alloc_inode, 0);
inode_unlock(inode_alloc_inode);
@@ -3219,7 +3227,7 @@ int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res)
iput(inode_alloc_inode);
brelse(alloc_bh);
bail:
- if (status)
+ if (status && !quiet)
mlog_errno(status);
return status;
}