[Ocfs2-test-devel] [PATCH 50/59] discontig-test: fix punch hole

Junxiao Bi junxiao.bi at oracle.com
Wed Sep 23 01:36:38 PDT 2015


On 09/23/2015 03:17 PM, Eric Ren wrote:
> Hi Junxiao,
> 
>> Punch hole test needs reserve some extents block but it run
> Typo "but", you want to use "to let"?
Nice catch. I think the words "it run" should be removed.

Thanks,
Junxiao.
> 
> Anyway, merged. I can adjust after your confirmation.
> 
> Reviewed-by: Eric Ren <zren at suse.com>
> Thanks.
> 
>> when fs is full of fragements and no enough space, and this
>> cause block group allocation fail. Remove some files with xattr
>> and try again.
>>
>> Signed-off-by: Junxiao Bi <junxiao.bi at oracle.com>
>> ---
>>  programs/discontig_bg_test/discontig_runner.sh |   13 +++++++++++--
>>  1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/programs/discontig_bg_test/discontig_runner.sh b/programs/discontig_bg_test/discontig_runner.sh
>> index 0f389a4..a88f83a 100755
>> --- a/programs/discontig_bg_test/discontig_runner.sh
>> +++ b/programs/discontig_bg_test/discontig_runner.sh
>> @@ -485,6 +485,7 @@ function f_extents_test()
>>  
>>  	#use punch_hole to change extent_list then to update
>>  	f_LogMsg ${LOG_FILE} "Update extent blocks by punching holes"
>> +	rm_start=1
>>  	offset=0
>>  	num=0
>>  	count=$((${filesize}/${CLUSTERSIZE}))
>> @@ -496,8 +497,16 @@ function f_extents_test()
>>  	while :;do
>>  		if [ "$((${RANDOM}%2))" -eq "0" ];then
>>  			${PUNCH_HOLE_BIN} -f ${filename} -s ${offset} -l ${CLUSTERSIZE} >>/dev/null 2>&1 || {
>> -				f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed."
>> -				return 1
>> +				if [ $rm_start -ne 10 ]; then
>> +					f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed, rm addup-${rm_start} and try again."
>> +					rm -rf ${WORK_PLACE}/extents_testfile_xattr_addup-${rm_start}*
>> +					sync
>> +					rm_start=$(($rm_start+1))
>> +					continue
>> +				else
>> +					f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed."
>> +					return 1
>> +				fi
>>  			}
>>  		fi
>>  		num=$((${num}+${inc}))
>> -- 
>> 1.7.9.5
>>
>>
>> _______________________________________________
>> Ocfs2-test-devel mailing list
>> Ocfs2-test-devel at oss.oracle.com
>> https://oss.oracle.com/mailman/listinfo/ocfs2-test-devel
>>




More information about the Ocfs2-test-devel mailing list