diff options
author | Henri Doreau <henri.doreau@cea.fr> | 2015-02-01 21:52:09 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-02-07 17:31:10 +0800 |
commit | dbab2d8563d8a988dd4ec740ab9c06a4f86890ea (patch) | |
tree | 8b6fb3e954b5f708434695253f8c848b59717d3f /drivers/staging | |
parent | 081fa9dffcde7c9fc4d9fdf18fe277dfa3f675aa (diff) | |
download | blackbird-obmc-linux-dbab2d8563d8a988dd4ec740ab9c06a4f86890ea.tar.gz blackbird-obmc-linux-dbab2d8563d8a988dd4ec740ab9c06a4f86890ea.zip |
staging/lustre/obdclass: Proper swabbing of llog_rec_tail.
A variable-length structure preceeds llog_rec_tail within an llog
block. Thus cr_tail shouldn't be accessed directly as a structure
member but its actual location should be computed dynamically.
Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-on: http://review.whamcloud.com/11937
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5631
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/lustre/lustre/obdclass/llog_swab.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/llog_swab.c b/drivers/staging/lustre/lustre/obdclass/llog_swab.c index d3ec90e85eb9..a2d5aa105d6b 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_swab.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_swab.c @@ -168,7 +168,8 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec) } case CHANGELOG_REC: { - struct llog_changelog_rec *cr = (struct llog_changelog_rec *)rec; + struct llog_changelog_rec *cr = + (struct llog_changelog_rec *)rec; __swab16s(&cr->cr.cr_namelen); __swab16s(&cr->cr.cr_flags); @@ -188,6 +189,8 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec) } else { tail = &cr->cr_tail; } + tail = (struct llog_rec_tail *)((char *)tail + + cr->cr.cr_namelen); break; } case CHANGELOG_USER_REC: |