mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xiaochen Shen <xiaochen.shen@intel.com>
To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	hpa@zytor.com, tony.luck@intel.com, fenghua.yu@intel.com,
	reinette.chatre@intel.com
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	pei.p.jia@intel.com, xiaochen.shen@intel.com
Subject: [PATCH 4/4] x86/resctrl: Clean up unused function parameter in mkdir path
Date: Thu,  9 Jan 2020 00:28:06 +0800	[thread overview]
Message-ID: <1578500886-21771-5-git-send-email-xiaochen.shen@intel.com> (raw)
In-Reply-To: <1578500886-21771-1-git-send-email-xiaochen.shen@intel.com>

Previous patch ("x86/resctrl: Fix a deadlock due to inaccurate
active reference of kernfs node") changed the argument to
rdtgroup_kn_lock_live()/rdtgroup_kn_unlock() within mkdir_rdt_prepare().
That change resulted in an unused function parameter to
mkdir_rdt_prepare().

Clean up unused function parameter in mkdir_rdt_prepare() and its
callers rdtgroup_mkdir_mon() and rdtgroup_mkdir_ctrl_mon().

Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
---
 arch/x86/kernel/cpu/resctrl/rdtgroup.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 2c79fcd83271..8ebef16e10be 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -2648,7 +2648,6 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp)
 }
 
 static int mkdir_rdt_prepare(struct kernfs_node *parent_kn,
-			     struct kernfs_node *prgrp_kn,
 			     const char *name, umode_t mode,
 			     enum rdt_group_type rtype, struct rdtgroup **r)
 {
@@ -2758,15 +2757,12 @@ static void mkdir_rdt_prepare_clean(struct rdtgroup *rgrp)
  * to monitor a subset of tasks and cpus in its parent ctrl_mon group.
  */
 static int rdtgroup_mkdir_mon(struct kernfs_node *parent_kn,
-			      struct kernfs_node *prgrp_kn,
-			      const char *name,
-			      umode_t mode)
+			      const char *name, umode_t mode)
 {
 	struct rdtgroup *rdtgrp, *prgrp;
 	int ret;
 
-	ret = mkdir_rdt_prepare(parent_kn, prgrp_kn, name, mode, RDTMON_GROUP,
-				&rdtgrp);
+	ret = mkdir_rdt_prepare(parent_kn, name, mode, RDTMON_GROUP, &rdtgrp);
 	if (ret)
 		return ret;
 
@@ -2788,7 +2784,6 @@ static int rdtgroup_mkdir_mon(struct kernfs_node *parent_kn,
  * to allocate and monitor resources.
  */
 static int rdtgroup_mkdir_ctrl_mon(struct kernfs_node *parent_kn,
-				   struct kernfs_node *prgrp_kn,
 				   const char *name, umode_t mode)
 {
 	struct rdtgroup *rdtgrp;
@@ -2796,8 +2791,7 @@ static int rdtgroup_mkdir_ctrl_mon(struct kernfs_node *parent_kn,
 	u32 closid;
 	int ret;
 
-	ret = mkdir_rdt_prepare(parent_kn, prgrp_kn, name, mode, RDTCTRL_GROUP,
-				&rdtgrp);
+	ret = mkdir_rdt_prepare(parent_kn, name, mode, RDTCTRL_GROUP, &rdtgrp);
 	if (ret)
 		return ret;
 
@@ -2871,14 +2865,14 @@ static int rdtgroup_mkdir(struct kernfs_node *parent_kn, const char *name,
 	 * subdirectory
 	 */
 	if (rdt_alloc_capable && parent_kn == rdtgroup_default.kn)
-		return rdtgroup_mkdir_ctrl_mon(parent_kn, parent_kn, name, mode);
+		return rdtgroup_mkdir_ctrl_mon(parent_kn, name, mode);
 
 	/*
 	 * If RDT monitoring is supported and the parent directory is a valid
 	 * "mon_groups" directory, add a monitoring subdirectory.
 	 */
 	if (rdt_mon_capable && is_mon_groups(parent_kn, name))
-		return rdtgroup_mkdir_mon(parent_kn, parent_kn->parent, name, mode);
+		return rdtgroup_mkdir_mon(parent_kn, name, mode);
 
 	return -EPERM;
 }
-- 
1.8.3.1


  parent reply	other threads:[~2020-01-08 15:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 16:28 [PATCH 0/4] Fix use-after-free and deadlock issues Xiaochen Shen
2020-01-08 16:28 ` [PATCH 1/4] x86/resctrl: Fix use-after-free when deleting resource groups Xiaochen Shen
     [not found]   ` <20200109143629.C6C822077B@mail.kernel.org>
2020-01-14  8:51     ` Xiaochen Shen
2020-01-20 16:47   ` [tip: x86/urgent] " tip-bot2 for Xiaochen Shen
2020-01-08 16:28 ` [PATCH 2/4] x86/resctrl: Fix use-after-free due to inaccurate refcount of rdtgroup Xiaochen Shen
     [not found]   ` <20200109143631.EF0A42077C@mail.kernel.org>
2020-01-14  9:13     ` Xiaochen Shen
2020-01-20 16:47   ` [tip: x86/urgent] " tip-bot2 for Xiaochen Shen
2020-01-08 16:28 ` [PATCH 3/4] x86/resctrl: Fix a deadlock due to inaccurate active reference of kernfs node Xiaochen Shen
     [not found]   ` <20200109143630.DD673206ED@mail.kernel.org>
2020-01-14  9:17     ` Xiaochen Shen
2020-01-20 16:47   ` [tip: x86/urgent] x86/resctrl: Fix a deadlock due to inaccurate reference tip-bot2 for Xiaochen Shen
2020-01-08 16:28 ` Xiaochen Shen [this message]
2020-01-20 16:47   ` [tip: x86/urgent] x86/resctrl: Clean up unused function parameter in mkdir path tip-bot2 for Xiaochen Shen
2020-02-01 21:59 ` [PATCH 4.14 1/3] x86/resctrl: Fix use-after-free when deleting resource groups Xiaochen Shen
2020-02-01 22:00 ` [PATCH 4.14 2/3] x86/resctrl: Fix use-after-free due to inaccurate refcount of rdtgroup Xiaochen Shen
2020-02-01 22:00 ` [PATCH 4.14 3/3] x86/resctrl: Fix a deadlock due to inaccurate reference Xiaochen Shen
2020-02-01 22:02 ` [PATCH 4.19 1/3] x86/resctrl: Fix use-after-free when deleting resource groups Xiaochen Shen
2020-02-02 21:56   ` Sasha Levin
2020-02-01 22:03 ` [PATCH 4.19 2/3] x86/resctrl: Fix use-after-free due to inaccurate refcount of rdtgroup Xiaochen Shen
2020-02-01 22:04 ` [PATCH 4.19 3/3] x86/resctrl: Fix a deadlock due to inaccurate reference Xiaochen Shen

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=1578500886-21771-5-git-send-email-xiaochen.shen@intel.com \
    --to=xiaochen.shen@intel.com \
    --cc=bp@alien8.de \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pei.p.jia@intel.com \
    --cc=reinette.chatre@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®