[LTP] [PATCH v4] mmap01: Convert to new API

Ricardo B. Marliere rbm@suse.com
Wed Dec 11 11:29:04 CET 2024


Hi Petr!

On 11 Dec 24 02:47, Petr Vorel wrote:
> Hi Ricardo,
> 
> ...
> > +static void run(void)
> >  {
> > +	pid_t pid;
> > +
> > +	addr = SAFE_MMAP(NULL, page_sz, PROT_READ | PROT_WRITE,
> > +			 MAP_FILE | MAP_SHARED, fildes, 0);
> > +
> > +	/*
> > +	 * Check if mapped memory area beyond EOF are zeros and changes beyond
> > +	 * EOF are not written to file.
> > +	 */
> > +	if (memcmp(&addr[file_sz], dummy, page_sz - file_sz))
> > +		tst_brk(TFAIL, "mapped memory area contains invalid data");
> FYI test fails when run more iterations (e.g. -i2)
> 

Thanks for taking a look, but I don't see the issue here:

# /opt/ltp/testcases/bin/mmap01 -i4
tst_tmpdir.c:316: TINFO: Using /tmp/LTP_mmaiVJsAq as tmpdir (fuse filesystem)
tst_test.c:1890: TINFO: LTP version: 20240930-73-g865be36ffce8
tst_test.c:1894: TINFO: Tested kernel: 6.11.0-virtme #1 SMP PREEMPT_DYNAMIC Fri Oct  4 13:39:48 -03 2024 x86_64
tst_test.c:1725: TINFO: Timeout per run is 0h 00m 30s
mmap01.c:49: TPASS: Functionality of mmap() successful YES
mmap01.c:49: TPASS: Functionality of mmap() successful YES
mmap01.c:49: TPASS: Functionality of mmap() successful YES
mmap01.c:49: TPASS: Functionality of mmap() successful YES

Summary:
passed   4
failed   0
broken   0
skipped  0
warnings 0

I appended the "YES" just to make sure I wasn't running some outdated
code, can you please provide more details?


Thanks!
-	Ricardo.

> Kind regards,
> Petr


More information about the ltp mailing list