From: Peng Tao <bergwolf@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
Andreas Dilger <andreas.dilger@intel.com>,
Peng Tao <tao.peng@emc.com>
Subject: [PATCH 09/48] staging/lustre/ldlm: print FID in lvbo_init(), lvbo_update
Date: Tue, 23 Jul 2013 00:06:30 +0800 [thread overview]
Message-ID: <1374509230-3324-10-git-send-email-bergwolf@gmail.com> (raw)
In-Reply-To: <1374509230-3324-1-git-send-email-bergwolf@gmail.com>
From: Andreas Dilger <andreas.dilger@intel.com>
Print the namespace and OBD device name, as well as the first two
lock resource fields (typically the FID) if there is an error with
loading the object from disk. This will be more important with
FID-on-OST and also the MDS. Using fid_extract_from_res_name() isn't
possible in the LDLM code, since the lock resource may not be a FID.
Make fid_extract_quota_resid() argument order and name consistent
with other fid_*_res() functions, with FID first and resource second.
Fix a bug in ofd_lvbo_init() where NULL lvb is accessed on error.
Print FID in ofd_lvbo_update() CDEBUG() and CERROR() messages.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2193
Lustre-change: http://review.whamcloud.com/4501
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
---
.../lustre/lustre/include/lustre/lustre_idl.h | 4 +-
drivers/staging/lustre/lustre/include/lustre_fid.h | 89 ++++++++++----------
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 5 +-
3 files changed, 50 insertions(+), 48 deletions(-)
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 8825460..1cfebfe 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -911,7 +911,7 @@ static inline int lu_fid_cmp(const struct lu_fid *f0,
__diff_normalize(fid_ver(f0), fid_ver(f1));
}
-static inline void ostid_cpu_to_le(struct ost_id *src_oi,
+static inline void ostid_cpu_to_le(const struct ost_id *src_oi,
struct ost_id *dst_oi)
{
if (fid_seq_is_mdt0(ostid_seq(src_oi))) {
@@ -922,7 +922,7 @@ static inline void ostid_cpu_to_le(struct ost_id *src_oi,
}
}
-static inline void ostid_le_to_cpu(struct ost_id *src_oi,
+static inline void ostid_le_to_cpu(const struct ost_id *src_oi,
struct ost_id *dst_oi)
{
if (fid_seq_is_mdt0(ostid_seq(src_oi))) {
diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h
index 7d20cba..7523b40 100644
--- a/drivers/staging/lustre/lustre/include/lustre_fid.h
+++ b/drivers/staging/lustre/lustre/include/lustre_fid.h
@@ -488,74 +488,75 @@ struct ldlm_namespace;
* renaming name[2,3] fields that need to be used for the quota identifier.
*/
static inline struct ldlm_res_id *
-fid_build_reg_res_name(const struct lu_fid *f,
- struct ldlm_res_id *name)
+fid_build_reg_res_name(const struct lu_fid *fid, struct ldlm_res_id *res)
{
- memset(name, 0, sizeof *name);
- name->name[LUSTRE_RES_ID_SEQ_OFF] = fid_seq(f);
- name->name[LUSTRE_RES_ID_VER_OID_OFF] = fid_ver_oid(f);
- return name;
+ memset(res, 0, sizeof(*res));
+ res->name[LUSTRE_RES_ID_SEQ_OFF] = fid_seq(fid);
+ res->name[LUSTRE_RES_ID_VER_OID_OFF] = fid_ver_oid(fid);
+
+ return res;
+}
+
+/*
+ * Return true if resource is for object identified by FID.
+ */
+static inline int fid_res_name_eq(const struct lu_fid *fid,
+ const struct ldlm_res_id *res)
+{
+ return res->name[LUSTRE_RES_ID_SEQ_OFF] == fid_seq(fid) &&
+ res->name[LUSTRE_RES_ID_VER_OID_OFF] == fid_ver_oid(fid);
+}
+
+/*
+ * Extract FID from LDLM resource. Reverse of fid_build_reg_res_name().
+ */
+static inline struct lu_fid *
+fid_extract_from_res_name(struct lu_fid *fid, const struct ldlm_res_id *res)
+{
+ fid->f_seq = res->name[LUSTRE_RES_ID_SEQ_OFF];
+ fid->f_oid = (__u32)(res->name[LUSTRE_RES_ID_VER_OID_OFF]);
+ fid->f_ver = (__u32)(res->name[LUSTRE_RES_ID_VER_OID_OFF] >> 32);
+ LASSERT(fid_res_name_eq(fid, res));
+
+ return fid;
}
/*
* Build (DLM) resource identifier from global quota FID and quota ID.
*/
static inline struct ldlm_res_id *
-fid_build_quota_resid(const struct lu_fid *glb_fid, union lquota_id *qid,
+fid_build_quota_res_name(const struct lu_fid *glb_fid, union lquota_id *qid,
struct ldlm_res_id *res)
{
fid_build_reg_res_name(glb_fid, res);
res->name[LUSTRE_RES_ID_QUOTA_SEQ_OFF] = fid_seq(&qid->qid_fid);
res->name[LUSTRE_RES_ID_QUOTA_VER_OID_OFF] = fid_ver_oid(&qid->qid_fid);
+
return res;
}
/*
* Extract global FID and quota ID from resource name
*/
-static inline void fid_extract_quota_resid(struct ldlm_res_id *res,
- struct lu_fid *glb_fid,
- union lquota_id *qid)
+static inline void fid_extract_from_quota_res(struct lu_fid *glb_fid,
+ union lquota_id *qid,
+ const struct ldlm_res_id *res)
{
- glb_fid->f_seq = res->name[LUSTRE_RES_ID_SEQ_OFF];
- glb_fid->f_oid = (__u32)res->name[LUSTRE_RES_ID_VER_OID_OFF];
- glb_fid->f_ver = (__u32)(res->name[LUSTRE_RES_ID_VER_OID_OFF] >> 32);
-
+ fid_extract_from_res_name(glb_fid, res);
qid->qid_fid.f_seq = res->name[LUSTRE_RES_ID_QUOTA_SEQ_OFF];
qid->qid_fid.f_oid = (__u32)res->name[LUSTRE_RES_ID_QUOTA_VER_OID_OFF];
qid->qid_fid.f_ver =
(__u32)(res->name[LUSTRE_RES_ID_QUOTA_VER_OID_OFF] >> 32);
}
-/*
- * Return true if resource is for object identified by fid.
- */
-static inline int fid_res_name_eq(const struct lu_fid *f,
- const struct ldlm_res_id *name)
-{
- return name->name[LUSTRE_RES_ID_SEQ_OFF] == fid_seq(f) &&
- name->name[LUSTRE_RES_ID_VER_OID_OFF] == fid_ver_oid(f);
-}
-
-/* reverse function of fid_build_reg_res_name() */
-static inline void fid_build_from_res_name(struct lu_fid *f,
- const struct ldlm_res_id *name)
-{
- fid_zero(f);
- f->f_seq = name->name[LUSTRE_RES_ID_SEQ_OFF];
- f->f_oid = name->name[LUSTRE_RES_ID_VER_OID_OFF] & 0xffffffff;
- f->f_ver = name->name[LUSTRE_RES_ID_VER_OID_OFF] >> 32;
- LASSERT(fid_res_name_eq(f, name));
-}
-
static inline struct ldlm_res_id *
-fid_build_pdo_res_name(const struct lu_fid *f,
- unsigned int hash,
- struct ldlm_res_id *name)
+fid_build_pdo_res_name(const struct lu_fid *fid, unsigned int hash,
+ struct ldlm_res_id *res)
{
- fid_build_reg_res_name(f, name);
- name->name[LUSTRE_RES_ID_HSH_OFF] = hash;
- return name;
+ fid_build_reg_res_name(fid, res);
+ res->name[LUSTRE_RES_ID_HSH_OFF] = hash;
+
+ return res;
}
/**
@@ -584,7 +585,7 @@ static inline void ostid_build_res_name(struct ost_id *oi,
name->name[LUSTRE_RES_ID_SEQ_OFF] = ostid_id(oi);
name->name[LUSTRE_RES_ID_VER_OID_OFF] = ostid_seq(oi);
} else {
- fid_build_reg_res_name((struct lu_fid *)oi, name);
+ fid_build_reg_res_name(&oi->oi_fid, name);
}
}
@@ -597,7 +598,7 @@ static inline void ostid_res_name_to_id(struct ost_id *oi,
ostid_set_id(oi, name->name[LUSTRE_RES_ID_SEQ_OFF]);
} else {
/* new resid */
- fid_build_from_res_name((struct lu_fid *)oi, name);
+ fid_extract_from_res_name(&oi->oi_fid, name);
}
}
@@ -644,7 +645,7 @@ static inline void ost_fid_from_resid(struct lu_fid *fid,
ostid_to_fid(fid, &oi, 0);
} else {
/* new resid */
- fid_build_from_res_name(fid, name);
+ fid_extract_from_res_name(fid, name);
}
}
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 9052dc5..cb8659f 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -1128,8 +1128,9 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent,
OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_CREATE_RESOURCE, 2);
rc = ns->ns_lvbo->lvbo_init(res);
if (rc < 0) {
- CERROR("lvbo_init failed for resource "
- LPU64": rc %d\n", name->name[0], rc);
+ CERROR("%s: lvbo_init failed for resource "LPX64":"
+ LPX64": rc = %d\n", ns->ns_obd->obd_name,
+ name->name[0], name->name[1], rc);
if (res->lr_lvb_data) {
OBD_FREE(res->lr_lvb_data, res->lr_lvb_len);
res->lr_lvb_data = NULL;
--
1.7.9.5
next prev parent reply other threads:[~2013-07-22 16:10 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 16:06 [PATCH 00/48] staging/lustre: minor cleanup and Intel Lustre sync Peng Tao
2013-07-22 16:06 ` [PATCH 01/48] staging/lustre: remove bogus ifndef EXPORT_SYMBOL Peng Tao
2013-07-22 16:06 ` [PATCH 02/48] staging/lustre/obdclass: restore lu_ref Peng Tao
2013-07-23 19:37 ` Greg Kroah-Hartman
2013-07-23 20:31 ` Dilger, Andreas
2013-07-23 20:52 ` Greg Kroah-Hartman
2013-07-24 6:06 ` Peng Tao
2013-07-22 16:06 ` [PATCH 03/48] staging/lustre/llite: use READ, WRITE around ll_rw_stats_tally() Peng Tao
2013-07-22 16:06 ` [PATCH 04/48] staging/lustre/llite: missing last bit in ll_have_md_lock Peng Tao
2013-07-22 16:06 ` [PATCH 05/48] staging/lustre: fix 'program hangs' errors Peng Tao
2013-07-22 16:06 ` [PATCH 06/48] staging/lustre/llite: check alloc in ll_file_data_get, ll_dir_ioctl Peng Tao
2013-07-22 16:06 ` [PATCH 07/48] staging/lustre/llite: A not locked mutex can be unlocked Peng Tao
2013-07-22 16:06 ` [PATCH 08/48] staging/lustre/llite: check ll_prep_md_op_data() using IS_ERR() Peng Tao
2013-07-22 16:06 ` Peng Tao [this message]
2013-07-22 16:06 ` [PATCH 10/48] staging/lustre/ptlrpc: race in pinger (use-after-free situation) Peng Tao
2013-07-22 16:06 ` [PATCH 11/48] staging/lustre/ptlrpc: Translate between host and network errnos Peng Tao
2013-07-22 16:29 ` Paul Bolle
2013-07-22 16:36 ` Peng Tao
2013-07-22 16:06 ` [PATCH 12/48] staging/lustre/mdc: layout lock rpc must not take rpc_lock Peng Tao
2013-07-22 16:06 ` [PATCH 13/48] staging/lustre/ldlm: split client namespaces into active and inactive Peng Tao
2013-07-22 16:06 ` [PATCH 14/48] staging/lustre: Only wake up ldlm_poold as frequently as the check interval Peng Tao
2013-07-22 16:06 ` [PATCH 15/48] staging/lustre: Make quota namespace refcounting consistent Peng Tao
2013-07-22 16:06 ` [PATCH 16/48] staging/lustre/dlmlock: compress out unused space Peng Tao
2013-07-22 16:06 ` [PATCH 17/48] staging/lustre/md: fix lu_ucred.c boilerplate Peng Tao
2013-07-22 16:06 ` [PATCH 18/48] staging/lustre/layout: introduce new layout for released files Peng Tao
2013-07-22 16:06 ` [PATCH 19/48] staging/lustre/mdt: add macros for fid string len Peng Tao
2013-07-22 16:06 ` [PATCH 20/48] staging/lustre/llapi: add user space method for lov_user_md Peng Tao
2013-07-22 16:06 ` [PATCH 21/48] staging/lustre/obdclass: use a dummy structure for lu_ref_link Peng Tao
2013-07-23 20:35 ` Greg Kroah-Hartman
2013-07-24 6:10 ` Peng Tao
2013-07-22 16:06 ` [PATCH 22/48] staging/lustre: fix 'code maintainability' errors Peng Tao
2013-07-22 16:06 ` [PATCH 23/48] staging/lustre/fid: prepare FID module for client server split Peng Tao
2013-07-22 16:06 ` [PATCH 24/48] staging/lustre/llite: force lvb_data update after layout change Peng Tao
2013-07-22 16:06 ` [PATCH 25/48] staging/lustre/lfsck: LFSCK 1.5 technical debts (3) Peng Tao
2013-07-22 16:06 ` [PATCH 26/48] staging/lustre/osc: Check return code for lu_kmem_init Peng Tao
2013-07-22 16:06 ` [PATCH 27/48] staging/lustre/ptlrpc: Race between start and stop service threads Peng Tao
2013-07-22 16:06 ` [PATCH 28/48] staging/lustre/crypto: add crc32c module loading to libcfs Peng Tao
2013-07-22 16:06 ` [PATCH 29/48] staging/lustre/mdt: duplicate link names in directory Peng Tao
2013-07-22 16:06 ` [PATCH 30/48] staging/lustre/llite: call simple_setattr() from ll_md_setattr() Peng Tao
2013-07-22 16:06 ` [PATCH 31/48] staging/lustre/ldlm: Fix flock deadlock detection race Peng Tao
2013-07-22 16:06 ` [PATCH 32/48] staging/lustre/lnet: remove empty file lnet/lnet/api-errno.c Peng Tao
2013-07-22 16:06 ` [PATCH 33/48] staging/lustre/fld: prepare FLD module for client server split Peng Tao
2013-07-22 16:06 ` [PATCH 34/48] staging/lustre/lmv: support DNE with HSM Peng Tao
2013-07-22 16:06 ` [PATCH 35/48] " Peng Tao
2013-07-23 20:39 ` Greg Kroah-Hartman
2013-07-22 16:06 ` [PATCH 36/48] staging/lustre/obdclass: add obd_target.h Peng Tao
2013-07-23 20:41 ` Greg Kroah-Hartman
2013-07-22 16:06 ` [PATCH 37/48] staging/lustre/procfs: return -ENOMEM from lprocfs_register() Peng Tao
2013-07-22 16:06 ` [PATCH 38/48] staging/lustre/lmv: fix duplicate directory entries Peng Tao
2013-07-22 16:07 ` [PATCH 39/48] staging/lustre/obdclass: be more careful processing server name Peng Tao
2013-07-22 16:07 ` [PATCH 40/48] staging/lustre/llite: return valid fsid for statfs Peng Tao
2013-07-22 16:07 ` [PATCH 41/48] staging/lustre/llite: error of listxattr when buffer is small Peng Tao
2013-07-22 16:07 ` [PATCH 42/48] staging/lustre/llite: Anonymous dentry incorrectly identified as root Peng Tao
2013-07-22 16:07 ` [PATCH 43/48] staging/lustre/build: fix 'data race condition' issues Peng Tao
2013-07-22 16:07 ` [PATCH 44/48] " Peng Tao
2013-07-23 20:44 ` Greg Kroah-Hartman
2013-07-22 16:07 ` [PATCH 45/48] staging/lustre/style: removes obsolete EXPORT_SYMTAB macros v2 Peng Tao
2013-07-22 16:07 ` [PATCH 46/48] staging/lustre/mdt: HSM on disk actions record Peng Tao
2013-07-22 16:07 ` [PATCH 47/48] staging/lustre/scrub: purge inconsistenct objects after OI scrub Peng Tao
2013-07-22 16:07 ` [PATCH 48/48] staging/lustre/mdc: Keep resend FLocks Peng Tao
2013-07-23 20:51 ` [PATCH 00/48] staging/lustre: minor cleanup and Intel Lustre sync Greg Kroah-Hartman
2013-07-24 6:05 ` Peng Tao
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=1374509230-3324-10-git-send-email-bergwolf@gmail.com \
--to=bergwolf@gmail.com \
--cc=andreas.dilger@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tao.peng@emc.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