From 13fec647bf23aa67712934112f507104b97a1cd3 Mon Sep 17 00:00:00 2001 From: ericm Date: Fri, 1 Aug 2003 03:54:47 +0000 Subject: [PATCH] merge b_devel to b_eq again: 20030801, for convenience of WangDi. --- .../patches/ext3-no-write-super.patch | 16 ++ .../patches/ext3-o_direct-1-2.4.18-chaos.patch | 198 +++++++++++++ .../patches/vfs_intent-2.4.20-rh.patch | 319 +++++++++++---------- lustre/kernel_patches/pc/ext3-no-write-super.pc | 1 + .../pc/ext3-o_direct-1-2.4.18-chaos.pc | 1 + 5 files changed, 387 insertions(+), 148 deletions(-) create mode 100644 lustre/kernel_patches/patches/ext3-no-write-super.patch create mode 100644 lustre/kernel_patches/patches/ext3-o_direct-1-2.4.18-chaos.patch create mode 100644 lustre/kernel_patches/pc/ext3-no-write-super.pc create mode 100644 lustre/kernel_patches/pc/ext3-o_direct-1-2.4.18-chaos.pc diff --git a/lustre/kernel_patches/patches/ext3-no-write-super.patch b/lustre/kernel_patches/patches/ext3-no-write-super.patch new file mode 100644 index 0000000..b096276 --- /dev/null +++ b/lustre/kernel_patches/patches/ext3-no-write-super.patch @@ -0,0 +1,16 @@ + +--- linux-2.4.18/fs/ext3/super.c~ext3-no-write-super Mon Jul 28 14:13:05 2003 ++++ linux-2.4.18-alexey/fs/ext3/super.c Mon Jul 28 16:14:11 2003 +@@ -1818,7 +1818,10 @@ void ext3_write_super (struct super_bloc + if (down_trylock(&sb->s_lock) == 0) + BUG(); + sb->s_dirt = 0; ++#if 0 ++ /* we really don't need this, jbd makes periodical commits by itself */ + log_start_commit(EXT3_SB(sb)->s_journal, NULL); ++#endif + } + + static int ext3_sync_fs(struct super_block *sb) + +_ diff --git a/lustre/kernel_patches/patches/ext3-o_direct-1-2.4.18-chaos.patch b/lustre/kernel_patches/patches/ext3-o_direct-1-2.4.18-chaos.patch new file mode 100644 index 0000000..04f4948 --- /dev/null +++ b/lustre/kernel_patches/patches/ext3-o_direct-1-2.4.18-chaos.patch @@ -0,0 +1,198 @@ + +--- linux-2.4.18/fs/ext3/inode.c~ext3-o_direct-1-2.4.18-chaos Mon Jul 28 14:13:05 2003 ++++ linux-2.4.18-alexey/fs/ext3/inode.c Mon Jul 28 15:50:14 2003 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -733,9 +734,9 @@ err_out: + * The BKL may not be held on entry here. Be sure to take it early. + */ + +-static int ext3_get_block_handle(handle_t *handle, struct inode *inode, +- long iblock, +- struct buffer_head *bh_result, int create) ++static int ++ext3_get_block_handle(handle_t *handle, struct inode *inode, long iblock, ++ struct buffer_head *bh_result, int create, int extend_disksize) + { + int err = -EIO; + int offsets[4]; +@@ -816,16 +817,18 @@ out: + if (err) + goto cleanup; + +- new_size = inode->i_size; +- /* +- * This is not racy against ext3_truncate's modification of i_disksize +- * because VM/VFS ensures that the file cannot be extended while +- * truncate is in progress. It is racy between multiple parallel +- * instances of get_block, but we have the BKL. +- */ +- if (new_size > ei->i_disksize) +- ei->i_disksize = new_size; +- ++ if (extend_disksize) { ++ /* ++ * This is not racy against ext3_truncate's modification of ++ * i_disksize because VM/VFS ensures that the file cannot be ++ * extended while truncate is in progress. It is racy between ++ * multiple parallel instances of get_block, but we have BKL. ++ */ ++ struct ext3_inode_info *ei = EXT3_I(inode); ++ new_size = inode->i_size; ++ if (new_size > ei->i_disksize) ++ ei->i_disksize = new_size; ++ } + bh_result->b_state |= (1UL << BH_New); + goto got_it; + +@@ -852,7 +855,38 @@ static int ext3_get_block(struct inode * + handle = ext3_journal_current_handle(); + J_ASSERT(handle != 0); + } +- ret = ext3_get_block_handle(handle, inode, iblock, bh_result, create); ++ ret = ext3_get_block_handle(handle, inode, iblock, ++ bh_result, create, 1); ++ return ret; ++} ++ ++#define DIO_CREDITS (EXT3_RESERVE_TRANS_BLOCKS + 32) ++ ++static int ++ext3_direct_io_get_block(struct inode *inode, long iblock, ++ struct buffer_head *bh_result, int create) ++{ ++ handle_t *handle = journal_current_handle(); ++ int ret = 0; ++ ++ lock_kernel(); ++ if (handle && handle->h_buffer_credits <= EXT3_RESERVE_TRANS_BLOCKS) { ++ /* ++ * Getting low on buffer credits... ++ */ ++ if (!ext3_journal_extend(handle, DIO_CREDITS)) { ++ /* ++ * Couldn't extend the transaction. Start a new one ++ */ ++ ret = ext3_journal_restart(handle, DIO_CREDITS); ++ } ++ } ++ if (ret == 0) ++ ret = ext3_get_block_handle(handle, inode, iblock, ++ bh_result, create, 0); ++ if (ret == 0) ++ bh_result->b_size = (1 << inode->i_blkbits); ++ unlock_kernel(); + return ret; + } + +@@ -870,7 +904,7 @@ struct buffer_head *ext3_getblk(handle_t + dummy.b_state = 0; + dummy.b_blocknr = -1000; + buffer_trace_init(&dummy.b_history); +- *errp = ext3_get_block_handle(handle, inode, block, &dummy, create); ++ *errp = ext3_get_block_handle(handle, inode, block, &dummy, create, 1); + if (!*errp && buffer_mapped(&dummy)) { + struct buffer_head *bh; + bh = sb_getblk(inode->i_sb, dummy.b_blocknr); +@@ -1380,6 +1414,67 @@ static int ext3_releasepage(struct page + return journal_try_to_free_buffers(journal, page, wait); + } + ++static int ++ext3_direct_IO(int rw, struct inode *inode, struct kiobuf *iobuf, ++ unsigned long blocknr, int blocksize) ++{ ++ struct ext3_inode_info *ei = EXT3_I(inode); ++ handle_t *handle = NULL; ++ int ret; ++ int orphan = 0; ++ loff_t offset = blocknr << inode->i_blkbits; /* ugh */ ++ ssize_t count = iobuf->length; /* ditto */ ++ ++ if (rw == WRITE) { ++ loff_t final_size = offset + count; ++ ++ lock_kernel(); ++ handle = ext3_journal_start(inode, DIO_CREDITS); ++ unlock_kernel(); ++ if (IS_ERR(handle)) { ++ ret = PTR_ERR(handle); ++ goto out; ++ } ++ if (final_size > inode->i_size) { ++ lock_kernel(); ++ ret = ext3_orphan_add(handle, inode); ++ unlock_kernel(); ++ if (ret) ++ goto out_stop; ++ orphan = 1; ++ ei->i_disksize = inode->i_size; ++ } ++ } ++ ++ ret = generic_direct_IO(rw, inode, iobuf, blocknr, ++ blocksize, ext3_direct_io_get_block); ++ ++out_stop: ++ if (handle) { ++ int err; ++ ++ lock_kernel(); ++ if (orphan) ++ ext3_orphan_del(handle, inode); ++ if (orphan && ret > 0) { ++ loff_t end = offset + ret; ++ if (end > inode->i_size) { ++ ei->i_disksize = end; ++ inode->i_size = end; ++ err = ext3_mark_inode_dirty(handle, inode); ++ if (!ret) ++ ret = err; ++ } ++ } ++ err = ext3_journal_stop(handle, inode); ++ if (ret == 0) ++ ret = err; ++ unlock_kernel(); ++ } ++out: ++ return ret; ++ ++} + + struct address_space_operations ext3_aops = { + readpage: ext3_readpage, /* BKL not held. Don't need */ +@@ -1390,6 +1485,7 @@ struct address_space_operations ext3_aop + bmap: ext3_bmap, /* BKL held */ + flushpage: ext3_flushpage, /* BKL not held. Don't need */ + releasepage: ext3_releasepage, /* BKL not held. Don't need */ ++ direct_IO: ext3_direct_IO, /* BKL not held. Don't need */ + }; + + /* +@@ -2987,7 +3083,7 @@ int ext3_prep_san_write(struct inode *in + /* alloc blocks one by one */ + for (i = 0; i < nblocks; i++) { + ret = ext3_get_block_handle(handle, inode, blocks[i], +- &bh_tmp, 1); ++ &bh_tmp, 1, 1); + if (ret) + break; + +@@ -3047,7 +3143,7 @@ int ext3_map_inode_page(struct inode *in + if (blocks[i] != 0) + continue; + +- rc = ext3_get_block_handle(handle, inode, iblock, &dummy, 1); ++ rc = ext3_get_block_handle(handle, inode, iblock, &dummy, 1, 1); + if (rc) { + printk(KERN_INFO "ext3_map_inode_page: error reading " + "block %ld\n", iblock); + +_ diff --git a/lustre/kernel_patches/patches/vfs_intent-2.4.20-rh.patch b/lustre/kernel_patches/patches/vfs_intent-2.4.20-rh.patch index 7aa5941..92df0a6 100644 --- a/lustre/kernel_patches/patches/vfs_intent-2.4.20-rh.patch +++ b/lustre/kernel_patches/patches/vfs_intent-2.4.20-rh.patch @@ -1,8 +1,10 @@ 0 files changed ---- linux-2.4.20/fs/dcache.c~vfs_intent-2.4.20-rh 2003-07-17 08:32:59.000000000 -0700 -+++ linux-2.4.20-mmonroe/fs/dcache.c 2003-07-17 08:35:22.000000000 -0700 -@@ -186,6 +186,13 @@ int d_invalidate(struct dentry * dentry) +Index: linux-2.4.20-rh/fs/dcache.c +=================================================================== +--- linux-2.4.20-rh.orig/fs/dcache.c 2003-07-29 11:36:40.000000000 +0800 ++++ linux-2.4.20-rh/fs/dcache.c 2003-07-30 17:56:16.000000000 +0800 +@@ -186,6 +186,13 @@ spin_unlock(&dcache_lock); return 0; } @@ -16,7 +18,7 @@ /* * Check whether to do a partial shrink_dcache * to get rid of unused child entries. -@@ -839,13 +846,19 @@ void d_delete(struct dentry * dentry) +@@ -841,13 +848,19 @@ * Adds a dentry to the hash according to its name. */ @@ -39,8 +41,10 @@ } #define do_switch(x,y) do { \ ---- linux-2.4.20/fs/namei.c~vfs_intent-2.4.20-rh 2003-07-17 08:32:47.000000000 -0700 -+++ linux-2.4.20-mmonroe/fs/namei.c 2003-07-17 08:35:22.000000000 -0700 +Index: linux-2.4.20-rh/fs/namei.c +=================================================================== +--- linux-2.4.20-rh.orig/fs/namei.c 2003-07-29 11:36:22.000000000 +0800 ++++ linux-2.4.20-rh/fs/namei.c 2003-07-30 18:00:29.000000000 +0800 @@ -94,6 +94,13 @@ * XEmacs seems to be relying on it... */ @@ -55,7 +59,7 @@ /* In order to reduce some races, while at the same time doing additional * checking and hopefully speeding things up, we copy filenames to the * kernel data space before using them.. -@@ -260,10 +267,19 @@ void path_release(struct nameidata *nd) +@@ -260,10 +267,19 @@ * Internal lookup() using the new generic dcache. * SMP-safe */ @@ -76,7 +80,7 @@ if (dentry && dentry->d_op && dentry->d_op->d_revalidate) { if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) { dput(dentry); -@@ -281,11 +297,14 @@ static struct dentry * cached_lookup(str +@@ -281,11 +297,14 @@ * make sure that nobody added the entry to the dcache in the meantime.. * SMP-safe */ @@ -92,7 +96,7 @@ down(&dir->i_sem); /* * First re-do the cached lookup just in case it was created -@@ -300,6 +319,9 @@ static struct dentry * real_lookup(struc +@@ -300,6 +319,9 @@ result = ERR_PTR(-ENOMEM); if (dentry) { lock_kernel(); @@ -102,7 +106,7 @@ result = dir->i_op->lookup(dir, dentry); unlock_kernel(); if (result) -@@ -321,6 +343,12 @@ static struct dentry * real_lookup(struc +@@ -321,6 +343,12 @@ dput(result); result = ERR_PTR(-ENOENT); } @@ -115,7 +119,7 @@ } return result; } -@@ -334,7 +362,8 @@ int max_recursive_link = 5; +@@ -334,7 +362,8 @@ * Without that kind of total limit, nasty chains of consecutive * symlinks can cause almost arbitrarily long lookups. */ @@ -125,13 +129,13 @@ { int err; if (current->link_count >= max_recursive_link) -@@ -348,10 +377,18 @@ static inline int do_follow_link(struct +@@ -348,10 +377,18 @@ current->link_count++; current->total_link_count++; UPDATE_ATIME(dentry->d_inode); -+ nd->it = it; ++ nd->intent = it; err = dentry->d_inode->i_op->follow_link(dentry, nd); -+ if (!err && it != NULL && !(it->it_int_flags & IT_FL_FOLLOWED)) { ++ if (!err && it != NULL && !(it->d.lustre.it_int_flags & IT_FL_FOLLOWED)) { + /* vfs_follow_link was never called */ + intent_release(it); + path_release(nd); @@ -144,7 +148,7 @@ path_release(nd); return -ELOOP; } -@@ -381,15 +418,26 @@ int follow_up(struct vfsmount **mnt, str +@@ -381,15 +418,26 @@ return __follow_up(mnt, dentry); } @@ -162,17 +166,17 @@ spin_unlock(&dcache_lock); + if (it) { + opc = it->it_op; -+ mode = it->it_mode; ++ mode = it->it_create_mode; + } + intent_release(it); + if (it) { + it->it_op = opc; -+ it->it_mode = mode; ++ it->it_create_mode = mode; + } dput(*dentry); mntput(mounted->mnt_parent); *dentry = dget(mounted->mnt_root); -@@ -401,7 +449,7 @@ static inline int __follow_down(struct v +@@ -401,7 +449,7 @@ int follow_down(struct vfsmount **mnt, struct dentry **dentry) { @@ -181,7 +185,7 @@ } static inline void follow_dotdot(struct nameidata *nd) -@@ -437,7 +485,7 @@ static inline void follow_dotdot(struct +@@ -437,7 +485,7 @@ mntput(nd->mnt); nd->mnt = parent; } @@ -190,7 +194,7 @@ ; } -@@ -449,7 +497,8 @@ static inline void follow_dotdot(struct +@@ -449,7 +497,8 @@ * * We expect 'base' to be positive and a directory. */ @@ -200,7 +204,7 @@ { struct dentry *dentry; struct inode *inode; -@@ -526,19 +575,18 @@ int link_path_walk(const char * name, st +@@ -526,19 +575,18 @@ break; } /* This does the actual lookups.. */ @@ -223,7 +227,7 @@ err = -ENOENT; inode = dentry->d_inode; -@@ -549,7 +597,7 @@ int link_path_walk(const char * name, st +@@ -549,7 +597,7 @@ goto out_dput; if (inode->i_op->follow_link) { @@ -232,7 +236,7 @@ dput(dentry); if (err) goto return_err; -@@ -565,7 +613,7 @@ int link_path_walk(const char * name, st +@@ -565,7 +613,7 @@ nd->dentry = dentry; } err = -ENOTDIR; @@ -241,7 +245,7 @@ break; continue; /* here ends the main loop */ -@@ -592,22 +640,22 @@ last_component: +@@ -592,22 +640,22 @@ if (err < 0) break; } @@ -268,7 +272,7 @@ dput(dentry); if (err) goto return_err; -@@ -621,7 +669,8 @@ last_component: +@@ -621,7 +669,8 @@ goto no_inode; if (lookup_flags & LOOKUP_DIRECTORY) { err = -ENOTDIR; @@ -278,7 +282,7 @@ break; } goto return_base; -@@ -645,6 +694,23 @@ return_reval: +@@ -645,6 +694,23 @@ * Check the cached dentry for staleness. */ dentry = nd->dentry; @@ -302,7 +306,7 @@ if (dentry && dentry->d_op && dentry->d_op->d_revalidate) { err = -ESTALE; if (!dentry->d_op->d_revalidate(dentry, 0)) { -@@ -658,15 +724,28 @@ out_dput: +@@ -658,15 +724,28 @@ dput(dentry); break; } @@ -332,7 +336,7 @@ } /* SMP-safe */ -@@ -751,6 +830,17 @@ walk_init_root(const char *name, struct +@@ -751,6 +830,17 @@ } /* SMP-safe */ @@ -350,15 +354,15 @@ int path_lookup(const char *path, unsigned flags, struct nameidata *nd) { int error = 0; -@@ -765,6 +855,7 @@ int path_init(const char *name, unsigned +@@ -765,6 +855,7 @@ { nd->last_type = LAST_ROOT; /* if there are only slashes... */ nd->flags = flags; -+ nd->it = NULL; ++ nd->intent = NULL; if (*name=='/') return walk_init_root(name,nd); read_lock(¤t->fs->lock); -@@ -779,7 +870,8 @@ int path_init(const char *name, unsigned +@@ -779,7 +870,8 @@ * needs parent already locked. Doesn't follow mounts. * SMP-safe. */ @@ -368,7 +372,7 @@ { struct dentry * dentry; struct inode *inode; -@@ -802,13 +894,16 @@ struct dentry * lookup_hash(struct qstr +@@ -802,13 +894,16 @@ goto out; } @@ -386,7 +390,7 @@ dentry = inode->i_op->lookup(inode, new); unlock_kernel(); if (!dentry) -@@ -820,6 +915,12 @@ out: +@@ -820,6 +915,12 @@ return dentry; } @@ -399,7 +403,7 @@ /* SMP-safe */ struct dentry * lookup_one_len(const char * name, struct dentry * base, int len) { -@@ -841,7 +942,7 @@ struct dentry * lookup_one_len(const cha +@@ -841,7 +942,7 @@ } this.hash = end_name_hash(hash); @@ -408,7 +412,7 @@ access: return ERR_PTR(-EACCES); } -@@ -872,6 +973,23 @@ int __user_walk(const char *name, unsign +@@ -872,6 +973,23 @@ return err; } @@ -432,7 +436,7 @@ /* * It's inline, so penalty for filesystems that don't use sticky bit is * minimal. -@@ -969,7 +1087,8 @@ static inline int lookup_flags(unsigned +@@ -969,7 +1087,8 @@ return retval; } @@ -442,7 +446,7 @@ { int error; -@@ -982,12 +1101,15 @@ int vfs_create(struct inode *dir, struct +@@ -982,12 +1101,15 @@ goto exit_lock; error = -EACCES; /* shouldn't it be ENOSYS? */ @@ -460,7 +464,7 @@ unlock_kernel(); exit_lock: up(&dir->i_zombie); -@@ -996,6 +1118,11 @@ exit_lock: +@@ -996,6 +1118,11 @@ return error; } @@ -472,7 +476,7 @@ /* * open_namei() * -@@ -1010,7 +1137,8 @@ exit_lock: +@@ -1010,7 +1137,8 @@ * for symlinks (where the permissions are checked later). * SMP-safe */ @@ -482,7 +486,7 @@ { int acc_mode, error = 0; struct inode *inode; -@@ -1024,7 +1152,7 @@ int open_namei(const char * pathname, in +@@ -1024,7 +1152,7 @@ * The simplest case - just a plain lookup. */ if (!(flag & O_CREAT)) { @@ -491,18 +495,18 @@ if (error) return error; dentry = nd->dentry; -@@ -1034,6 +1162,10 @@ int open_namei(const char * pathname, in +@@ -1034,6 +1162,10 @@ /* * Create - we need to know the parent. */ + if (it) { -+ it->it_mode = mode; ++ it->it_create_mode = mode; + it->it_op |= IT_CREAT; + } error = path_lookup(pathname, LOOKUP_PARENT, nd); if (error) return error; -@@ -1049,7 +1181,7 @@ int open_namei(const char * pathname, in +@@ -1049,7 +1181,7 @@ dir = nd->dentry; down(&dir->d_inode->i_sem); @@ -511,11 +515,11 @@ do_last: error = PTR_ERR(dentry); -@@ -1058,10 +1190,11 @@ do_last: +@@ -1058,10 +1190,11 @@ goto exit; } -+ it->it_mode = mode; ++ it->it_create_mode = mode; /* Negative dentry, just create the file */ if (!dentry->d_inode) { - error = vfs_create(dir->d_inode, dentry, @@ -525,7 +529,7 @@ up(&dir->d_inode->i_sem); dput(nd->dentry); nd->dentry = dentry; -@@ -1086,7 +1219,7 @@ do_last: +@@ -1086,7 +1219,7 @@ error = -ELOOP; if (flag & O_NOFOLLOW) goto exit_dput; @@ -534,7 +538,7 @@ } error = -ENOENT; if (!dentry->d_inode) -@@ -1165,7 +1298,7 @@ ok: +@@ -1165,7 +1298,7 @@ if (!error) { DQUOT_INIT(inode); @@ -543,7 +547,7 @@ } put_write_access(inode); if (error) -@@ -1177,8 +1310,10 @@ ok: +@@ -1177,8 +1310,10 @@ return 0; exit_dput: @@ -554,15 +558,15 @@ path_release(nd); return error; -@@ -1197,7 +1332,16 @@ do_link: +@@ -1197,7 +1332,16 @@ * are done. Procfs-like symlinks just set LAST_BIND. */ UPDATE_ATIME(dentry->d_inode); -+ nd->it = it; ++ nd->intent = it; error = dentry->d_inode->i_op->follow_link(dentry, nd); + if (error) { + intent_release(it); -+ } else if (it != NULL && !(it->it_int_flags & IT_FL_FOLLOWED)) { ++ } else if (it != NULL && !(it->d.lustre.it_int_flags & IT_FL_FOLLOWED)) { + /* vfs_follow_link was never called */ + intent_release(it); + path_release(nd); @@ -571,7 +575,7 @@ dput(dentry); if (error) return error; -@@ -1219,13 +1363,20 @@ do_link: +@@ -1219,13 +1363,20 @@ } dir = nd->dentry; down(&dir->d_inode->i_sem); @@ -594,7 +598,7 @@ { struct dentry *dentry; -@@ -1233,7 +1384,7 @@ static struct dentry *lookup_create(stru +@@ -1233,7 +1384,7 @@ dentry = ERR_PTR(-EEXIST); if (nd->last_type != LAST_NORM) goto fail; @@ -603,7 +607,7 @@ if (IS_ERR(dentry)) goto fail; if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode) -@@ -1289,7 +1440,16 @@ asmlinkage long sys_mknod(const char * f +@@ -1289,7 +1440,16 @@ error = path_lookup(tmp, LOOKUP_PARENT, &nd); if (error) goto out; @@ -621,7 +625,7 @@ error = PTR_ERR(dentry); mode &= ~current->fs->umask; -@@ -1310,6 +1470,7 @@ asmlinkage long sys_mknod(const char * f +@@ -1310,6 +1470,7 @@ dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -629,7 +633,7 @@ path_release(&nd); out: putname(tmp); -@@ -1357,7 +1518,14 @@ asmlinkage long sys_mkdir(const char * p +@@ -1357,7 +1518,14 @@ error = path_lookup(tmp, LOOKUP_PARENT, &nd); if (error) goto out; @@ -645,7 +649,7 @@ error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { error = vfs_mkdir(nd.dentry->d_inode, dentry, -@@ -1365,6 +1533,7 @@ asmlinkage long sys_mkdir(const char * p +@@ -1365,6 +1533,7 @@ dput(dentry); } up(&nd.dentry->d_inode->i_sem); @@ -653,7 +657,7 @@ path_release(&nd); out: putname(tmp); -@@ -1465,8 +1634,16 @@ asmlinkage long sys_rmdir(const char * p +@@ -1465,8 +1634,16 @@ error = -EBUSY; goto exit1; } @@ -671,7 +675,7 @@ error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { error = vfs_rmdir(nd.dentry->d_inode, dentry); -@@ -1524,8 +1701,15 @@ asmlinkage long sys_unlink(const char * +@@ -1524,8 +1701,15 @@ error = -EISDIR; if (nd.last_type != LAST_NORM) goto exit1; @@ -688,7 +692,7 @@ error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { /* Why not before? Because we want correct error value */ -@@ -1592,15 +1776,23 @@ asmlinkage long sys_symlink(const char * +@@ -1592,15 +1776,23 @@ error = path_lookup(to, LOOKUP_PARENT, &nd); if (error) goto out; @@ -714,7 +718,7 @@ putname(to); } putname(from); -@@ -1676,7 +1868,14 @@ asmlinkage long sys_link(const char * ol +@@ -1676,7 +1868,14 @@ error = -EXDEV; if (old_nd.mnt != nd.mnt) goto out_release; @@ -730,7 +734,7 @@ error = PTR_ERR(new_dentry); if (!IS_ERR(new_dentry)) { error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry); -@@ -1720,7 +1919,7 @@ exit: +@@ -1720,7 +1919,7 @@ * locking]. */ int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, @@ -739,7 +743,7 @@ { int error; struct inode *target; -@@ -1799,7 +1998,7 @@ out_unlock: +@@ -1799,7 +1998,7 @@ } int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, @@ -748,7 +752,7 @@ { int error; -@@ -1887,9 +2086,18 @@ static inline int do_rename(const char * +@@ -1887,9 +2086,18 @@ if (newnd.last_type != LAST_NORM) goto exit2; @@ -768,7 +772,7 @@ error = PTR_ERR(old_dentry); if (IS_ERR(old_dentry)) goto exit3; -@@ -1905,16 +2113,16 @@ static inline int do_rename(const char * +@@ -1905,16 +2113,16 @@ if (newnd.last.name[newnd.last.len]) goto exit4; } @@ -787,7 +791,7 @@ dput(new_dentry); exit4: dput(old_dentry); -@@ -1965,20 +2173,28 @@ out: +@@ -1965,20 +2173,28 @@ } static inline int @@ -801,11 +805,11 @@ goto fail; + if (it == NULL) -+ it = nd->it; -+ else if (it != nd->it) -+ printk("it != nd->it: tell phil@clusterfs.com\n"); ++ it = nd->intent; ++ else if (it != nd->intent) ++ printk("it != nd->intent: tell phil@clusterfs.com\n"); + if (it != NULL) -+ it->it_int_flags |= IT_FL_FOLLOWED; ++ it->d.lustre.it_int_flags |= IT_FL_FOLLOWED; + if (*link == '/') { path_release(nd); @@ -818,7 +822,7 @@ out: if (current->link_count || res || nd->last_type!=LAST_NORM) return res; -@@ -2002,7 +2218,13 @@ fail: +@@ -2002,7 +2218,13 @@ int vfs_follow_link(struct nameidata *nd, const char *link) { @@ -833,7 +837,7 @@ } /* get the link contents into pagecache */ -@@ -2044,7 +2266,7 @@ int page_follow_link(struct dentry *dent +@@ -2044,7 +2266,7 @@ { struct page *page = NULL; char *s = page_getlink(dentry, &page); @@ -842,8 +846,10 @@ if (page) { kunmap(page); page_cache_release(page); ---- linux-2.4.20/fs/open.c~vfs_intent-2.4.20-rh 2003-07-17 08:32:45.000000000 -0700 -+++ linux-2.4.20-mmonroe/fs/open.c 2003-07-17 08:35:22.000000000 -0700 +Index: linux-2.4.20-rh/fs/open.c +=================================================================== +--- linux-2.4.20-rh.orig/fs/open.c 2003-07-29 11:36:22.000000000 +0800 ++++ linux-2.4.20-rh/fs/open.c 2003-07-30 17:56:16.000000000 +0800 @@ -19,6 +19,8 @@ #include @@ -853,7 +859,7 @@ int vfs_statfs(struct super_block *sb, struct statfs *buf) { -@@ -95,9 +97,10 @@ void fd_install(unsigned int fd, struct +@@ -95,9 +97,10 @@ write_unlock(&files->file_lock); } @@ -865,7 +871,7 @@ int error; struct iattr newattrs; -@@ -108,7 +111,13 @@ int do_truncate(struct dentry *dentry, l +@@ -108,7 +111,13 @@ down(&inode->i_sem); newattrs.ia_size = length; newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; @@ -880,7 +886,7 @@ up(&inode->i_sem); return error; } -@@ -118,12 +127,13 @@ static inline long do_sys_truncate(const +@@ -118,12 +127,13 @@ struct nameidata nd; struct inode * inode; int error; @@ -895,7 +901,7 @@ if (error) goto out; inode = nd.dentry->d_inode; -@@ -163,11 +173,13 @@ static inline long do_sys_truncate(const +@@ -163,11 +173,13 @@ error = locks_verify_truncate(inode, NULL, length); if (!error) { DQUOT_INIT(inode); @@ -910,7 +916,7 @@ path_release(&nd); out: return error; -@@ -215,7 +227,7 @@ static inline long do_sys_ftruncate(unsi +@@ -215,7 +227,7 @@ error = locks_verify_truncate(inode, file, length); if (!error) @@ -919,7 +925,7 @@ out_putf: fput(file); out: -@@ -260,11 +272,13 @@ asmlinkage long sys_utime(char * filenam +@@ -260,11 +272,13 @@ struct inode * inode; struct iattr newattrs; @@ -934,7 +940,7 @@ error = -EROFS; if (IS_RDONLY(inode)) goto dput_and_out; -@@ -279,11 +293,25 @@ asmlinkage long sys_utime(char * filenam +@@ -279,11 +293,25 @@ goto dput_and_out; newattrs.ia_valid |= ATTR_ATIME_SET | ATTR_MTIME_SET; @@ -961,7 +967,7 @@ error = notify_change(nd.dentry, &newattrs); dput_and_out: path_release(&nd); -@@ -304,12 +332,14 @@ asmlinkage long sys_utimes(char * filena +@@ -304,12 +332,14 @@ struct inode * inode; struct iattr newattrs; @@ -977,7 +983,7 @@ error = -EROFS; if (IS_RDONLY(inode)) goto dput_and_out; -@@ -324,7 +354,20 @@ asmlinkage long sys_utimes(char * filena +@@ -324,7 +354,20 @@ newattrs.ia_atime = times[0].tv_sec; newattrs.ia_mtime = times[1].tv_sec; newattrs.ia_valid |= ATTR_ATIME_SET | ATTR_MTIME_SET; @@ -999,7 +1005,7 @@ if (current->fsuid != inode->i_uid && (error = permission(inode,MAY_WRITE)) != 0) goto dput_and_out; -@@ -347,6 +390,7 @@ asmlinkage long sys_access(const char * +@@ -347,6 +390,7 @@ int old_fsuid, old_fsgid; kernel_cap_t old_cap; int res; @@ -1007,7 +1013,7 @@ if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ return -EINVAL; -@@ -364,13 +408,14 @@ asmlinkage long sys_access(const char * +@@ -364,13 +408,14 @@ else current->cap_effective = current->cap_permitted; @@ -1023,7 +1029,7 @@ path_release(&nd); } -@@ -385,8 +430,9 @@ asmlinkage long sys_chdir(const char * f +@@ -385,8 +430,9 @@ { int error; struct nameidata nd; @@ -1034,7 +1040,7 @@ if (error) goto out; -@@ -397,6 +443,7 @@ asmlinkage long sys_chdir(const char * f +@@ -397,6 +443,7 @@ set_fs_pwd(current->fs, nd.mnt, nd.dentry); dput_and_out: @@ -1042,7 +1048,7 @@ path_release(&nd); out: return error; -@@ -436,9 +483,10 @@ asmlinkage long sys_chroot(const char * +@@ -436,9 +483,10 @@ { int error; struct nameidata nd; @@ -1055,7 +1061,7 @@ if (error) goto out; -@@ -454,6 +502,7 @@ asmlinkage long sys_chroot(const char * +@@ -454,6 +502,7 @@ set_fs_altroot(); error = 0; dput_and_out: @@ -1063,7 +1069,7 @@ path_release(&nd); out: return error; -@@ -508,6 +557,18 @@ asmlinkage long sys_chmod(const char * f +@@ -508,6 +557,18 @@ if (IS_RDONLY(inode)) goto dput_and_out; @@ -1082,7 +1088,7 @@ error = -EPERM; if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) goto dput_and_out; -@@ -538,6 +599,20 @@ static int chown_common(struct dentry * +@@ -538,6 +599,20 @@ error = -EROFS; if (IS_RDONLY(inode)) goto out; @@ -1103,7 +1109,7 @@ error = -EPERM; if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) goto out; -@@ -642,8 +717,9 @@ struct file *filp_open(const char * file +@@ -642,8 +717,9 @@ { int namei_flags, error; struct nameidata nd; @@ -1115,7 +1121,7 @@ namei_flags = flags; if ((namei_flags+1) & O_ACCMODE) -@@ -651,14 +727,15 @@ struct file *filp_open(const char * file +@@ -651,14 +727,15 @@ if (namei_flags & O_TRUNC) namei_flags |= 2; @@ -1136,7 +1142,7 @@ { struct file * f; struct inode *inode; -@@ -695,12 +772,15 @@ struct file *dentry_open(struct dentry * +@@ -695,12 +772,15 @@ } if (f->f_op && f->f_op->open) { @@ -1152,7 +1158,7 @@ return f; cleanup_all: -@@ -715,11 +795,17 @@ cleanup_all: +@@ -715,11 +795,17 @@ cleanup_file: put_filp(f); cleanup_dentry: @@ -1170,8 +1176,10 @@ /* * Find an empty file descriptor entry, and mark it busy. */ ---- linux-2.4.20/fs/stat.c~vfs_intent-2.4.20-rh 2003-07-17 08:33:05.000000000 -0700 -+++ linux-2.4.20-mmonroe/fs/stat.c 2003-07-17 08:51:33.000000000 -0700 +Index: linux-2.4.20-rh/fs/stat.c +=================================================================== +--- linux-2.4.20-rh.orig/fs/stat.c 2003-07-29 11:36:40.000000000 +0800 ++++ linux-2.4.20-rh/fs/stat.c 2003-07-30 17:56:16.000000000 +0800 @@ -17,10 +17,12 @@ * Revalidate the inode. This is required for proper NFS attribute caching. */ @@ -1187,7 +1195,7 @@ return inode->i_op->revalidate(dentry); return 0; } -@@ -32,13 +34,13 @@ static inline nlink_t user_nlink(struct +@@ -32,13 +34,13 @@ return inode->i_nlink; } @@ -1203,7 +1211,7 @@ if (res) return res; -@@ -111,10 +113,12 @@ int vfs_stat(char *name, struct kstat *s +@@ -111,10 +113,12 @@ { struct nameidata nd; int error; @@ -1218,7 +1226,7 @@ path_release(&nd); } return error; -@@ -124,10 +128,12 @@ int vfs_lstat(char *name, struct kstat * +@@ -124,10 +128,12 @@ { struct nameidata nd; int error; @@ -1233,7 +1241,7 @@ path_release(&nd); } return error; -@@ -139,7 +145,7 @@ int vfs_fstat(unsigned int fd, struct ks +@@ -139,7 +145,7 @@ int error = -EBADF; if (f) { @@ -1242,7 +1250,7 @@ fput(f); } return error; -@@ -286,7 +292,7 @@ asmlinkage long sys_readlink(const char +@@ -286,7 +292,7 @@ error = -EINVAL; if (inode->i_op && inode->i_op->readlink && @@ -1251,9 +1259,11 @@ UPDATE_ATIME(inode); error = inode->i_op->readlink(nd.dentry, buf, bufsiz); } ---- linux-2.4.20/include/linux/dcache.h~vfs_intent-2.4.20-rh 2003-07-17 08:32:48.000000000 -0700 -+++ linux-2.4.20-mmonroe/include/linux/dcache.h 2003-07-17 08:35:22.000000000 -0700 -@@ -6,6 +6,45 @@ +Index: linux-2.4.20-rh/include/linux/dcache.h +=================================================================== +--- linux-2.4.20-rh.orig/include/linux/dcache.h 2003-07-29 11:36:22.000000000 +0800 ++++ linux-2.4.20-rh/include/linux/dcache.h 2003-07-30 17:58:24.000000000 +0800 +@@ -6,6 +6,52 @@ #include #include #include @@ -1274,19 +1284,26 @@ + +#define INTENT_MAGIC 0x19620323 + -+struct lookup_intent { -+ int it_op; -+ void (*it_op_release)(struct lookup_intent *); -+ int it_magic; -+ int it_mode; -+ int it_flags; -+ int it_disposition; -+ int it_status; ++ ++struct lustre_intent_data { ++ int it_disposition; ++ int it_status; ++ __u64 it_lock_handle; ++ void *it_data; ++ int it_lock_mode; + int it_int_flags; -+ __u64 it_lock_handle[2]; -+ int it_lock_mode; -+ void *it_data; +}; ++struct lookup_intent { ++ int it_magic; ++ void (*it_op_release)(struct lookup_intent *); ++ int it_op; ++ int it_flags; ++ int it_create_mode; ++ union { ++ struct lustre_intent_data lustre; ++ } d; ++}; ++ + +static inline void intent_init(struct lookup_intent *it, int op, int flags) +{ @@ -1299,7 +1316,7 @@ /* * linux/include/linux/dcache.h -@@ -96,8 +135,22 @@ struct dentry_operations { +@@ -96,8 +142,22 @@ int (*d_delete)(struct dentry *); void (*d_release)(struct dentry *); void (*d_iput)(struct dentry *, struct inode *); @@ -1322,7 +1339,7 @@ /* the dentry parameter passed to d_hash and d_compare is the parent * directory of the entries to be compared. It is used in case these * functions need any directory specific information for determining -@@ -129,6 +182,7 @@ d_iput: no no yes +@@ -129,6 +189,7 @@ * s_nfsd_free_path semaphore will be down */ #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ @@ -1330,9 +1347,11 @@ extern spinlock_t dcache_lock; ---- linux-2.4.20/include/linux/fs.h~vfs_intent-2.4.20-rh 2003-07-17 08:34:44.000000000 -0700 -+++ linux-2.4.20-mmonroe/include/linux/fs.h 2003-07-17 08:35:22.000000000 -0700 -@@ -337,6 +337,9 @@ extern void set_bh_page(struct buffer_he +Index: linux-2.4.20-rh/include/linux/fs.h +=================================================================== +--- linux-2.4.20-rh.orig/include/linux/fs.h 2003-07-30 17:56:12.000000000 +0800 ++++ linux-2.4.20-rh/include/linux/fs.h 2003-07-30 17:57:05.000000000 +0800 +@@ -338,6 +338,9 @@ #define ATTR_MTIME_SET 256 #define ATTR_FORCE 512 /* Not a change, but a change it */ #define ATTR_ATTR_FLAG 1024 @@ -1342,7 +1361,7 @@ /* * This is the Inode Attributes structure, used for notify_change(). It -@@ -574,6 +577,7 @@ struct file { +@@ -575,6 +578,7 @@ /* needed for tty driver, and maybe others */ void *private_data; @@ -1350,15 +1369,15 @@ /* preallocated helper kiobuf to speedup O_DIRECT */ struct kiobuf *f_iobuf; -@@ -701,6 +705,7 @@ struct nameidata { +@@ -702,6 +706,7 @@ struct qstr last; unsigned int flags; int last_type; -+ struct lookup_intent *it; ++ struct lookup_intent *intent; }; /* -@@ -821,7 +826,8 @@ extern int vfs_symlink(struct inode *, s +@@ -822,7 +827,8 @@ extern int vfs_link(struct dentry *, struct inode *, struct dentry *); extern int vfs_rmdir(struct inode *, struct dentry *); extern int vfs_unlink(struct inode *, struct dentry *); @@ -1368,7 +1387,7 @@ /* * File types -@@ -881,21 +887,32 @@ struct file_operations { +@@ -882,21 +888,32 @@ struct inode_operations { int (*create) (struct inode *,struct dentry *,int); @@ -1401,7 +1420,7 @@ int (*getattr) (struct dentry *, struct iattr *); int (*setxattr) (struct dentry *, const char *, void *, size_t, int); ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); -@@ -1091,10 +1108,14 @@ static inline int get_lease(struct inode +@@ -1092,10 +1109,14 @@ asmlinkage long sys_open(const char *, int, int); asmlinkage long sys_close(unsigned int); /* yes, it's really unsigned */ @@ -1417,7 +1436,7 @@ extern int filp_close(struct file *, fl_owner_t id); extern char * getname(const char *); -@@ -1385,6 +1406,7 @@ typedef int (*read_actor_t)(read_descrip +@@ -1386,6 +1407,7 @@ extern loff_t default_llseek(struct file *file, loff_t offset, int origin); extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *)); @@ -1425,7 +1444,7 @@ extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *)); extern int FASTCALL(path_walk(const char *, struct nameidata *)); extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *)); -@@ -1396,6 +1418,8 @@ extern struct dentry * lookup_one_len(co +@@ -1397,6 +1419,8 @@ extern struct dentry * lookup_hash(struct qstr *, struct dentry *); #define user_path_walk(name,nd) __user_walk(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd) #define user_path_walk_link(name,nd) __user_walk(name, LOOKUP_POSITIVE, nd) @@ -1434,7 +1453,7 @@ extern void inode_init_once(struct inode *); extern void iput(struct inode *); -@@ -1497,6 +1521,8 @@ extern struct file_operations generic_ro +@@ -1504,6 +1528,8 @@ extern int vfs_readlink(struct dentry *, char *, int, const char *); extern int vfs_follow_link(struct nameidata *, const char *); @@ -1443,9 +1462,11 @@ extern int page_readlink(struct dentry *, char *, int); extern int page_follow_link(struct dentry *, struct nameidata *); extern struct inode_operations page_symlink_inode_operations; ---- linux-2.4.20/kernel/ksyms.c~vfs_intent-2.4.20-rh 2003-07-17 08:34:45.000000000 -0700 -+++ linux-2.4.20-mmonroe/kernel/ksyms.c 2003-07-17 08:35:22.000000000 -0700 -@@ -298,6 +298,7 @@ EXPORT_SYMBOL(read_cache_page); +Index: linux-2.4.20-rh/kernel/ksyms.c +=================================================================== +--- linux-2.4.20-rh.orig/kernel/ksyms.c 2003-07-30 17:56:14.000000000 +0800 ++++ linux-2.4.20-rh/kernel/ksyms.c 2003-07-30 17:56:17.000000000 +0800 +@@ -298,6 +298,7 @@ EXPORT_SYMBOL(set_page_dirty); EXPORT_SYMBOL(vfs_readlink); EXPORT_SYMBOL(vfs_follow_link); @@ -1453,9 +1474,11 @@ EXPORT_SYMBOL(page_readlink); EXPORT_SYMBOL(page_follow_link); EXPORT_SYMBOL(page_symlink_inode_operations); ---- linux-2.4.20/fs/exec.c~vfs_intent-2.4.20-rh 2003-07-17 08:33:09.000000000 -0700 -+++ linux-2.4.20-mmonroe/fs/exec.c 2003-07-17 08:35:22.000000000 -0700 -@@ -114,8 +114,9 @@ asmlinkage long sys_uselib(const char * +Index: linux-2.4.20-rh/fs/exec.c +=================================================================== +--- linux-2.4.20-rh.orig/fs/exec.c 2003-07-29 11:36:40.000000000 +0800 ++++ linux-2.4.20-rh/fs/exec.c 2003-07-30 17:56:17.000000000 +0800 +@@ -114,8 +114,9 @@ struct file * file; struct nameidata nd; int error; @@ -1466,7 +1489,7 @@ if (error) goto out; -@@ -127,7 +128,8 @@ asmlinkage long sys_uselib(const char * +@@ -127,7 +128,8 @@ if (error) goto exit; @@ -1476,7 +1499,7 @@ error = PTR_ERR(file); if (IS_ERR(file)) goto out; -@@ -382,8 +384,9 @@ struct file *open_exec(const char *name) +@@ -382,8 +384,9 @@ struct inode *inode; struct file *file; int err = 0; @@ -1487,7 +1510,7 @@ file = ERR_PTR(err); if (!err) { inode = nd.dentry->d_inode; -@@ -395,7 +398,8 @@ struct file *open_exec(const char *name) +@@ -395,7 +398,8 @@ err = -EACCES; file = ERR_PTR(err); if (!err) { @@ -1497,7 +1520,7 @@ if (!IS_ERR(file)) { err = deny_write_access(file); if (err) { -@@ -407,6 +411,7 @@ out: +@@ -407,6 +411,7 @@ return file; } } @@ -1505,7 +1528,7 @@ path_release(&nd); } goto out; -@@ -1283,7 +1288,7 @@ int do_coredump(long signr, int exit_cod +@@ -1296,7 +1301,7 @@ goto close_fail; if (!file->f_op->write) goto close_fail; @@ -1514,17 +1537,17 @@ goto close_fail; retval = binfmt->core_dump(signr, regs, file); ---- linux-2.4.20/fs/proc/base.c~vfs_intent-2.4.20-rh 2003-07-17 08:33:05.000000000 -0700 -+++ linux-2.4.20-mmonroe/fs/proc/base.c 2003-07-17 08:35:22.000000000 -0700 -@@ -464,6 +464,9 @@ static int proc_pid_follow_link(struct d +Index: linux-2.4.20-rh/fs/proc/base.c +=================================================================== +--- linux-2.4.20-rh.orig/fs/proc/base.c 2003-07-29 11:36:40.000000000 +0800 ++++ linux-2.4.20-rh/fs/proc/base.c 2003-07-30 17:56:17.000000000 +0800 +@@ -494,6 +494,9 @@ error = inode->u.proc_i.op.proc_get_link(inode, &nd->dentry, &nd->mnt); nd->last_type = LAST_BIND; + -+ if (nd->it != NULL) -+ nd->it->it_int_flags |= IT_FL_FOLLOWED; ++ if (nd->intent != NULL) ++ nd->intent->d.lustre.it_int_flags |= IT_FL_FOLLOWED; out: return error; } - -_ diff --git a/lustre/kernel_patches/pc/ext3-no-write-super.pc b/lustre/kernel_patches/pc/ext3-no-write-super.pc new file mode 100644 index 0000000..08795de --- /dev/null +++ b/lustre/kernel_patches/pc/ext3-no-write-super.pc @@ -0,0 +1 @@ +fs/ext3/super.c diff --git a/lustre/kernel_patches/pc/ext3-o_direct-1-2.4.18-chaos.pc b/lustre/kernel_patches/pc/ext3-o_direct-1-2.4.18-chaos.pc new file mode 100644 index 0000000..76d683f --- /dev/null +++ b/lustre/kernel_patches/pc/ext3-o_direct-1-2.4.18-chaos.pc @@ -0,0 +1 @@ +fs/ext3/inode.c -- 1.8.3.1