From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] msync04.c: Use direct IO to verify the data is stored on disk
Date: Fri, 14 Jun 2024 17:28:43 +0200 [thread overview]
Message-ID: <Zmxhq-efWMJa5a-2@rei> (raw)
In-Reply-To: <20240614125116.GA197913@pevik>
Hi!
> > +static void verify_mmaped(void)
> > +{
> > + char *buffer = SAFE_MEMALIGN(getpagesize(), getpagesize());
> > +
> > + tst_res(TINFO, "Haven't seen dirty bit so we check content of file instead");
> > + test_fd = SAFE_OPEN("msync04/testfile", O_RDONLY | O_DIRECT);
> If this fails we have memory leak, because free() is not run.
>
> > + SAFE_READ(0, test_fd, buffer, getpagesize());
> Also here. Maybe create buf as static and have conditional free() also at the
> cleanup?
If these fail we exit the test, which frees memory anyways...
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-06-14 15:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-30 4:40 [LTP] [PATCH v1] msync04.c: Use direct IO to verify the data is stored on disk Wei Gao via ltp
2024-05-30 8:39 ` Jan Kara
2024-06-13 8:31 ` Cyril Hrubis
2024-06-13 23:20 ` [LTP] [PATCH v2] " Wei Gao via ltp
2024-06-14 12:51 ` Petr Vorel
2024-06-14 15:28 ` Cyril Hrubis [this message]
2024-06-17 12:13 ` Petr Vorel
2024-06-17 10:13 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zmxhq-efWMJa5a-2@rei \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox