char *profilenm = get_profile_name(sb);
struct config_llog_instance *cfg;
/* %p for void* in printf needs 16+2 characters: 0xffffffffffffffff */
- const int instlen = sizeof(cfg->cfg_instance) * 2 + 2;
+ const int instlen = 16 + 2;
+ unsigned long cfg_instance = ll_get_cfg_instance(sb);
char name[MAX_STRING_SIZE];
int md_len = 0;
int dt_len = 0;
int err;
ENTRY;
- CDEBUG(D_VFSTRACE, "VFS Op: sb %p\n", sb);
+ /* for ASLR, to map between cfg_instance and hashed ptr */
+ CDEBUG(D_VFSTRACE, "VFS Op: cfg_instance %s-%016lx (sb %p)\n",
+ profilenm, cfg_instance, sb);
try_module_get(THIS_MODULE);
if (err)
GOTO(out_free_cfg, err);
- err = super_setup_bdi_name(sb, "lustre-%p", sb);
+ err = super_setup_bdi_name(sb, "lustre-%016lx", cfg_instance);
if (err)
GOTO(out_free_cfg, err);
sb->s_d_op = &ll_d_ops;
#endif
/* Get fsname */
- len = strlen(lsi->lsi_lmd->lmd_profile);
- ptr = strrchr(lsi->lsi_lmd->lmd_profile, '-');
+ len = strlen(profilenm);
+ ptr = strrchr(profilenm, '-');
if (ptr && (strcmp(ptr, "-client") == 0))
len -= 7;
/* Mount info */
- snprintf(name, MAX_STRING_SIZE, "%.*s-%p", len,
- lsi->lsi_lmd->lmd_profile, sb);
+ snprintf(name, MAX_STRING_SIZE, "%.*s-%016lx", len,
+ profilenm, cfg_instance);
/* Call ll_debugfs_register_super() before lustre_process_log()
* so that "llite.*.*" params can be processed correctly.
err = 0;
}
- /* Generate a string unique to this super, in case some joker tries
- * to mount the same fs at two mount points.
- * Use the address of the super itself.
+ /* The cfg_instance is a value unique to this super, in case some
+ * joker tries to mount the same fs at two mount points.
*/
- cfg->cfg_instance = sb;
+ cfg->cfg_instance = cfg_instance;
cfg->cfg_uuid = lsi->lsi_llsbi->ll_sb_uuid;
cfg->cfg_callback = class_config_llog_handler;
cfg->cfg_sub_clds = CONFIG_SUB_CLIENT;
OBD_ALLOC(dt, dt_len);
if (!dt)
GOTO(out_profile, err = -ENOMEM);
- snprintf(dt, dt_len - 1, "%s-%p", lprof->lp_dt, cfg->cfg_instance);
+ snprintf(dt, dt_len - 1, "%s-%016lx", lprof->lp_dt, cfg_instance);
md_len = strlen(lprof->lp_md) + instlen + 2;
OBD_ALLOC(md, md_len);
if (!md)
GOTO(out_free_dt, err = -ENOMEM);
- snprintf(md, md_len - 1, "%s-%p", lprof->lp_md, cfg->cfg_instance);
+ snprintf(md, md_len - 1, "%s-%016lx", lprof->lp_md, cfg_instance);
/* connections, registrations, sb setup */
err = client_common_fill_super(sb, md, dt, mnt);
void ll_put_super(struct super_block *sb)
{
struct config_llog_instance cfg, params_cfg;
- struct obd_device *obd;
- struct lustre_sb_info *lsi = s2lsi(sb);
- struct ll_sb_info *sbi = ll_s2sbi(sb);
- char *profilenm = get_profile_name(sb);
+ struct obd_device *obd;
+ struct lustre_sb_info *lsi = s2lsi(sb);
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+ char *profilenm = get_profile_name(sb);
+ unsigned long cfg_instance = ll_get_cfg_instance(sb);
long ccc_count;
int next, force = 1, rc = 0;
- ENTRY;
+ ENTRY;
if (!sbi)
GOTO(out_no_sbi, 0);
- CDEBUG(D_VFSTRACE, "VFS Op: sb %p - %s\n", sb, profilenm);
+ /* Should replace instance_id with something better for ASLR */
+ CDEBUG(D_VFSTRACE, "VFS Op: cfg_instance %s-%016lx (sb %p)\n",
+ profilenm, cfg_instance, sb);
- cfg.cfg_instance = sb;
- lustre_end_log(sb, profilenm, &cfg);
+ cfg.cfg_instance = cfg_instance;
+ lustre_end_log(sb, profilenm, &cfg);
- params_cfg.cfg_instance = sb;
+ params_cfg.cfg_instance = cfg_instance;
lustre_end_log(sb, PARAMS_FILENAME, ¶ms_cfg);
if (sbi->ll_md_exp) {
if (force == 0 && rc != -EINTR)
LASSERTF(ccc_count == 0, "count: %li\n", ccc_count);
-
/* We need to set force before the lov_disconnect in
lustre_common_put_super, since l_d cleans up osc's as well. */
if (force) {