From 6f780af1002ce238e19ebe79296c644ecf1ce168 Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 14 Aug 2002 05:15:02 +0000 Subject: [PATCH] Minor changes to bring patch-2.4.18 and patch-2.4.18-chaos12 into sync: - named initializers for the intent structs - whitespace cleanups - diff chunk ordering (so it is easy to compare the two) - add path_lookup_it() to patch-2.4.18, even though we don't use it there yet - add intent_release() for rename dentries to -chaos12 Still does not contain sync of link_path_walk_it() differences. --- lustre/patches/patch-2.4.18 | 338 +++++++++++++++++++----------------- lustre/patches/patch-2.4.18-chaos12 | 221 ++++++++++++----------- 2 files changed, 301 insertions(+), 258 deletions(-) diff --git a/lustre/patches/patch-2.4.18 b/lustre/patches/patch-2.4.18 index 9624eab..c3d15eb 100644 --- a/lustre/patches/patch-2.4.18 +++ b/lustre/patches/patch-2.4.18 @@ -28,66 +28,6 @@ int do_check_pgt_cache(int low, int high) { int freed = 0; ---- lum-pristine/mm/slab.c Fri Dec 21 12:42:05 2001 -+++ lum/mm/slab.c Thu Aug 1 18:07:35 2002 -@@ -1187,6 +1187,57 @@ - * Called with the cache-lock held. - */ - -+extern struct page *check_get_page(unsigned long kaddr); -+struct page *page_mem_map(struct page *page); -+static int kmem_check_cache_obj (kmem_cache_t * cachep, -+ slab_t *slabp, void * objp) -+{ -+ int i; -+ unsigned int objnr; -+ -+ if (cachep->flags & SLAB_RED_ZONE) { -+ objp -= BYTES_PER_WORD; -+ if ( *(unsigned long *)objp != RED_MAGIC2) -+ /* Either write before start, or a double free. */ -+ return 0; -+ if (*(unsigned long *)(objp+cachep->objsize - -+ BYTES_PER_WORD) != RED_MAGIC2) -+ /* Either write past end, or a double free. */ -+ return 0; -+ } -+ -+ objnr = (objp-slabp->s_mem)/cachep->objsize; -+ if (objnr >= cachep->num) -+ return 0; -+ if (objp != slabp->s_mem + objnr*cachep->objsize) -+ return 0; -+ -+ /* Check slab's freelist to see if this obj is there. */ -+ for (i = slabp->free; i != BUFCTL_END; i = slab_bufctl(slabp)[i]) { -+ if (i == objnr) -+ return 0; -+ } -+ return 1; -+} -+ -+ -+int kmem_cache_validate(kmem_cache_t *cachep, void *objp) -+{ -+ struct page *page = check_get_page((unsigned long)objp); -+ -+ if (!VALID_PAGE(page)) -+ return 0; -+ -+ if (!PageSlab(page)) -+ return 0; -+ -+ /* XXX check for freed slab objects ? */ -+ if (!kmem_check_cache_obj(cachep, GET_PAGE_SLAB(page), objp)) -+ return 0; -+ -+ return (cachep == GET_PAGE_CACHE(page)); -+} -+ - #if DEBUG - static int kmem_extra_free_checks (kmem_cache_t * cachep, - slab_t *slabp, void * objp) --- lum-pristine/drivers/block/blkpg.c Mon Feb 25 14:37:57 2002 +++ lum/drivers/block/blkpg.c Thu Aug 1 18:07:35 2002 @@ -294,3 +294,38 @@ @@ -105,7 +45,7 @@ +void dev_set_rdonly(kdev_t dev, int no_write) +{ + if (dev) { -+ printk(KERN_WARNING "Turning device %s read-only\n", ++ printk(KERN_WARNING "Turning device %s read-only\n", + bdevname(dev)); + dev_no_write[no_write] = 0xdead0000 + dev; + } @@ -286,11 +226,13 @@ /* * Obtain a new handle. * -@@ -228,13 +243,10 @@ +@@ -227,14 +242,11 @@ + handle->h_ref++; return handle; } - +- - handle = jbd_kmalloc(sizeof (handle_t), GFP_NOFS); ++ + handle = get_handle(nblocks); if (!handle) return ERR_PTR(-ENOMEM); @@ -301,11 +243,13 @@ current->journal_info = handle; err = start_this_handle(journal, handle); -@@ -334,13 +346,10 @@ +@@ -333,14 +345,11 @@ + if (is_journal_aborted(journal)) return ERR_PTR(-EIO); - +- - handle = jbd_kmalloc(sizeof (handle_t), GFP_NOFS); ++ + handle = get_handle(nblocks); if (!handle) return ERR_PTR(-ENOMEM); @@ -346,16 +290,18 @@ * All done for a particular handle. * * There is not much action needed here. We just return any remaining -@@ -1393,6 +1425,9 @@ +@@ -1383,7 +1415,10 @@ wake_up(&journal->j_wait_transaction_locked); } +- /* + /* Move callbacks from the handle to the transaction. */ + list_splice(&handle->h_jcb, &transaction->t_jcb); + - /* ++ /* * If the handle is marked SYNC, we need to set another commit * going! We also want to force a commit if the current + * transaction is occupying too much of the log, or if the --- lum-pristine/include/linux/blkdev.h Mon Nov 26 08:29:17 2001 +++ lum/include/linux/blkdev.h Mon Aug 12 11:48:39 2002 @@ -228,4 +228,8 @@ @@ -443,7 +389,7 @@ EXPORT_SYMBOL(dentry_open); --- lum-pristine/include/linux/dcache.h Thu Nov 22 14:46:18 2001 +++ lum/include/linux/dcache.h Mon Aug 12 00:02:29 2002 -@@ -6,6 +6,34 @@ +@@ -6,6 +6,33 @@ #include #include @@ -460,15 +406,14 @@ +#define IT_GETATTR (1<<10) +#define IT_SETATTR (1<<11) +#define IT_READLINK (1<<12) -+#define IT_MKNOD (1<<13) -+#define IT_LOOKUP (1<<14) ++#define IT_MKNOD (1<<13) ++#define IT_LOOKUP (1<<14) + -+/* it_op MUST be first, or all of the initializing code will break */ -+struct lookup_intent { ++struct lookup_intent { + int it_op; + int it_mode; + int it_disposition; -+ int it_status; ++ int it_status; + struct iattr *it_iattr; + __u64 it_lock_handle[2]; + int it_lock_mode; @@ -478,23 +423,19 @@ /* * linux/include/linux/dcache.h * -@@ -79,17 +107,20 @@ +@@ -78,6 +106,7 @@ + unsigned long d_time; /* used by d_revalidate */ struct dentry_operations *d_op; struct super_block * d_sb; /* The root of the dentry tree */ - unsigned long d_vfs_flags; + struct lookup_intent *d_it; + unsigned long d_vfs_flags; void * d_fsdata; /* fs-specific data */ unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */ - }; - - struct dentry_operations { - int (*d_revalidate)(struct dentry *, int); -+ int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *); - int (*d_hash) (struct dentry *, struct qstr *); - int (*d_compare) (struct dentry *, struct qstr *, struct qstr *); +@@ -91,6 +119,8 @@ int (*d_delete)(struct dentry *); void (*d_release)(struct dentry *); void (*d_iput)(struct dentry *, struct inode *); ++ int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *); + void (*d_intent_release)(struct dentry *); }; @@ -515,7 +456,7 @@ extern int vfs_unlink(struct inode *, struct dentry *); -extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); +int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, -+ struct inode *new_dir, struct dentry *new_dentry, ++ struct inode *new_dir, struct dentry *new_dentry, + struct lookup_intent *it); /* @@ -581,7 +522,7 @@ * XEmacs seems to be relying on it... */ -+void intent_release(struct dentry *de) ++void intent_release(struct dentry *de) +{ + if (de->d_op && de->d_op->d_intent_release) + de->d_op->d_intent_release(de); @@ -597,7 +538,7 @@ * SMP-safe */ -static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name, int flags) -+static struct dentry *cached_lookup(struct dentry *parent, struct qstr * name, ++static struct dentry *cached_lookup(struct dentry *parent, struct qstr *name, + int flags, struct lookup_intent *it) { struct dentry * dentry = d_lookup(parent, name); @@ -608,8 +549,8 @@ + dput(dentry); + dentry = NULL; + } -+ return dentry; -+ } else ++ return dentry; ++ } else if (dentry && dentry->d_op && dentry->d_op->d_revalidate) { if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) { dput(dentry); @@ -627,9 +568,9 @@ result = ERR_PTR(-ENOMEM); if (dentry) { lock_kernel(); -+ if (dir->i_op->lookup2) ++ if (dir->i_op->lookup2) + result = dir->i_op->lookup2(dir, dentry, it); -+ else ++ else result = dir->i_op->lookup(dir, dentry); unlock_kernel(); if (result) @@ -651,7 +592,7 @@ * We expect 'base' to be positive and a directory. */ -int link_path_walk(const char * name, struct nameidata *nd) -+int link_path_walk_it(const char * name, struct nameidata *nd, ++int link_path_walk_it(const char *name, struct nameidata *nd, + struct lookup_intent *it) { struct dentry *dentry; @@ -694,7 +635,7 @@ if (lookup_flags & LOOKUP_DIRECTORY) { err = -ENOTDIR; - if (!inode->i_op || !inode->i_op->lookup) -+ if (!inode->i_op || (!inode->i_op->lookup && ++ if (!inode->i_op || (!inode->i_op->lookup && + !inode->i_op->lookup2)) break; } @@ -738,12 +679,30 @@ /* SMP-safe */ /* returns 1 if everything is done */ static int __emul_lookup_dentry(const char *name, struct nameidata *nd) +@@ -707,6 +738,17 @@ + } + + /* SMP-safe */ ++int path_lookup_it(const char *path, unsigned flags, struct nameidata *nd, ++ struct lookup_intent *it) ++{ ++ int error = 0; ++ if (path_init(path, flags, nd)) ++ error = path_walk_it(path, nd, it); ++ return error; ++} ++ ++ ++/* SMP-safe */ + int path_lookup(const char *path, unsigned flags, struct nameidata *nd) + { + int error = 0; @@ -742,7 +786,8 @@ * needs parent already locked. Doesn't follow mounts. * SMP-safe. */ -struct dentry * lookup_hash(struct qstr *name, struct dentry * base) -+struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base, ++struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base, + struct lookup_intent *it) { struct dentry * dentry; @@ -760,9 +719,9 @@ if (!new) goto out; lock_kernel(); -+ if (inode->i_op->lookup2) ++ if (inode->i_op->lookup2) + dentry = inode->i_op->lookup2(inode, new, it); -+ else ++ else dentry = inode->i_op->lookup(inode, new); unlock_kernel(); if (!dentry) @@ -817,16 +776,15 @@ * SMP-safe */ -int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) -+int open_namei_it(const char * pathname, int flag, int mode, ++int open_namei_it(const char *pathname, int flag, int mode, + struct nameidata *nd, struct lookup_intent *it) { int acc_mode, error = 0; struct inode *inode; -@@ -984,17 +1056,23 @@ +@@ -984,17 +1056,22 @@ * The simplest case - just a plain lookup. */ if (!(flag & O_CREAT)) { -+ if (path_init(pathname, lookup_flags(flag), nd)) - error = path_walk(pathname, nd); + error = path_walk_it(pathname, nd, it); @@ -869,10 +827,10 @@ return 0; exit_dput: -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); exit: -+ intent_release(nd->dentry); ++ intent_release(nd->dentry); path_release(nd); return error; @@ -881,7 +839,7 @@ UPDATE_ATIME(dentry->d_inode); error = dentry->d_inode->i_op->follow_link(dentry, nd); + if (error) -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); if (error) return error; @@ -895,15 +853,15 @@ goto do_last; } -+int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) ++int open_namei(const char *pathname, int flag, int mode, struct nameidata *nd) +{ -+ return open_namei_it(pathname, flag, mode, nd, NULL); ++ return open_namei_it(pathname, flag, mode, nd, NULL); +} + + /* SMP-safe */ -static struct dentry *lookup_create(struct nameidata *nd, int is_dir) -+static struct dentry *lookup_create(struct nameidata *nd, int is_dir, ++static struct dentry *lookup_create(struct nameidata *nd, int is_dir, + struct lookup_intent *it) { struct dentry *dentry; @@ -921,7 +879,7 @@ char * tmp; struct dentry * dentry; struct nameidata nd; -+ struct lookup_intent it = { IT_MKNOD, mode }; ++ struct lookup_intent it = { .it_op = IT_MKNOD, .it_mode = mode }; if (S_ISDIR(mode)) return -EPERM; @@ -943,7 +901,7 @@ default: error = -EINVAL; } -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -951,7 +909,7 @@ { int error = 0; char * tmp; -+ struct lookup_intent it = { IT_MKDIR, mode }; ++ struct lookup_intent it = { .it_op = IT_MKDIR, .it_mode = mode }; tmp = getname(pathname); error = PTR_ERR(tmp); @@ -966,7 +924,7 @@ + dentry->d_it = ⁢ error = vfs_mkdir(nd.dentry->d_inode, dentry, mode & ~current->fs->umask); -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -974,7 +932,7 @@ char * name; struct dentry *dentry; struct nameidata nd; -+ struct lookup_intent it = { IT_RMDIR, 0 }; ++ struct lookup_intent it = { .it_op = IT_RMDIR }; name = getname(pathname); if(IS_ERR(name)) @@ -986,9 +944,9 @@ + dentry = lookup_hash_it(&nd.last, nd.dentry, &it); error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { -+ dentry->d_it = ⁢ ++ dentry->d_it = ⁢ error = vfs_rmdir(nd.dentry->d_inode, dentry); -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -996,7 +954,7 @@ char * name; struct dentry *dentry; struct nameidata nd; -+ struct lookup_intent it = { IT_UNLINK, 0 }; ++ struct lookup_intent it = { .it_op = IT_UNLINK }; name = getname(pathname); if(IS_ERR(name)) @@ -1014,7 +972,7 @@ goto slashes; error = vfs_unlink(nd.dentry->d_inode, dentry); exit2: -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -1022,7 +980,7 @@ int error = 0; char * from; char * to; -+ struct lookup_intent it = { IT_SYMLINK, 0 }; ++ struct lookup_intent it = { .it_op = IT_SYMLINK }; from = getname(oldname); if(IS_ERR(from)) @@ -1036,7 +994,7 @@ if (!IS_ERR(dentry)) { + dentry->d_it = ⁢ error = vfs_symlink(nd.dentry->d_inode, dentry, from); -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -1044,7 +1002,7 @@ int error; char * from; char * to; -+ struct lookup_intent it = { IT_LINK, 0 }; ++ struct lookup_intent it = { .it_op = IT_LINK }; from = getname(oldname); if(IS_ERR(from)) @@ -1058,7 +1016,7 @@ if (!IS_ERR(new_dentry)) { + new_dentry->d_it = ⁢ error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry); -+ intent_release(new_dentry); ++ intent_release(new_dentry); dput(new_dentry); } up(&nd.dentry->d_inode->i_sem); @@ -1083,7 +1041,7 @@ error = -EBUSY; else error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry); -+ intent_release(new_dentry); ++ intent_release(new_dentry); if (target) { if (!error) target->i_flags |= S_DEAD; @@ -1092,7 +1050,7 @@ int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, - struct inode *new_dir, struct dentry *new_dentry) -+ struct inode *new_dir, struct dentry *new_dentry, ++ struct inode *new_dir, struct dentry *new_dentry, + struct lookup_intent *it) { int error; @@ -1106,7 +1064,7 @@ error = -EBUSY; else error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry); -+ intent_release(new_dentry); ++ intent_release(new_dentry); double_up(&old_dir->i_zombie, &new_dir->i_zombie); if (error) return error; @@ -1115,34 +1073,32 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, - struct inode *new_dir, struct dentry *new_dentry) -+ struct inode *new_dir, struct dentry *new_dentry, ++ struct inode *new_dir, struct dentry *new_dentry, + struct lookup_intent *it) { int error; if (S_ISDIR(old_dentry->d_inode->i_mode)) - error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry); -+ error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry, it); ++ error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry,it); else - error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry); -+ error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry, it); ++ error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry,it); if (!error) { if (old_dir == new_dir) inode_dir_notify(old_dir, DN_RENAME); -@@ -1841,6 +1957,7 @@ +@@ -1840,6 +1956,7 @@ + int error = 0; struct dentry * old_dir, * new_dir; struct dentry * old_dentry, *new_dentry; ++ struct lookup_intent it = { .it_op = IT_RENAME }; struct nameidata oldnd, newnd; -+ struct lookup_intent it = {IT_RENAME, 0}; if (path_init(oldname, LOOKUP_PARENT, &oldnd)) - error = path_walk(oldname, &oldnd); -@@ -1868,7 +1985,9 @@ +@@ -1868,7 +1985,7 @@ double_lock(new_dir, old_dir); - old_dentry = lookup_hash(&oldnd.last, old_dir); -+ it.it_op = IT_RENAME; -+ it.it_mode = 0; + old_dentry = lookup_hash_it(&oldnd.last, old_dir, &it); error = PTR_ERR(old_dentry); if (IS_ERR(old_dentry)) @@ -1177,7 +1133,7 @@ #include #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) -+extern int path_walk_it(const char * name, struct nameidata *nd, ++extern int path_walk_it(const char *name, struct nameidata *nd, + struct lookup_intent *it); +extern void intent_release(struct dentry *de); @@ -1187,7 +1143,7 @@ struct nameidata nd; struct inode * inode; int error; -+ struct lookup_intent it = { IT_SETATTR }; ++ struct lookup_intent it = { .it_op = IT_SETATTR }; error = -EINVAL; if (length < 0) /* sorry, but loff_t says... */ @@ -1213,7 +1169,7 @@ struct nameidata nd; struct inode * inode; struct iattr newattrs; -+ struct lookup_intent it = { IT_SETATTR }; ++ struct lookup_intent it = { .it_op = IT_SETATTR }; - error = user_path_walk(filename, &nd); + error = user_path_walk_it(filename, &nd, &it); @@ -1235,7 +1191,7 @@ struct nameidata nd; struct inode * inode; struct iattr newattrs; -+ struct lookup_intent it = { IT_SETATTR }; ++ struct lookup_intent it = { .it_op = IT_SETATTR }; - error = user_path_walk(filename, &nd); + error = user_path_walk_it(filename, &nd, &it); @@ -1258,7 +1214,7 @@ int old_fsuid, old_fsgid; kernel_cap_t old_cap; int res; -+ struct lookup_intent it = { IT_GETATTR }; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ return -EINVAL; @@ -1282,7 +1238,7 @@ int error; struct nameidata nd; char *name; -+ struct lookup_intent it = { IT_GETATTR }; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; name = getname(filename); error = PTR_ERR(name); @@ -1312,7 +1268,7 @@ int error; struct nameidata nd; char *name; -+ struct lookup_intent it = { IT_GETATTR }; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; name = getname(filename); error = PTR_ERR(name); @@ -1321,7 +1277,7 @@ path_init(name, LOOKUP_POSITIVE | LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd); - error = path_walk(name, &nd); -+ error = path_walk_it(name, &nd, &it); ++ error = path_walk_it(name, &nd, &it); putname(name); if (error) goto out; @@ -1338,13 +1294,13 @@ path_release(&nd); out: return error; -@@ -490,12 +510,13 @@ +@@ -490,12 +510,14 @@ struct inode * inode; int error; struct iattr newattrs; -- ++ struct lookup_intent it = { .it_op = IT_SETATTR }; + - error = user_path_walk(filename, &nd); -+ struct lookup_intent it = { IT_SETATTR }; + error = user_path_walk_it(filename, &nd, &it); if (error) goto out; @@ -1366,7 +1322,7 @@ { struct nameidata nd; int error; -+ struct lookup_intent it = { IT_SETATTR }; ++ struct lookup_intent it = { .it_op = IT_SETATTR }; - error = user_path_walk(filename, &nd); + error = user_path_walk_it(filename, &nd, &it); @@ -1381,7 +1337,7 @@ { struct nameidata nd; int error; -+ struct lookup_intent it = { IT_SETATTR }; ++ struct lookup_intent it = { .it_op = IT_SETATTR }; - error = user_path_walk_link(filename, &nd); + error = user_path_walk_link_it(filename, &nd, &it); @@ -1396,7 +1352,7 @@ * for the internal routines (ie open_namei()/follow_link() etc). 00 is * used by symlinks. */ -+extern int open_namei_it(const char *filename, int namei_flags, int mode, ++extern int open_namei_it(const char *filename, int namei_flags, int mode, + struct nameidata *nd, struct lookup_intent *it); +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, + int flags, struct lookup_intent *it); @@ -1405,7 +1361,7 @@ { int namei_flags, error; struct nameidata nd; -+ struct lookup_intent it = {IT_OPEN, 0}; ++ struct lookup_intent it = { .it_op = IT_OPEN }; namei_flags = flags; if ((namei_flags+1) & O_ACCMODE) @@ -1418,10 +1374,10 @@ - return dentry_open(nd.dentry, nd.mnt, flags); + error = open_namei_it(filename, namei_flags, mode, &nd, &it); + if (error) -+ return ERR_PTR(error); ++ return ERR_PTR(error); - return ERR_PTR(error); -+ return dentry_open_it(nd.dentry, nd.mnt, flags, &it); ++ return dentry_open_it(nd.dentry, nd.mnt, flags, &it); } -struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags) @@ -1434,7 +1390,7 @@ } f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC); -+ intent_release(dentry); ++ intent_release(dentry); return f; cleanup_all: @@ -1458,11 +1414,19 @@ */ --- lum-pristine/fs/stat.c Thu Sep 13 19:04:43 2001 +++ lum/fs/stat.c Mon Aug 12 00:04:39 2002 +@@ -13,6 +13,7 @@ + + #include + ++extern void intent_release(struct dentry *de); + /* + * Revalidate the inode. This is required for proper NFS attribute caching. + */ @@ -135,13 +135,15 @@ asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf) { struct nameidata nd; -+ struct lookup_intent it = {IT_GETATTR, 0}; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; int error; - error = user_path_walk(filename, &nd); @@ -1479,7 +1443,7 @@ asmlinkage long sys_newstat(char * filename, struct stat * statbuf) { struct nameidata nd; -+ struct lookup_intent it = {IT_GETATTR, 0}; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; int error; - error = user_path_walk(filename, &nd); @@ -1496,7 +1460,7 @@ asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf) { struct nameidata nd; -+ struct lookup_intent it = {IT_GETATTR, 0}; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; int error; - error = user_path_walk_link(filename, &nd); @@ -1513,7 +1477,7 @@ asmlinkage long sys_newlstat(char * filename, struct stat * statbuf) { struct nameidata nd; -+ struct lookup_intent it = {IT_GETATTR, 0}; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; int error; - error = user_path_walk_link(filename, &nd); @@ -1530,7 +1494,7 @@ { struct nameidata nd; int error; -+ struct lookup_intent it = { IT_READLINK }; ++ struct lookup_intent it = { .it_op = IT_READLINK }; if (bufsiz <= 0) return -EINVAL; @@ -1554,7 +1518,7 @@ { struct nameidata nd; int error; -+ struct lookup_intent it = {IT_GETATTR}; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; - error = user_path_walk(filename, &nd); + error = user_path_walk_it(filename, &nd, &it); @@ -1562,7 +1526,7 @@ error = do_revalidate(nd.dentry); if (!error) error = cp_new_stat64(nd.dentry->d_inode, statbuf); -+ intent_release(nd.dentry); ++ intent_release(nd.dentry); path_release(&nd); } return error; @@ -1570,7 +1534,7 @@ { struct nameidata nd; int error; -+ struct lookup_intent it = { IT_GETATTR}; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; - error = user_path_walk_link(filename, &nd); + error = user_path_walk_link_it(filename, &nd, &it); @@ -1578,7 +1542,7 @@ error = do_revalidate(nd.dentry); if (!error) error = cp_new_stat64(nd.dentry->d_inode, statbuf); -+ intent_release(nd.dentry); ++ intent_release(nd.dentry); path_release(&nd); } return error; @@ -1586,7 +1550,69 @@ { struct file * f; int err = -EBADF; -+ struct lookup_intent it = { IT_GETATTR }; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; f = fget(fd); if (f) { +--- lum-pristine/mm/slab.c Fri Dec 21 12:42:05 2001 ++++ lum/mm/slab.c Thu Aug 1 18:07:35 2002 +@@ -1187,6 +1187,59 @@ + * Called with the cache-lock held. + */ + ++extern struct page *check_get_page(unsigned long kaddr); ++struct page *page_mem_map(struct page *page); ++static int kmem_check_cache_obj (kmem_cache_t * cachep, ++ slab_t *slabp, void * objp) ++{ ++ int i; ++ unsigned int objnr; ++ ++#if DEBUG ++ if (cachep->flags & SLAB_RED_ZONE) { ++ objp -= BYTES_PER_WORD; ++ if ( *(unsigned long *)objp != RED_MAGIC2) ++ /* Either write before start, or a double free. */ ++ return 0; ++ if (*(unsigned long *)(objp+cachep->objsize - ++ BYTES_PER_WORD) != RED_MAGIC2) ++ /* Either write past end, or a double free. */ ++ return 0; ++ } ++#endif ++ ++ objnr = (objp-slabp->s_mem)/cachep->objsize; ++ if (objnr >= cachep->num) ++ return 0; ++ if (objp != slabp->s_mem + objnr*cachep->objsize) ++ return 0; ++ ++ /* Check slab's freelist to see if this obj is there. */ ++ for (i = slabp->free; i != BUFCTL_END; i = slab_bufctl(slabp)[i]) { ++ if (i == objnr) ++ return 0; ++ } ++ return 1; ++} ++ ++ ++int kmem_cache_validate(kmem_cache_t *cachep, void *objp) ++{ ++ struct page *page = check_get_page((unsigned long)objp); ++ ++ if (!VALID_PAGE(page)) ++ return 0; ++ ++ if (!PageSlab(page)) ++ return 0; ++ ++ /* XXX check for freed slab objects ? */ ++ if (!kmem_check_cache_obj(cachep, GET_PAGE_SLAB(page), objp)) ++ return 0; ++ ++ return (cachep == GET_PAGE_CACHE(page)); ++} ++ + #if DEBUG + static int kmem_extra_free_checks (kmem_cache_t * cachep, + slab_t *slabp, void * objp) diff --git a/lustre/patches/patch-2.4.18-chaos12 b/lustre/patches/patch-2.4.18-chaos12 index 815c434..7bf97fa 100644 --- a/lustre/patches/patch-2.4.18-chaos12 +++ b/lustre/patches/patch-2.4.18-chaos12 @@ -1,3 +1,33 @@ +--- linux-2.4.18-lustre12-pristine/arch/ia64/mm/init.c Wed Jun 26 00:15:21 2002 ++++ linux-2.4.18-lustre12/arch/ia64/mm/init.c Tue Aug 13 11:13:09 2002 +@@ -37,6 +37,12 @@ + + static unsigned long totalram_pages; + ++struct page *check_get_page(unsigned long kaddr) ++{ ++#warning FIXME: Lustre team, is this solid? ++ return virt_to_page(kaddr); ++} ++ + int + do_check_pgt_cache (int low, int high) + { +--- linux-2.4.18-lustre12-pristine/arch/i386/mm/init.c Wed Jun 26 00:15:21 2002 ++++ linux-2.4.18-lustre12/arch/i386/mm/init.c Tue Aug 13 11:13:09 2002 +@@ -43,6 +43,12 @@ + static unsigned long totalram_pages; + static unsigned long totalhigh_pages; + ++struct page *check_get_page(unsigned long kaddr) ++{ ++#warning FIXME: Lustre team, is this solid? ++ return virt_to_page(kaddr); ++} ++ + int do_check_pgt_cache(int low, int high) + { + int freed = 0; --- linux-2.4.18-lustre12-pristine/drivers/block/blkpg.c Tue May 7 20:33:10 2002 +++ linux-2.4.18-lustre12/drivers/block/blkpg.c Tue Aug 13 11:13:08 2002 @@ -295,3 +295,38 @@ @@ -15,7 +45,7 @@ +void dev_set_rdonly(kdev_t dev, int no_write) +{ + if (dev) { -+ printk(KERN_WARNING "Turning device %s read-only\n", ++ printk(KERN_WARNING "Turning device %s read-only\n", + bdevname(dev)); + dev_no_write[no_write] = 0xdead0000 + dev; + } @@ -278,16 +308,25 @@ * transaction is occupying too much of the log, or if the --- linux-2.4.18-lustre12-pristine/include/linux/blkdev.h Wed Jun 26 00:16:30 2002 +++ linux-2.4.18-lustre12/include/linux/blkdev.h Tue Aug 13 11:13:08 2002 -@@ -276,4 +276,9 @@ - } +@@ -228,4 +228,8 @@ return retval; } -+ + +#define CONFIG_DEV_RDONLY +void dev_set_rdonly(kdev_t, int); +int dev_check_rdonly(kdev_t); +void dev_clear_rdonly(int); #endif +--- linux-2.4.18-lustre12-pristine/include/linux/slab.h Wed Jun 26 00:16:34 2002 ++++ linux-2.4.18-lustre12/include/linux/slab.h Tue Aug 13 11:13:09 2002 +@@ -57,6 +57,7 @@ + extern int kmem_cache_shrink(kmem_cache_t *); + extern void *kmem_cache_alloc(kmem_cache_t *, int); + extern void kmem_cache_free(kmem_cache_t *, void *); ++extern int kmem_cache_validate(kmem_cache_t *cachep, void *objp); + + extern void *kmalloc(size_t, int); + extern void kfree(const void *); --- linux-2.4.18-lustre12-pristine/include/linux/jbd.h Tue May 7 19:43:17 2002 +++ linux-2.4.18-lustre12/include/linux/jbd.h Tue Aug 13 11:13:08 2002 @@ -257,6 +257,13 @@ @@ -339,16 +378,15 @@ extern void journal_unlock_updates (journal_t *); --- linux-2.4.18-lustre12-pristine/kernel/ksyms.c Wed Jun 26 00:16:38 2002 +++ linux-2.4.18-lustre12/kernel/ksyms.c Tue Aug 13 11:13:08 2002 -@@ -306,6 +306,13 @@ +@@ -306,6 +306,12 @@ EXPORT_SYMBOL(lock_may_write); EXPORT_SYMBOL(dcache_readdir); +/* lustre */ +EXPORT_SYMBOL(panic_notifier_list); +EXPORT_SYMBOL(pagecache_lock_cacheline); -+EXPORT_SYMBOL(kmem_cache_validate); +EXPORT_SYMBOL(do_kern_mount); -+ ++EXPORT_SYMBOL(kmem_cache_validate); + /* for stackable file systems (lofs, wrapfs, cryptfs, etc.) */ EXPORT_SYMBOL(default_llseek); @@ -375,11 +413,11 @@ +#define IT_MKNOD (1<<13) +#define IT_LOOKUP (1<<14) + -+struct lookup_intent { ++struct lookup_intent { + int it_op; + int it_mode; + int it_disposition; -+ int it_status; ++ int it_status; + struct iattr *it_iattr; + __u64 it_lock_handle[2]; + int it_lock_mode; @@ -393,7 +431,7 @@ unsigned long d_time; /* used by d_revalidate */ struct dentry_operations *d_op; struct super_block * d_sb; /* The root of the dentry tree */ -+ struct lookup_intent *d_it; ++ struct lookup_intent *d_it; unsigned long d_vfs_flags; void * d_fsdata; /* fs-specific data */ void * d_extra_attributes; /* TUX-specific data */ @@ -402,7 +440,7 @@ void (*d_release)(struct dentry *); void (*d_iput)(struct dentry *, struct inode *); + int (*d_revalidate2)(struct dentry *, int, struct lookup_intent *); -+ void (*d_intent_release)(struct dentry *); ++ void (*d_intent_release)(struct dentry *); }; /* the dentry parameter passed to d_hash and d_compare is the parent @@ -412,7 +450,7 @@ /* needed for tty driver, and maybe others */ void *private_data; -+ struct lookup_intent *f_intent; ++ struct lookup_intent *f_intent; /* preallocated helper kiobuf to speedup O_DIRECT */ struct kiobuf *f_iobuf; @@ -422,7 +460,7 @@ extern int vfs_unlink(struct inode *, struct dentry *); -extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); +int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, -+ struct inode *new_dir, struct dentry *new_dentry, ++ struct inode *new_dir, struct dentry *new_dentry, + struct lookup_intent *it); /* @@ -431,7 +469,7 @@ struct inode_operations { int (*create) (struct inode *,struct dentry *,int); struct dentry * (*lookup) (struct inode *,struct dentry *); -+ struct dentry * (*lookup2) (struct inode *,struct dentry *, struct lookup_intent *); ++ struct dentry * (*lookup2) (struct inode *,struct dentry *, struct lookup_intent *); int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *); int (*symlink) (struct inode *,struct dentry *,const char *); @@ -487,7 +525,7 @@ * XEmacs seems to be relying on it... */ -+void intent_release(struct dentry *de) ++void intent_release(struct dentry *de) +{ + if (de->d_op && de->d_op->d_intent_release) + de->d_op->d_intent_release(de); @@ -514,7 +552,7 @@ + dput(dentry); + dentry = NULL; + } -+ return dentry; ++ return dentry; + } else if (dentry && dentry->d_op && dentry->d_op->d_revalidate) { if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) { @@ -533,26 +571,25 @@ result = ERR_PTR(-ENOMEM); if (dentry) { lock_kernel(); -+ if (dir->i_op->lookup2) ++ if (dir->i_op->lookup2) + result = dir->i_op->lookup2(dir, dentry, it); -+ else ++ else result = dir->i_op->lookup(dir, dentry); unlock_kernel(); if (result) -@@ -322,6 +343,13 @@ +@@ -321,6 +342,12 @@ + dput(result); result = ERR_PTR(-ENOENT); } - } -+ else if (result->d_op && result->d_op->d_revalidate2) { ++ } else if (result->d_op && result->d_op->d_revalidate2) { + if (!result->d_op->d_revalidate2(result, flags, it) && + !d_invalidate(result)) { + dput(result); + result = ERR_PTR(-ENOENT); + } -+ } + } return result; } - @@ -447,7 +475,8 @@ * * We expect 'base' to be positive and a directory. @@ -607,7 +644,7 @@ if (lookup_flags & LOOKUP_DIRECTORY) { err = -ENOTDIR; - if (!inode->i_op || !inode->i_op->lookup) -+ if (!inode->i_op || (!inode->i_op->lookup && ++ if (!inode->i_op || (!inode->i_op->lookup && + !inode->i_op->lookup2)) break; } @@ -655,7 +692,7 @@ } /* SMP-safe */ -+int path_lookup_it(const char *path, unsigned flags, struct nameidata *nd, ++int path_lookup_it(const char *path, unsigned flags, struct nameidata *nd, + struct lookup_intent *it) +{ + int error = 0; @@ -674,7 +711,7 @@ * SMP-safe. */ -struct dentry * lookup_hash(struct qstr *name, struct dentry * base) -+struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base, ++struct dentry * lookup_hash_it(struct qstr *name, struct dentry * base, + struct lookup_intent *it) { struct dentry * dentry; @@ -691,9 +728,9 @@ if (!new) goto out; lock_kernel(); -+ if (inode->i_op->lookup2) ++ if (inode->i_op->lookup2) + dentry = inode->i_op->lookup2(inode, new, it); -+ else ++ else dentry = inode->i_op->lookup(inode, new); unlock_kernel(); if (!dentry) @@ -770,9 +807,9 @@ * Create - we need to know the parent. */ + if (it) { -+ it->it_mode = mode; -+ it->it_op |= IT_CREAT; -+ } ++ it->it_mode = mode; ++ it->it_op |= IT_CREAT; ++ } error = path_lookup(pathname, LOOKUP_PARENT, nd); if (error) return error; @@ -790,7 +827,7 @@ } + dentry->d_it = it; -+ dentry->d_it->it_mode = mode; ++ dentry->d_it->it_mode = mode; /* Negative dentry, just create the file */ if (!dentry->d_inode) { error = vfs_create(dir->d_inode, dentry, @@ -801,7 +838,7 @@ + intent_release(dentry); dput(dentry); exit: -+ intent_release(nd->dentry); ++ intent_release(nd->dentry); path_release(nd); return error; @@ -810,7 +847,7 @@ UPDATE_ATIME(dentry->d_inode); error = dentry->d_inode->i_op->follow_link(dentry, nd); + if (error) -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); if (error) return error; @@ -826,13 +863,13 @@ +int open_namei(const char *pathname, int flag, int mode, struct nameidata *nd) +{ -+ return open_namei_it(pathname, flag, mode, nd, NULL); ++ return open_namei_it(pathname, flag, mode, nd, NULL); +} + + /* SMP-safe */ -static struct dentry *lookup_create(struct nameidata *nd, int is_dir) -+static struct dentry *lookup_create(struct nameidata *nd, int is_dir, ++static struct dentry *lookup_create(struct nameidata *nd, int is_dir, + struct lookup_intent *it) { struct dentry *dentry; @@ -872,7 +909,7 @@ default: error = -EINVAL; } -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -895,7 +932,7 @@ + dentry->d_it = ⁢ error = vfs_mkdir(nd.dentry->d_inode, dentry, mode & ~current->fs->umask); -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -915,9 +952,9 @@ + dentry = lookup_hash_it(&nd.last, nd.dentry, &it); error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { -+ dentry->d_it = ⁢ ++ dentry->d_it = ⁢ error = vfs_rmdir(nd.dentry->d_inode, dentry); -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -943,7 +980,7 @@ goto slashes; error = vfs_unlink(nd.dentry->d_inode, dentry); exit2: -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -965,7 +1002,7 @@ if (!IS_ERR(dentry)) { + dentry->d_it = ⁢ error = vfs_symlink(nd.dentry->d_inode, dentry, from); -+ intent_release(dentry); ++ intent_release(dentry); dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -996,8 +1033,8 @@ */ int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, - struct inode *new_dir, struct dentry *new_dentry) -+ struct inode *new_dir, struct dentry *new_dentry, -+ struct lookup_intent *it) ++ struct inode *new_dir, struct dentry *new_dentry, ++ struct lookup_intent *it) { int error; struct inode *target; @@ -1019,8 +1056,8 @@ int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, - struct inode *new_dir, struct dentry *new_dentry) -+ struct inode *new_dir, struct dentry *new_dentry, -+ struct lookup_intent *it) ++ struct inode *new_dir, struct dentry *new_dentry, ++ struct lookup_intent *it) { int error; @@ -1072,7 +1109,7 @@ error = PTR_ERR(old_dentry); if (IS_ERR(old_dentry)) goto exit3; -@@ -1899,14 +2027,15 @@ +@@ -1899,18 +2027,21 @@ if (newnd.last.name[newnd.last.len]) goto exit4; } @@ -1089,14 +1126,21 @@ + new_dir->d_inode, new_dentry, &it); unlock_kernel(); ++ intent_release(new_dentry); dput(new_dentry); + exit4: ++ intent_release(old_dentry); + dput(old_dentry); + exit3: + double_up(&new_dir->d_inode->i_sem, &old_dir->d_inode->i_sem); --- linux-2.4.18-lustre12-pristine/fs/open.c Wed Jun 26 00:16:14 2002 +++ linux-2.4.18-lustre12/fs/open.c Tue Aug 13 11:19:36 2002 -@@ -19,6 +19,8 @@ +@@ -19,6 +19,9 @@ #include #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) -+extern int path_walk_it(const char * name, struct nameidata *nd, struct lookup_intent *it); ++extern int path_walk_it(const char *name, struct nameidata *nd, ++ struct lookup_intent *it); +extern void intent_release(struct dentry *de); int vfs_statfs(struct super_block *sb, struct statfs *buf) @@ -1196,15 +1240,16 @@ path_release(&nd); } -@@ -384,11 +397,13 @@ +@@ -384,11 +397,15 @@ { int error; struct nameidata nd; -- -- error = __user_walk(filename,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd); + struct lookup_intent it = { .it_op = IT_GETATTR }; -+ -+ error = __user_walk_it(filename,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd, &it); + +- error = __user_walk(filename,LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY,&nd); ++ error = __user_walk_it(filename, ++ LOOKUP_POSITIVE|LOOKUP_FOLLOW|LOOKUP_DIRECTORY, ++ &nd, &it); if (error) goto out; @@ -1299,13 +1344,14 @@ path_release(&nd); } return error; -@@ -637,10 +665,15 @@ +@@ -637,10 +665,16 @@ * for the internal routines (ie open_namei()/follow_link() etc). 00 is * used by symlinks. */ -+extern int open_namei_it(const char *filename, int namei_flags, int mode, ++extern int open_namei_it(const char *filename, int namei_flags, int mode, + struct nameidata *nd, struct lookup_intent *it); -+struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it); ++struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, ++ int flags, struct lookup_intent *it); + struct file *filp_open(const char * filename, int flags, int mode) { @@ -1315,7 +1361,7 @@ namei_flags = flags; if ((namei_flags+1) & O_ACCMODE) -@@ -648,14 +681,14 @@ +@@ -648,14 +681,15 @@ if (namei_flags & O_TRUNC) namei_flags |= 2; @@ -1324,14 +1370,15 @@ - return dentry_open(nd.dentry, nd.mnt, flags); + error = open_namei_it(filename, namei_flags, mode, &nd, &it); + if (error) -+ return ERR_PTR(error); ++ return ERR_PTR(error); - return ERR_PTR(error); -+ return dentry_open_it(nd.dentry, nd.mnt, flags, &it); ++ return dentry_open_it(nd.dentry, nd.mnt, flags, &it); } -struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags) -+struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it) ++struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, ++ int flags, struct lookup_intent *it) { struct file * f; struct inode *inode; @@ -1339,11 +1386,11 @@ } f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC); -+ intent_release(dentry); ++ intent_release(dentry); return f; cleanup_all: -@@ -712,11 +746,19 @@ +@@ -712,11 +746,17 @@ cleanup_file: put_filp(f); cleanup_dentry: @@ -1356,20 +1403,17 @@ +struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags) +{ + return dentry_open_it(dentry, mnt, flags, NULL); -+ +} + -+ /* * Find an empty file descriptor entry, and mark it busy. */ --- linux-2.4.18-lustre12-pristine/fs/stat.c Tue May 7 19:40:30 2002 +++ linux-2.4.18-lustre12/fs/stat.c Tue Aug 13 11:13:09 2002 -@@ -13,6 +13,8 @@ +@@ -13,6 +13,7 @@ #include -+ +extern void intent_release(struct dentry *de); /* * Revalidate the inode. This is required for proper NFS attribute caching. @@ -1378,7 +1422,7 @@ { struct nameidata nd; int error; -+ struct lookup_intent it = { IT_GETATTR}; ++ struct lookup_intent it = { .it_op = IT_GETATTR }; - error = user_path_walk(name, &nd); + error = user_path_walk_it(name, &nd, &it); @@ -1388,12 +1432,11 @@ path_release(&nd); } return error; -@@ -117,10 +121,13 @@ +@@ -117,10 +121,12 @@ { struct nameidata nd; int error; -+ struct lookup_intent it = { IT_GETATTR}; -+ ++ struct lookup_intent it = { .it_op = IT_GETATTR }; - error = user_path_walk_link(name, &nd); + error = user_path_walk_link_it(name, &nd, &it); @@ -1405,7 +1448,7 @@ return error; --- linux-2.4.18-lustre12-pristine/mm/slab.c Wed Jun 26 00:16:40 2002 +++ linux-2.4.18-lustre12/mm/slab.c Tue Aug 13 11:13:09 2002 -@@ -1207,6 +1207,58 @@ +@@ -1207,6 +1207,59 @@ * Called with the cache-lock held. */ @@ -1416,6 +1459,7 @@ +{ + int i; + unsigned int objnr; ++ +#if DEBUG + if (cachep->flags & SLAB_RED_ZONE) { + objp -= BYTES_PER_WORD; @@ -1446,7 +1490,7 @@ + +int kmem_cache_validate(kmem_cache_t *cachep, void *objp) +{ -+ struct page *page = check_get_page((unsigned long)objp); ++ struct page *page = check_get_page((unsigned long)objp); + + if (!VALID_PAGE(page)) + return 0; @@ -1454,8 +1498,8 @@ + if (!PageSlab(page)) + return 0; + -+ /* XXX check for freed slab objects ? */ -+ if (!kmem_check_cache_obj(cachep, GET_PAGE_SLAB(page), objp)) ++ /* XXX check for freed slab objects ? */ ++ if (!kmem_check_cache_obj(cachep, GET_PAGE_SLAB(page), objp)) + return 0; + + return (cachep == GET_PAGE_CACHE(page)); @@ -1464,33 +1508,6 @@ #if DEBUG static int kmem_extra_free_checks (kmem_cache_t * cachep, slab_t *slabp, void * objp) ---- linux-2.4.18-lustre12-pristine/arch/i386/mm/init.c Wed Jun 26 00:15:21 2002 -+++ linux-2.4.18-lustre12/arch/i386/mm/init.c Tue Aug 13 11:13:09 2002 -@@ -43,6 +43,14 @@ - static unsigned long totalram_pages; - static unsigned long totalhigh_pages; - -+ -+struct page *check_get_page(unsigned long kaddr) -+{ -+#warning FIXME: Lustre team, is this solid enough? -+ return virt_to_page(kaddr); -+} -+ -+ - int do_check_pgt_cache(int low, int high) - { - int freed = 0; ---- linux-2.4.18-lustre12-pristine/include/linux/slab.h Wed Jun 26 00:16:34 2002 -+++ linux-2.4.18-lustre12/include/linux/slab.h Tue Aug 13 11:13:09 2002 -@@ -57,6 +57,7 @@ - extern int kmem_cache_shrink(kmem_cache_t *); - extern void *kmem_cache_alloc(kmem_cache_t *, int); - extern void kmem_cache_free(kmem_cache_t *, void *); -+extern int kmem_cache_validate(kmem_cache_t *cachep, void *objp); - - extern void *kmalloc(size_t, int); - extern void kfree(const void *); --- linux-2.4.18-lustre12-pristine/scripts/mkspec Wed Jun 26 00:16:49 2002 +++ linux-2.4.18-lustre12/scripts/mkspec Tue Aug 13 11:13:09 2002 @@ -64,6 +64,7 @@ -- 1.8.3.1