From: linuxtestproject.agent@gmail.com
To: Pavithra <pavrampu@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] hugetlb/hugeshmget: Add hugeshmget07 to test SHM_HUGETLB with /dev/zero read
Date: Wed, 23 Sep 2026 09:59:09 +0000 [thread overview]
Message-ID: <20260923095909.9312-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260923083300.54026-1-pavrampu@linux.ibm.com>
Hi Pavithra,
On Wed, 23 Sep 2026 14:03:00 +0530, Pavithra <pavrampu@linux.ibm.com> wrote:
> hugetlb/hugeshmget: Add hugeshmget07 to test SHM_HUGETLB with /dev/zero read
>+ zero_fd = SAFE_OPEN("/dev/zero", O_RDONLY);
>+
>+ shmid = SAFE_SHMGET(IPC_PRIVATE, size, SHM_HUGETLB | SHM_R | SHM_W);
>+
>+ shmaddr = SAFE_SHMAT(shmid, 0, SHM_RND);
>+ tst_res(TINFO, "shmaddr: %p", shmaddr);
>+
>+ for (i = 0; i < size; i += hpage_size) {
>+ TST_EXP_VAL(read(zero_fd, shmaddr + i, hpage_size),
>+ (ssize_t)hpage_size);
>+ }
>+
>+ SAFE_CLOSE(zero_fd);
File descriptors must be initialized to -1 and closed in cleanup() with an
fd != -1 guard. If SAFE_SHMGET() or SAFE_SHMAT() aborts, zero_fd is not
closed. Define static int zero_fd = -1 at file scope, open it in setup(),
and close it in cleanup().
>+ SAFE_SHMCTL(shmid, IPC_RMID, NULL);
>+ shmid = -1;
SAFE_SHMCTL() sets shmid to -1 when called with IPC_RMID. The subsequent
shmid = -1 assignment is redundant.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2026-09-23 9:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 8:33 [LTP] [PATCH v8] hugetlb/hugeshmget: Add hugeshmget07 to test SHM_HUGETLB with /dev/zero read Pavithra
2026-09-23 9:59 ` linuxtestproject.agent [this message]
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=20260923095909.9312-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=ltp@lists.linux.it \
--cc=pavrampu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.