From 7acc2a60980e6543f4e04ad2a02dd10a941064a2 Mon Sep 17 00:00:00 2001 From: pschwan Date: Thu, 24 Apr 2003 05:02:32 +0000 Subject: [PATCH] - convert all kmem_cache_alloc/PORTAL_SLAB_ALLOC to OBD_SLAB_ALLOC - POISON is sometimes a no-op, so use memset() for unused handle.addr - in target_handle_reconnect, only compare "cookie", not the whole handle - a cleanup here, a cleanup there, while I hunted for the corruption --- lustre/obdclass/fsfilt_ext3.c | 6 +++--- lustre/obdclass/statfs_pack.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/obdclass/fsfilt_ext3.c b/lustre/obdclass/fsfilt_ext3.c index 81561e0..e94f25f 100644 --- a/lustre/obdclass/fsfilt_ext3.c +++ b/lustre/obdclass/fsfilt_ext3.c @@ -420,7 +420,7 @@ static void fsfilt_ext3_cb_func(struct journal_callback *jcb, int error) fcb->cb_func(fcb->cb_obd, fcb->cb_last_rcvd, error); - kmem_cache_free(fcb_cache, fcb); + OBD_SLAB_FREE(fcb, fcb_cache, sizeof *fcb); atomic_dec(&fcb_cache_count); } @@ -429,8 +429,8 @@ static int fsfilt_ext3_set_last_rcvd(struct obd_device *obd, __u64 last_rcvd, { struct fsfilt_cb_data *fcb; - fcb = kmem_cache_alloc(fcb_cache, GFP_NOFS); - if (!fcb) + OBD_SLAB_ALLOC(fcb, fcb_cache, GFP_NOFS, sizeof *fcb); + if (fcb == NULL) RETURN(-ENOMEM); atomic_inc(&fcb_cache_count); diff --git a/lustre/obdclass/statfs_pack.c b/lustre/obdclass/statfs_pack.c index ba7ca41..a022d90 100644 --- a/lustre/obdclass/statfs_pack.c +++ b/lustre/obdclass/statfs_pack.c @@ -76,10 +76,11 @@ int obd_self_statfs(struct obd_device *obd, struct statfs *sfs) export = my_export = class_new_export(obd); if (export == NULL) RETURN(-ENOMEM); - } else + } else { export = list_entry(obd->obd_exports.next, typeof(*export), exp_obd_chain); - POISON(&conn.addr, 0x69, sizeof conn.addr); + } + memset(&conn.addr, 0x69, sizeof conn.addr); conn.cookie = export->exp_handle.h_cookie; rc = obd_statfs(&conn, &osfs); -- 1.8.3.1