Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: tongzhiwei <tongzhiwei@cmss.chinamobile.com>,
	"Nhat Pham" <nphamcs@gmail.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Shuah Khan" <shuah@kernel.org>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] selftests/cachestat: clean up the mmap test scratch file
Date: Fri, 27 Nov 2026 01:19:03 +0000	[thread overview]
Message-ID: <sashiko-outbox-236393@kernel.org> (raw)
In-Reply-To: <20261126011818.417-1-tongzhiwei@cmss.chinamobile.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/cachestat: missing Fixes trailer for commit
  d6a511dea45c
--

commit 6dca73321f87a5ea6aa466ecc90a54514aa6c780
Author: tongzhiwei <tongzhiwei@cmss.chinamobile.com>

> selftests/cachestat: clean up the mmap test scratch file
>
> NOTE: This fix is found and coded by llm, but it has been
> reviewed by human.
>
> run_cachestat_test() creates its FILE_MMAP scratch file with open() but
> cleans it up with shm_unlink(), which only removes a POSIX shared-memory
> object under /dev/shm.  The regular file "tmpshmcstat" is therefore left
> behind in the working directory after every run.
>
> The leftover file was previously worked around by adding its name to
> .gitignore in commit b90cafb43887 ("selftests/cachestat: add
> tmpshmcstat file to .gitignore"); the entry remains as a safety net
> for runs interrupted mid-test, but the test itself should not leave
> the file behind in the first place.
>
> Use remove() for the mmap case and keep shm_unlink() for the FILE_SHMEM
> case only, matching the cleanup the sibling test_cachestat() helper
> already does for its own temp file.
>
> Remove the file unconditionally, by design: the name "tmpshmcstat" is
> test-specific so a real collision is implausible, and gating removal on
> whether this run created the file would preserve stale files left by a
> crashed previous run instead of cleaning them up.
>
> Assisted-by: LLM
> Signed-off-by: tongzhiwei <tongzhiwei@cmss.chinamobile.com>

[Severity: Low]
This fixes the FILE_MMAP cleanup introduced when test_cachestat_shmem()
was refactored into run_cachestat_test().  Should this include:

  Fixes: d6a511dea45c ("selftests: cachestat: add tests for mmap, refactor and enhance mmap test for cachestat validation")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126011818.417-1-tongzhiwei@cmss.chinamobile.com?part=1


      reply	other threads:[~2026-11-27  1:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  1:18 [PATCH] selftests/cachestat: clean up the mmap test scratch file tongzhiwei
2026-11-27  1:19 ` sashiko-bot [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=sashiko-outbox-236393@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shuah@kernel.org \
    --cc=tongzhiwei@cmss.chinamobile.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