From 8310bbfa2e82e434951f6bd862561698af294a61 Mon Sep 17 00:00:00 2001 From: green Date: Mon, 12 Jul 2004 17:55:49 +0000 Subject: [PATCH] b=3720 r=braam Disable UML, as it does not work anyway. d_vfs_flags is gone, convert iopen patch and llite_nfs to use d_flags guarded by dentry->d_lock spinlock DNAME_INLINE_LEN -> DNAME_INLINE_LEN_MIN renaming One extra argument (permissions) to vfs_symlink() atomic_read(&page->count) is not going to work anymore, so changed all such occurences to page_count() instead that is a portable way working in both 2.6 and 2.4 splitted vanilla and suse patches for vfs_races and nfs-cifs-intent, as the code diverged somewhat in 2.6.7 and suse patches do not apply cleanly. --- .../patches/nfs-cifs-intent-2.6-vanilla.patch | 117 +++++++++++++++++++++ .../patches/vfs_races-2.6-vanilla.patch | 65 ++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 lustre/kernel_patches/patches/nfs-cifs-intent-2.6-vanilla.patch create mode 100644 lustre/kernel_patches/patches/vfs_races-2.6-vanilla.patch diff --git a/lustre/kernel_patches/patches/nfs-cifs-intent-2.6-vanilla.patch b/lustre/kernel_patches/patches/nfs-cifs-intent-2.6-vanilla.patch new file mode 100644 index 0000000..0c4f64b --- /dev/null +++ b/lustre/kernel_patches/patches/nfs-cifs-intent-2.6-vanilla.patch @@ -0,0 +1,117 @@ +Index: linux-2.6.7-vanilla/fs/nfs/dir.c +=================================================================== +--- linux-2.6.7-vanilla.orig/fs/nfs/dir.c 2004-07-01 12:24:53.588555336 +0300 ++++ linux-2.6.7-vanilla/fs/nfs/dir.c 2004-07-01 12:37:42.595648488 +0300 +@@ -778,7 +778,7 @@ + if (nd->flags & LOOKUP_DIRECTORY) + return 0; + /* Are we trying to write to a read only partition? */ +- if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE))) ++ if (IS_RDONLY(dir) && (nd->intent.it_flags & (O_CREAT|O_TRUNC|FMODE_WRITE))) + return 0; + return 1; + } +@@ -799,7 +799,7 @@ + dentry->d_op = NFS_PROTO(dir)->dentry_ops; + + /* Let vfs_create() deal with O_EXCL */ +- if (nd->intent.open.flags & O_EXCL) ++ if (nd->intent.it_flags & O_EXCL) + goto no_entry; + + /* Open the file on the server */ +@@ -807,7 +807,7 @@ + /* Revalidate parent directory attribute cache */ + nfs_revalidate_inode(NFS_SERVER(dir), dir); + +- if (nd->intent.open.flags & O_CREAT) { ++ if (nd->intent.it_flags & O_CREAT) { + nfs_begin_data_update(dir); + inode = nfs4_atomic_open(dir, dentry, nd); + nfs_end_data_update(dir); +@@ -823,7 +823,7 @@ + break; + /* This turned out not to be a regular file */ + case -ELOOP: +- if (!(nd->intent.open.flags & O_NOFOLLOW)) ++ if (!(nd->intent.it_flags & O_NOFOLLOW)) + goto no_open; + /* case -EISDIR: */ + /* case -EINVAL: */ +@@ -857,7 +857,7 @@ + dir = parent->d_inode; + if (!is_atomic_open(dir, nd)) + goto no_open; +- openflags = nd->intent.open.flags; ++ openflags = nd->intent.it_flags; + if (openflags & O_CREAT) { + /* If this is a negative dentry, just drop it */ + if (!inode) +Index: linux-2.6.7-vanilla/fs/nfs/nfs4proc.c +=================================================================== +--- linux-2.6.7-vanilla.orig/fs/nfs/nfs4proc.c 2004-07-01 12:09:22.000000000 +0300 ++++ linux-2.6.7-vanilla/fs/nfs/nfs4proc.c 2004-07-01 12:37:42.598648032 +0300 +@@ -475,17 +475,17 @@ + struct nfs4_state *state; + + if (nd->flags & LOOKUP_CREATE) { +- attr.ia_mode = nd->intent.open.create_mode; ++ attr.ia_mode = nd->intent.it_create_mode; + attr.ia_valid = ATTR_MODE; + if (!IS_POSIXACL(dir)) + attr.ia_mode &= ~current->fs->umask; + } else { + attr.ia_valid = 0; +- BUG_ON(nd->intent.open.flags & O_CREAT); ++ BUG_ON(nd->intent.it_flags & O_CREAT); + } + + cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0); +- state = nfs4_do_open(dir, &dentry->d_name, nd->intent.open.flags, &attr, cred); ++ state = nfs4_do_open(dir, &dentry->d_name, nd->intent.it_flags, &attr, cred); + put_rpccred(cred); + if (IS_ERR(state)) + return (struct inode *)state; +Index: linux-2.6.7-vanilla/fs/cifs/dir.c +=================================================================== +--- linux-2.6.7-vanilla.orig/fs/cifs/dir.c 2004-07-01 12:09:20.000000000 +0300 ++++ linux-2.6.7-vanilla/fs/cifs/dir.c 2004-07-01 12:38:17.695312528 +0300 +@@ -175,23 +175,23 @@ + } + + if(nd) { +- if ((nd->intent.open.flags & O_ACCMODE) == O_RDONLY) ++ if ((nd->intent.it_flags & O_ACCMODE) == O_RDONLY) + desiredAccess = GENERIC_READ; +- else if ((nd->intent.open.flags & O_ACCMODE) == O_WRONLY) { ++ else if ((nd->intent.it_flags & O_ACCMODE) == O_WRONLY) { + desiredAccess = GENERIC_WRITE; + write_only = TRUE; +- } else if ((nd->intent.open.flags & O_ACCMODE) == O_RDWR) { ++ } else if ((nd->intent.it_flags & O_ACCMODE) == O_RDWR) { + /* GENERIC_ALL is too much permission to request */ + /* can cause unnecessary access denied on create */ + /* desiredAccess = GENERIC_ALL; */ + desiredAccess = GENERIC_READ | GENERIC_WRITE; + } + +- if((nd->intent.open.flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) ++ if((nd->intent.it_flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) + disposition = FILE_CREATE; +- else if((nd->intent.open.flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC)) ++ else if((nd->intent.it_flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC)) + disposition = FILE_OVERWRITE_IF; +- else if((nd->intent.open.flags & O_CREAT) == O_CREAT) ++ else if((nd->intent.it_flags & O_CREAT) == O_CREAT) + disposition = FILE_OPEN_IF; + else { + cFYI(1,("Create flag not set in create function")); +@@ -361,7 +361,7 @@ + parent_dir_inode, direntry->d_name.name, direntry)); + + if(nd) { /* BB removeme */ +- cFYI(1,("In lookup nd flags 0x%x open intent flags 0x%x",nd->flags,nd->intent.open.flags)); ++ cFYI(1,("In lookup nd flags 0x%x open intent flags 0x%x",nd->flags,nd->intent.it_flags)); + } /* BB removeme BB */ + /* BB Add check of incoming data - e.g. frame not longer than maximum SMB - let server check the namelen BB */ + diff --git a/lustre/kernel_patches/patches/vfs_races-2.6-vanilla.patch b/lustre/kernel_patches/patches/vfs_races-2.6-vanilla.patch new file mode 100644 index 0000000..ccca64d --- /dev/null +++ b/lustre/kernel_patches/patches/vfs_races-2.6-vanilla.patch @@ -0,0 +1,65 @@ +Index: linux-2.6.7-vanilla/fs/dcache.c +=================================================================== +--- linux-2.6.7-vanilla.orig/fs/dcache.c 2004-07-01 12:09:19.000000000 +0300 ++++ linux-2.6.7-vanilla/fs/dcache.c 2004-07-01 12:29:12.510193264 +0300 +@@ -219,7 +219,14 @@ + spin_unlock(&dcache_lock); + return 0; + } +- /* ++ ++ /* network invalidation by Lustre */ ++ if (dentry->d_flags & DCACHE_LUSTRE_INVALID) { ++ spin_unlock(&dcache_lock); ++ return 0; ++ } ++ ++ /* + * Check whether to do a partial shrink_dcache + * to get rid of unused child entries. + */ +@@ -1114,19 +1121,28 @@ + * Adds a dentry to the hash according to its name. + */ + +-void d_rehash(struct dentry * entry) ++void __d_rehash(struct dentry * entry, int lock) + { + struct hlist_head *list = d_hash(entry->d_parent, entry->d_name.hash); + +- spin_lock(&dcache_lock); ++ if (lock) ++ spin_lock(&dcache_lock); + spin_lock(&entry->d_lock); + entry->d_flags &= ~DCACHE_UNHASHED; + spin_unlock(&entry->d_lock); + entry->d_bucket = list; + hlist_add_head_rcu(&entry->d_hash, list); +- spin_unlock(&dcache_lock); ++ if (lock) ++ spin_unlock(&dcache_lock); + } + ++EXPORT_SYMBOL(__d_rehash); ++ ++void d_rehash(struct dentry * entry) ++{ ++ __d_rehash(entry, 1); ++ } ++ + #define do_switch(x,y) do { \ + __typeof__ (x) __tmp = x; \ + x = y; y = __tmp; } while (0) +Index: linux-2.6.7-vanilla/include/linux/dcache.h +=================================================================== +--- linux-2.6.7-vanilla.orig/include/linux/dcache.h 2004-07-01 12:24:53.602553208 +0300 ++++ linux-2.6.7-vanilla/include/linux/dcache.h 2004-07-01 12:27:29.757814000 +0300 +@@ -159,6 +159,8 @@ + + #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ + #define DCACHE_UNHASHED 0x0010 ++#define DCACHE_LUSTRE_INVALID 0x0020 /* Lustre invalidated */ ++ + + extern spinlock_t dcache_lock; + -- 1.8.3.1