[Ocfs2-devel] [PATCH 1/1] OCFS2: anti stale inode for nfs (V5)

Wengang Wang wen.gang.wang at oracle.com
Sun Mar 1 18:16:00 PST 2009


> 
>> +	bg_blkno = ocfs2_which_suballoc_group(blkno, bit);
>> +	status = ocfs2_read_group_descriptor(suballoc, alloc_fe, bg_blkno,
>> +					     &group_bh);
>> +	if (status < 0) {
>> +		mlog(ML_ERROR, "read group %llu failed %d\n", bg_blkno, status);
>> +		goto bail;
>> +	}
>> +
>> +	status = ocfs2_check_group_descriptor(osb->sb, alloc_fe, group_bh);
>> +	if (status < 0) {
>> +		mlog(ML_ERROR, "check group %llu faild %d\n", bg_blkno, status);
>> +		goto bail;
>> +	}
> 
> 	The call to ocfs2_read_group_descriptor() already does the same
> checkin as ocfs2_check_group_descriptor(), so you don't need to call
> ocfs2_check_group_descriptor().  

ah, yes.  I only verified that ocfs2_check_group_descriptor() is not 
called in ocfs2_read_group_descriptor(). but didn't notice the same 
contents are done in ocfs2_read_group_descriptor() as well.
will repost as V6.

> 	Other than that, I think this patch is done!  Do you have a test
> to test it?

I tested against V4 which checks group without sub allocator cluster 
lock taken.
the test case is:
1) 2 nodes env
2) each node exports ocfs2 fs(/wwg-ocfs2_test).
3) each node does the script:

OCFS2_TOP=/wwg-ocfs2-test
TOP_DIR=/ocfs2-export
write_thread()
{
         while [ 1 ] ; do
                 host=`/bin/hostname`
                 /bin/rm -rf $TOP_DIR/$host
                 /bin/mkdir $TOP_DIR/$host
                 /bin/cp -r /usr/share $TOP_DIR/$host/
         done
}

mkdir $OCFS2_TOP $TOP_DIR
mount -L ocfs2_anti_stale $OCFS2_TOP
mount -o nordirplus 127.0.0.1:/${OCFS2_TOP} ${TOP_DIR}
write_thread&
while [ 1 ]; do
         ls -lR $TOP_DIR >/dev/null 2>&1
done


is it enough?

regards,
wengang.



More information about the Ocfs2-devel mailing list