From: Stephen Hemminger <stephen@networkplumber.org>
To: Sudheendra Sampath <giveback4fun@gmail.com>
Cc: dev@dpdk.org, Anatoly Burakov <anatoly.burakov@intel.com>,
Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Subject: Re: [PATCH] examples: Fix vm_power_manager scratch area to /run/dpdk/powermanager
Date: Thu, 28 May 2026 14:10:16 -0700 [thread overview]
Message-ID: <20260528141016.5470472d@phoenix.local> (raw)
In-Reply-To: <20260528190449.66254-1-giveback4fun@gmail.com>
On Thu, 28 May 2026 19:04:48 +0000
Sudheendra Sampath <giveback4fun@gmail.com> wrote:
> This patch for bug 1832 will do the following:
> 1. If /run/dpdk is not present, it will create it first with and
> then create powermanager directory underneath it.
> 2. If /run/dpdk is present, it will verify it is actually a directory
> before creating subdirectory, powermanager.
>
> All directory permissions are 0700.
>
> Signed-off-by: Sudheendra Sampath <giveback4fun@gmail.com>
> ---
Lots of issues with hardcoding the path here.
Longer explanation from AI review.
Thanks for the patch. A few issues to address before this can be merged:
Two correctness bugs in the new recovery block:
- After creating the directories, d is still NULL but the code falls through to readdir(d). The recovery path must call opendir() again (and return -1 if that also fails) before the readdir loop.
- path_stat is only populated when stat() succeeds. The S_ISDIR(path_stat.st_mode) check runs on uninitialised memory when stat() returned an error and mkdir() was used. Restructure as if (stat(...) == 0) { check S_ISDIR } else { mkdir }.
Other items:
- doc/guides/sample_app_ug/vm_power_management.rst still references /tmp/powermonitor/ in several places; code and docs need to change together.
- Hardcoding /run/dpdk does not follow the DPDK runtime-dir convention and breaks non-root usage.
Please consider using rte_eal_get_runtime_dir() (or at least the same getuid() / RUNTIME_DIRECTORY logic as eal_create_runtime_dir()) instead.
- Subject says "powermanager" but the path is "powermonitor".
- The two new RTE_LOG messages are missing trailing "\n".
- Please add a proper Fixes: tag (12-char hash) for the commit that introduced /tmp/powermonitor.
Stephen
next prev parent reply other threads:[~2026-05-28 21:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 19:04 [PATCH] examples: Fix vm_power_manager scratch area to /run/dpdk/powermanager Sudheendra Sampath
2026-05-28 21:10 ` Stephen Hemminger [this message]
2026-05-29 8:01 ` Bruce Richardson
2026-05-29 15:23 ` Stephen Hemminger
2026-05-29 16:01 ` Bruce Richardson
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=20260528141016.5470472d@phoenix.local \
--to=stephen@networkplumber.org \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=giveback4fun@gmail.com \
--cc=sivaprasad.tummala@amd.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