All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH 13/14] lustre: sysfs: temporary work around for sysfs naming
Date: Sun,  6 Jan 2019 16:36:46 -0500	[thread overview]
Message-ID: <1546810607-6348-14-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1546810607-6348-1-git-send-email-jsimmons@infradead.org>

Lustre uses the internal addressing of data structures to name
the sysfs objects. With newer kernels hashing is done on the
data structure addresses to make it harder to bypass address
space randomization. This breaks auto tuning with lustre. The
temporary work around is to use "%px" for the naming just to
make things work again. The long term solution is to move to
proper uuids for the name which is being worked on.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c     | 6 +++---
 drivers/staging/lustre/lustre/mgc/mgc_request.c     | 2 +-
 drivers/staging/lustre/lustre/obdclass/obd_config.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 203a1f7..b258c80 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -959,7 +959,7 @@ int ll_fill_super(struct super_block *sb)
 		len -= 7;
 
 	/* Mount info */
-	snprintf(name, MAX_STRING_SIZE, "%.*s-%p", len,
+	snprintf(name, MAX_STRING_SIZE, "%.*s-%px", len,
 		 lsi->lsi_lmd->lmd_profile, sb);
 
 	/* Call ll_debugsfs_register_super() before lustre_process_log()
@@ -997,13 +997,13 @@ int ll_fill_super(struct super_block *sb)
 	CDEBUG(D_CONFIG, "Found profile %s: mdc=%s osc=%s\n", profilenm,
 	       lprof->lp_md, lprof->lp_dt);
 
-	dt = kasprintf(GFP_NOFS, "%s-%p", lprof->lp_dt, cfg->cfg_instance);
+	dt = kasprintf(GFP_NOFS, "%s-%px", lprof->lp_dt, cfg->cfg_instance);
 	if (!dt) {
 		err = -ENOMEM;
 		goto out_debugfs;
 	}
 
-	md = kasprintf(GFP_NOFS, "%s-%p", lprof->lp_md, cfg->cfg_instance);
+	md = kasprintf(GFP_NOFS, "%s-%px", lprof->lp_md, cfg->cfg_instance);
 	if (!md) {
 		err = -ENOMEM;
 		goto out_debugfs;
diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index a6be2ca..ca74c75 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -1142,7 +1142,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 	if (!inst)
 		return -ENOMEM;
 
-	pos = snprintf(inst, PAGE_SIZE, "%p", cfg->cfg_instance);
+	pos = snprintf(inst, PAGE_SIZE, "%px", cfg->cfg_instance);
 	if (pos >= PAGE_SIZE) {
 		kfree(inst);
 		return -E2BIG;
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index 8be8751..7d00ca4 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -1323,7 +1323,7 @@ int class_config_llog_handler(const struct lu_env *env,
 		    LUSTRE_CFG_BUFLEN(lcfg, 0) > 0) {
 			inst_len = LUSTRE_CFG_BUFLEN(lcfg, 0) +
 				   sizeof(clli->cfg_instance) * 2 + 4;
-			inst_name = kasprintf(GFP_NOFS, "%s-%p",
+			inst_name = kasprintf(GFP_NOFS, "%s-%px",
 					      lustre_cfg_string(lcfg, 0),
 					      clli->cfg_instance);
 			if (!inst_name) {
-- 
1.8.3.1

  parent reply	other threads:[~2019-01-06 21:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-06 21:36 [lustre-devel] [PATCH 00/14] lustre: fixes for many test failures James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 01/14] lustre: llite: Add S_NOSEC support James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 02/14] lustre: llite: change how "dump_page_cache" walks a hash table James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 03/14] lustre: llite: add LL_IOC_FUTIMES_3 James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 04/14] lustre: llite: improve getdirstripe interface James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 05/14] lustre: uapi: fix lustre_user.h to C++ compatible James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 06/14] lustre: uapi: replace cfs_size_* macros with __ALIGN_KERNEL James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 07/14] lustre: uapi: final fixes for UAPI support James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 08/14] lustre: llite: op_data->op_valid is incorrect in ll_dir_getstripe James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 09/14] lustre: llite: return correct amount of bytes for short operations James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 10/14] lustre: llite: user xattr_prefix() to create xattr full name James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 11/14] lustre: llite: conditionally set it_flags in ll_file_open James Simmons
2019-01-06 21:36 ` [lustre-devel] [PATCH 12/14] lustre: llite: fix file migration James Simmons
2019-01-06 21:36 ` James Simmons [this message]
2019-01-06 21:36 ` [lustre-devel] [PATCH 14/14] lustre: libcfs: hide struct cfs_cpt_table internals James Simmons
2019-01-07  5:17 ` [lustre-devel] [PATCH 00/14] lustre: fixes for many test failures NeilBrown
2019-01-07 21:57   ` James Simmons
2019-01-07 23:09     ` NeilBrown

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=1546810607-6348-14-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=lustre-devel@lists.lustre.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.