[LTP] [PATCH] kernel/device-drivers/zram/zram01.sh : add a sync

Martin Doucha mdoucha@suse.cz
Thu Aug 3 12:59:25 CEST 2023


On 03. 08. 23 12:52, Cyril Hrubis wrote:
> Hi!
>> diff --git a/testcases/kernel/device-drivers/zram/zram01.sh b/testcases/kernel/device-drivers/zram/zram01.sh
>> index 58d233f91..5f3964f6c 100755
>> --- a/testcases/kernel/device-drivers/zram/zram01.sh
>> +++ b/testcases/kernel/device-drivers/zram/zram01.sh
>> @@ -119,6 +119,9 @@ zram_fill_fs()
>>   				>/dev/null 2>err.txt || break
>>   			b=$(($b + 1))
>>   		done
>> +                # Give the system time to catch up, otherwise the mm_stat
>> +                # checking below can give a false negative
>> +		sync
> 
> I guess that the files written by the dd above end up in page cache and
> are not written out until much later. Does it fix the problem if you add
> fdatasync to the dd commandline? That should be faster than using the
> big hammer and sysncing the whole system.

This is actually a kernel bug reported upstream:
https://lore.kernel.org/linux-block/20221107191136.18048-1-pvorel@suse.cz/

Not only the test files stay in page cache, but the whole VFAT 
superblock seems to disappear from the device as well until sync.

-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic



More information about the ltp mailing list