From: Balbir Singh <bsingharora@gmail.com>
To: Leo Yan <leo.yan@linaro.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Leon Romanovsky <leon@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Mike Leach <mike.leach@linaro.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jan Harkes <jaharkes@cs.cmu.edu>,
coda@cs.cmu.edu, Paul Moore <paul@paul-moore.com>,
Eric Paris <eparis@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
codalist@coda.cs.cmu.edu, linux-audit@redhat.com
Subject: Re: [PATCH v2 3/7] coresight: etm4x: Use task_is_in_init_pid_ns()
Date: Tue, 14 Dec 2021 16:54:35 +1100 [thread overview]
Message-ID: <Ybgxm6o+yLhP+f6L@balbir-desktop> (raw)
In-Reply-To: <20211208083320.472503-4-leo.yan@linaro.org>
On Wed, Dec 08, 2021 at 04:33:16PM +0800, Leo Yan wrote:
> This patch replaces open code with task_is_in_init_pid_ns() to check if
> a task is in root PID namespace.
>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
> drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
> index a0640fa5c55b..10ef2a29006e 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
> @@ -1890,7 +1890,7 @@ static ssize_t ctxid_pid_show(struct device *dev,
> * Don't use contextID tracing if coming from a PID namespace. See
> * comment in ctxid_pid_store().
> */
> - if (task_active_pid_ns(current) != &init_pid_ns)
> + if (!task_is_in_init_pid_ns(current))
> return -EINVAL;
>
> spin_lock(&drvdata->spinlock);
> @@ -1918,7 +1918,7 @@ static ssize_t ctxid_pid_store(struct device *dev,
> * As such refuse to use the feature if @current is not in the initial
> * PID namespace.
> */
> - if (task_active_pid_ns(current) != &init_pid_ns)
> + if (!task_is_in_init_pid_ns(current))
> return -EINVAL;
>
> /*
> @@ -1951,7 +1951,7 @@ static ssize_t ctxid_masks_show(struct device *dev,
> * Don't use contextID tracing if coming from a PID namespace. See
> * comment in ctxid_pid_store().
> */
> - if (task_active_pid_ns(current) != &init_pid_ns)
> + if (!task_is_in_init_pid_ns(current))
> return -EINVAL;
>
> spin_lock(&drvdata->spinlock);
> @@ -1975,7 +1975,7 @@ static ssize_t ctxid_masks_store(struct device *dev,
> * Don't use contextID tracing if coming from a PID namespace. See
> * comment in ctxid_pid_store().
> */
> - if (task_active_pid_ns(current) != &init_pid_ns)
> + if (!task_is_in_init_pid_ns(current))
> return -EINVAL;
>
> /*
Acked-by: Balbir Singh <bsingharora@gmail.com>
next prev parent reply other threads:[~2021-12-14 5:54 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 8:33 [PATCH v2 0/7] pid: Introduce helper task_is_in_root_ns() Leo Yan
2021-12-08 8:33 ` [PATCH v2 1/7] pid: Introduce helper task_is_in_init_pid_ns() Leo Yan
2021-12-08 9:28 ` Leon Romanovsky
2021-12-08 10:25 ` Suzuki K Poulose
2021-12-14 5:55 ` Balbir Singh
2021-12-08 8:33 ` [PATCH v2 2/7] coresight: etm3x: Use task_is_in_init_pid_ns() Leo Yan
2021-12-08 10:26 ` Suzuki K Poulose
2021-12-14 5:55 ` Balbir Singh
2021-12-08 8:33 ` [PATCH v2 3/7] coresight: etm4x: " Leo Yan
2021-12-08 10:26 ` Suzuki K Poulose
2021-12-14 5:54 ` Balbir Singh [this message]
2021-12-08 8:33 ` [PATCH v2 4/7] connector/cn_proc: " Leo Yan
2021-12-14 5:58 ` Balbir Singh
2021-12-14 7:05 ` Leo Yan
2021-12-08 8:33 ` [PATCH v2 5/7] coda: " Leo Yan
2021-12-08 8:33 ` [PATCH v2 6/7] audit: " Leo Yan
2021-12-14 5:56 ` Balbir Singh
2021-12-14 22:35 ` Paul Moore
2021-12-15 19:09 ` Richard Guy Briggs
2021-12-16 1:09 ` Leo Yan
2021-12-08 8:33 ` [PATCH v2 7/7] taskstats: " Leo Yan
2021-12-14 5:56 ` Balbir Singh
2022-01-12 6:40 ` [PATCH v2 0/7] pid: Introduce helper task_is_in_root_ns() Leo Yan
2022-01-24 9:29 ` Leo Yan
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=Ybgxm6o+yLhP+f6L@balbir-desktop \
--to=bsingharora@gmail.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=coda@cs.cmu.edu \
--cc=codalist@coda.cs.cmu.edu \
--cc=coresight@lists.linaro.org \
--cc=davem@davemloft.net \
--cc=eparis@redhat.com \
--cc=jaharkes@cs.cmu.edu \
--cc=kuba@kernel.org \
--cc=leo.yan@linaro.org \
--cc=leon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-audit@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=suzuki.poulose@arm.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 NNTP newsgroup(s).