[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f65cf3ae-069d-4ade-9fc9-03f01c7e1649@acm.org>
Date: Wed, 10 Sep 2025 14:46:21 -0700
From: Bart Van Assche <bvanassche@....org>
To: Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
Amir Goldstein <amir73il@...il.com>, linux-fsdevel@...r.kernel.org
Cc: Josef Bacik <josef@...icpanda.com>, Jeff Layton <jlayton@...nel.org>,
Mike Yuan <me@...dnzj.com>, Zbigniew Jędrzejewski-Szmek
<zbyszek@...waw.pl>, Lennart Poettering <mzxreary@...inter.de>,
Daan De Meyer <daan.j.demeyer@...il.com>, Aleksa Sarai <cyphar@...har.com>,
Alexander Viro <viro@...iv.linux.org.uk>, Jens Axboe <axboe@...nel.dk>,
Tejun Heo <tj@...nel.org>, Johannes Weiner <hannes@...xchg.org>,
Michal Koutný <mkoutny@...e.com>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Chuck Lever <chuck.lever@...cle.com>, linux-nfs@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH 32/32] selftests/namespaces: add file handle selftests
On 9/10/25 7:37 AM, Christian Brauner wrote:
> + snprintf(ns_path, sizeof(ns_path), "/proc/self/ns/net");
> + ns_fd = open(ns_path, O_RDONLY);
Here and also in TEST(nsfs_uts_handle), ns_path is not modified. Does
this mean that "/proc/self/ns/net" can be stored in a static const char
array and also that the snprintf() call can be left out? In case I would
have missed the reason why the path is copied, how about using
asprintf() or strdup() instead of snprintf()?
Thanks,
Bart.
Powered by blists - more mailing lists