From: Petr Vorel <pvorel@suse.cz>
To: Shirisha G <shirisha@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4] Migrating the libhugetlbfs/testcases/truncate.c test
Date: Fri, 22 Mar 2024 07:02:45 +0100 [thread overview]
Message-ID: <20240322060245.GB589958@pevik> (raw)
In-Reply-To: <20240322052812.633953-1-shirisha@linux.ibm.com>
Hi,
> Test Description: Test is used to verify the correct functionality
nit: I would remove "Test Description: " and instead point out the link from
which test originated.
...
> +static void run_test(void)
> +{
> + void *p;
> + volatile unsigned int *q;
> +
> + sigbus_count = 0;
> + test_pass = 0;
> +
> + struct sigaction my_sigaction;
> +
> + my_sigaction.sa_handler = sigbus_handler;
> + p = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED,
> + fd, 0);
> + q = p;
> + *q = 0;
> + SAFE_SIGACTION(SIGBUS, &my_sigaction, NULL);
> + SAFE_FTRUNCATE(fd, 0);
If any of these 2 SAFE_*() fails, we don't call SAFE_MUNMAP(), right?
But at least in hugemmap27.c it's happily ignored, I guess it can stay.
The rest LGTM.
Kind regards,
Petr
> +
> + if (sigsetjmp(sig_escape, 1) == 0)
> + *q;
> + else
> + sigbus_count++;
> +
> + if (sigbus_count != 1)
> + tst_res(TFAIL, "Didn't SIGBUS");
> +
> + if (test_pass == 1)
> + tst_res(TPASS, "Expected SIGBUS triggered");
> +
> + SAFE_MUNMAP(p, hpage_size);
> +}
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-03-22 6:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 5:28 [LTP] [PATCH v4] Migrating the libhugetlbfs/testcases/truncate.c test Shirisha G
2024-03-22 5:41 ` Petr Vorel
2024-03-22 6:02 ` Petr Vorel [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-03-22 5:08 Shirisha G
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=20240322060245.GB589958@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=shirisha@linux.ibm.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).