diff options
author | wang di <di.wang@intel.com> | 2013-06-03 21:40:49 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-03 11:26:35 -0700 |
commit | ff8c39b25e543d4016f3f166f48c8e89f17221e4 (patch) | |
tree | ff86d7cfd8555cec6835f206426aeec6a0f5fbad | |
parent | 66cc83e965d30fef4f40c2dfd429aebc8be53055 (diff) |
staging/lustre/llog: Do not use ostid swab for llogid
Since logid still use id/seq format in the request,
it will be swabbed by its own swab func, instead of
using ostid swab, which might see logid as FID incorrectly.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3302
Lustre-change: http://review.whamcloud.com/6305
Signed-off-by: wang di <di.wang@intel.com>
Reviewed-by: John Hammond <johnlockwoodhammond@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 1 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/obdclass/llog_swab.c | 17 |
2 files changed, 12 insertions, 6 deletions
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index ce7ca98577a1..3d1f6fece5b7 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -3268,6 +3268,7 @@ extern void lustre_swab_llogd_body (struct llogd_body *d); extern void lustre_swab_llog_hdr (struct llog_log_hdr *h); extern void lustre_swab_llogd_conn_body (struct llogd_conn_body *d); extern void lustre_swab_llog_rec(struct llog_rec_hdr *rec); +extern void lustre_swab_llog_id(struct llog_logid *lid); struct lustre_cfg; extern void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg); diff --git a/drivers/staging/lustre/lustre/obdclass/llog_swab.c b/drivers/staging/lustre/lustre/obdclass/llog_swab.c index ea70b99706f6..dedfecff95bc 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_swab.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_swab.c @@ -78,12 +78,19 @@ void lustre_swab_ost_id(struct ost_id *oid) } EXPORT_SYMBOL(lustre_swab_ost_id); +void lustre_swab_llog_id(struct llog_logid *log_id) +{ + __swab64s(&log_id->lgl_oi.oi.oi_id); + __swab64s(&log_id->lgl_oi.oi.oi_seq); + __swab32s(&log_id->lgl_ogen); +} +EXPORT_SYMBOL(lustre_swab_llog_id); + void lustre_swab_llogd_body (struct llogd_body *d) { ENTRY; print_llogd_body(d); - lustre_swab_ost_id(&d->lgd_logid.lgl_oi); - __swab32s (&d->lgd_logid.lgl_ogen); + lustre_swab_llog_id(&d->lgd_logid); __swab32s (&d->lgd_ctxt_idx); __swab32s (&d->lgd_llh_flags); __swab32s (&d->lgd_index); @@ -99,8 +106,7 @@ void lustre_swab_llogd_conn_body (struct llogd_conn_body *d) { __swab64s (&d->lgdc_gen.mnt_cnt); __swab64s (&d->lgdc_gen.conn_cnt); - lustre_swab_ost_id(&d->lgdc_logid.lgl_oi); - __swab32s (&d->lgdc_logid.lgl_ogen); + lustre_swab_llog_id(&d->lgdc_logid); __swab32s (&d->lgdc_ctxt_idx); } EXPORT_SYMBOL(lustre_swab_llogd_conn_body); @@ -230,8 +236,7 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec) { struct llog_logid_rec *lid = (struct llog_logid_rec *)rec; - lustre_swab_ost_id(&lid->lid_id.lgl_oi); - __swab32s(&lid->lid_id.lgl_ogen); + lustre_swab_llog_id(&lid->lid_id); tail = &lid->lid_tail; break; } |