Whamcloud - gitweb
LU-16314 llite: Migrate LASSERTF %p to %px 13/51213/8
authorShaun Tancheff <shaun.tancheff@hpe.com>
Tue, 6 Jun 2023 03:44:53 +0000 (10:44 +0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Feb 2024 07:05:09 +0000 (07:05 +0000)
This change covers lustre/ec through lustre/mgs and
converts LASSERTF statements to explicitly use %px.

Use %px to explicitly report the non-hashed pointer value
messages printed when a kernel panic is imminent. When
analyzing a crash dump the associated kernel address can
be used to determine the system state that lead to the
system crash.

As crash dumps can and are provided by customers from
production systems the use of the kernel command line
parameter:
    no_hash_pointers
is not always possible.

Ref: Documentation/core-api/printk-formats.rst

Test-Parameters: trivial
HPE-bug-id: LUS-10945
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I708d9ef60c63f5b4006c7986599a2f39fc9e5fdf
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51213
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
13 files changed:
lustre/include/lustre_export.h
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_request.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/llite/rw.c
lustre/llite/vvp_io.c
lustre/lmv/lmv_obd.c
lustre/lod/lod_dev.c
lustre/mdc/mdc_dev.c
lustre/mdc/mdc_locks.c
lustre/mdc/mdc_request.c
lustre/mdt/mdt_open.c

index de7efa7..8da3d57 100644 (file)
@@ -157,16 +157,14 @@ struct nid_stat {
                                                       exp_nid_stats */
 };
 
-#define nidstat_getref(nidstat)                                                \
-do {                                                                           \
-       atomic_inc(&(nidstat)->nid_exp_ref_count);                         \
-} while(0)
-
-#define nidstat_putref(nidstat)                                                \
-do {                                                                           \
-       atomic_dec(&(nidstat)->nid_exp_ref_count);                         \
-       LASSERTF(atomic_read(&(nidstat)->nid_exp_ref_count) >= 0,          \
-                "stat %p nid_exp_ref_count < 0\n", nidstat);                  \
+#define nidstat_getref(nidstat)        \
+       atomic_inc(&(nidstat)->nid_exp_ref_count)
+
+#define nidstat_putref(nidstat)                                                \
+do {                                                                   \
+       atomic_dec(&(nidstat)->nid_exp_ref_count);                      \
+       LASSERTF(atomic_read(&(nidstat)->nid_exp_ref_count) >= 0,       \
+                "stat %px nid_exp_ref_count < 0\n", nidstat);          \
 } while(0)
 
 enum obd_option {
index fabb82d..20985bd 100644 (file)
@@ -1562,7 +1562,7 @@ out:
 
 retry:
                        buf = req_capsule_server_get(pill, &RMF_DLM_LVB);
-                       LASSERTF(buf != NULL, "req %p, lock %p\n", req, lock);
+                       LASSERTF(buf != NULL, "req %px, lock %px\n", req, lock);
                        buflen = req_capsule_get_size(pill, &RMF_DLM_LVB,
                                                      RCL_SERVER);
                        /*
index 6fea124..e51cd98 100644 (file)
@@ -2469,7 +2469,7 @@ static int ldlm_chain_lock_for_replay(struct ldlm_lock *lock, void *closure)
 
        /* we use l_pending_chain here, because it's unused on clients. */
        LASSERTF(list_empty(&lock->l_pending_chain),
-                "lock %p next %p prev %p\n",
+                "lock %px next %px prev %px\n",
                 lock, &lock->l_pending_chain.next,
                 &lock->l_pending_chain.prev);
        /*
index dcc8a93..10c03f3 100644 (file)
@@ -1012,7 +1012,7 @@ restart:
                        GOTO(out_och_free, rc);
 
                LASSERTF(it_disposition(it, DISP_ENQ_OPEN_REF),
-                        "inode %p: disposition %x, status %d\n", inode,
+                        "inode %px: disposition %x, status %d\n", inode,
                         it_disposition(it, ~0), it->it_status);
 
                rc = ll_local_open(file, it, fd, *och_p);
index 7580a4c..c1253dd 100644 (file)
@@ -2811,8 +2811,7 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
                /* FID shouldn't be changed! */
                if (fid_is_sane(&lli->lli_fid)) {
                        LASSERTF(lu_fid_eq(&lli->lli_fid, &body->mbo_fid1),
-                                "Trying to change FID "DFID
-                                " to the "DFID", inode "DFID"(%p)\n",
+                                "Trying to change FID "DFID" to the "DFID", inode "DFID"(%px)\n",
                                 PFID(&lli->lli_fid), PFID(&body->mbo_fid1),
                                 PFID(ll_inode2fid(inode)), inode);
                } else {
@@ -3040,7 +3039,7 @@ void ll_truncate_inode_pages_final(struct inode *inode)
        unsigned long flags;
 
        LASSERTF((inode->i_state & I_FREEING) || inode_is_locked(inode),
-                DFID ":inode %p state %#lx, lli_flags %#lx\n",
+                DFID ":inode %px state %#lx, lli_flags %#lx\n",
                 PFID(ll_inode2fid(inode)), inode, inode->i_state,
                 ll_i2info(inode)->lli_flags);
 
@@ -3089,7 +3088,7 @@ void ll_truncate_inode_pages_final(struct inode *inode)
                        LASSERTF(!PageUptodate(page) &&
                                 !PageDirty(page) &&
                                 !PagePrivate(page),
-                                "%p", page);
+                                "%px", page);
                }
                rcu_read_unlock();
 #endif
index 616b18a..c85b99b 100644 (file)
@@ -473,7 +473,7 @@ ll_read_ahead_pages(const struct lu_env *env, struct cl_io *io,
                                       page_idx, ra.cra_end_idx,
                                       ra.cra_rpc_pages);
                                LASSERTF(ra.cra_end_idx >= page_idx,
-                                        "object: %p, indcies %lu / %lu\n",
+                                        "object: %px, indcies %lu / %lu\n",
                                         io->ci_obj, ra.cra_end_idx, page_idx);
                                /* update read ahead RPC size.
                                 * NB: it's racy but doesn't matter */
index d07fefc..71c14ca 100644 (file)
@@ -1056,7 +1056,7 @@ static void vvp_set_pagevec_dirty(struct pagevec *pvec)
 
        BUILD_BUG_ON(PAGEVEC_SIZE > BITS_PER_LONG);
        LASSERTF(page->mapping,
-                "mapping must be set. page %p, page->private (cl_page) %p\n",
+                "mapping must be set. page %px, page->private (cl_page) %px\n",
                 page, (void *) page->private);
 
        /*
@@ -1107,7 +1107,7 @@ static void vvp_set_pagevec_dirty(struct pagevec *pvec)
                        continue;
 
                LASSERTF(page->mapping == mapping,
-                        "all pages must have the same mapping.  page %p, mapping %p, first mapping %p\n",
+                        "all pages must have the same mapping.  page %px, mapping %px, first mapping %px\n",
                         page, page->mapping, mapping);
                WARN_ON_ONCE(!PagePrivate(page) && !PageUptodate(page));
                ll_account_page_dirtied(page, mapping);
index 3ede80c..f88cb73 100644 (file)
@@ -2801,7 +2801,7 @@ static struct lu_dirent *stripe_dirent_load(struct lmv_dir_ctxt *ctxt,
 
                        /* @hash should be the last dirent hash */
                        LASSERTF(hash <= end,
-                                "ctxt@%p stripe@%p hash %llx end %llx\n",
+                                "ctxt@%px stripe@%px hash %llx end %llx\n",
                                 ctxt, stripe, hash, end);
                        /* unload last page */
                        stripe_dirent_unload(stripe);
index d6afa30..5354cfa 100644 (file)
@@ -2168,7 +2168,7 @@ static struct lu_device *lod_device_free(const struct lu_env *env,
                lu_site_print(env, lu->ld_site, &lu->ld_ref, D_ERROR,
                              lu_cdebug_printer);
        }
-       LASSERTF(atomic_read(&lu->ld_ref) == 0, "lu is %p\n", lu);
+       LASSERTF(atomic_read(&lu->ld_ref) == 0, "lu is %px\n", lu);
        dt_device_fini(&lod->lod_dt_dev);
        OBD_FREE_PTR(lod);
        RETURN(next);
index b4ad623..cef8fdb 100644 (file)
@@ -667,7 +667,7 @@ static int mdc_enqueue_interpret(const struct lu_env *env,
         * be valid. */
        lock = ldlm_handle2lock(lockh);
        LASSERTF(lock != NULL,
-                "lockh %#llx, req %p, aa %p - client evicted?\n",
+                "lockh %#llx, req %px, aa %px - client evicted?\n",
                 lockh->cookie, req, aa);
 
        /* Take an additional reference so that a blocking AST that
@@ -870,7 +870,7 @@ static int mdc_lock_enqueue(const struct lu_env *env,
        ENTRY;
 
        LASSERTF(ergo(oscl->ols_glimpse, lock->cll_descr.cld_mode <= CLM_READ),
-               "lock = %p, ols = %p\n", lock, oscl);
+               "lock = %px, ols = %px\n", lock, oscl);
 
        if (oscl->ols_state == OLS_GRANTED)
                RETURN(0);
index 12fd55c..09b8f6f 100644 (file)
@@ -117,7 +117,7 @@ int mdc_set_lock_data(struct obd_export *exp, const struct lustre_handle *lockh,
                struct inode *old_inode = lock->l_resource->lr_lvb_inode;
 
                LASSERTF(old_inode->i_state & I_FREEING,
-                        "Found existing inode %p/%lu/%u state %lu in lock: setting data to %p/%lu/%u\n",
+                        "Found existing inode %px/%lu/%u state %lu in lock: setting data to %px/%lu/%u\n",
                         old_inode, old_inode->i_ino, old_inode->i_generation,
                         old_inode->i_state,
                         new_inode, new_inode->i_ino, new_inode->i_generation);
index 5ecf780..af7ca89 100644 (file)
@@ -919,7 +919,7 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
        if (likely(mod != NULL)) {
                LASSERTF(mod->mod_open_req != NULL &&
                         mod->mod_open_req->rq_type != LI_POISON,
-                        "POISONED open %p!\n", mod->mod_open_req);
+                        "POISONED open %px!\n", mod->mod_open_req);
 
                mod->mod_close_req = req;
 
index 93f4e23..85f78fe 100644 (file)
@@ -1312,7 +1312,7 @@ static int mdt_lock_root_xattr(struct mdt_thread_info *info,
 
                        LASSERTF(mdt->mdt_md_root == md_root,
                                 "Different root object ("
-                                DFID") instances, %p, %p\n",
+                                DFID") instances, %px, %px\n",
                                 PFID(&info->mti_tmp_fid1),
                                 mdt->mdt_md_root, md_root);
                        LASSERT(atomic_read(