From f21d4957ef1c01159166eb681b71009db5cf90b2 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 8 Oct 2003 09:26:29 +0000 Subject: [PATCH] - last nfs_export patch - FS_NFSEXP_FSID flag is put into lustre_lite_fs_type as proposed - patch ported against hp-pnnl-2.4.20 and rh-2.4.20 series NOTE: please, don't forget to re-apply nfs_export_kernel* patch --- .../patches/nfs_export_kernel-2.4.18.patch | 141 ++++++++++----------- .../kernel_patches/pc/nfs_export_kernel-2.4.18.pc | 4 +- lustre/kernel_patches/series/chaos-2.4.18 | 1 + 3 files changed, 68 insertions(+), 78 deletions(-) diff --git a/lustre/kernel_patches/patches/nfs_export_kernel-2.4.18.patch b/lustre/kernel_patches/patches/nfs_export_kernel-2.4.18.patch index 413a814..51f581e 100644 --- a/lustre/kernel_patches/patches/nfs_export_kernel-2.4.18.patch +++ b/lustre/kernel_patches/patches/nfs_export_kernel-2.4.18.patch @@ -2,27 +2,15 @@ fs/file_table.c | 11 ++ fs/inode.c | 23 ++++- fs/namei.c | 12 ++ + fs/nfsd/export.c | 5 + fs/nfsd/nfsfh.c | 65 +++++++++++++- fs/nfsd/vfs.c | 240 ++++++++++++++++++++++++++++++++++++++++++++++++----- - fs/super.c | 3 - include/linux/fs.h | 8 + - kernel/ksyms.c | 3 - 9 files changed, 333 insertions(+), 35 deletions(-) + include/linux/fs.h | 10 ++ + kernel/ksyms.c | 2 + 9 files changed, 337 insertions(+), 34 deletions(-) ---- linux-2.4.18-p4smp1Guser/fs/Makefile~nfs_export_kernel-2.4.18 Thu Sep 25 00:45:26 2003 -+++ linux-2.4.18-p4smp1Guser-pschwan/fs/Makefile Thu Sep 25 00:45:56 2003 -@@ -9,7 +9,8 @@ - - O_TARGET := fs.o - --export-objs := filesystems.o open.o dcache.o buffer.o inode.o -+export-objs := filesystems.o open.o dcache.o buffer.o inode.o namei.o \ -+ file_table.o - mod-subdirs := nls - - obj-y := open.o read_write.o devices.o file_table.o buffer.o \ ---- linux-2.4.18-p4smp1Guser/fs/file_table.c~nfs_export_kernel-2.4.18 Tue May 7 15:05:16 2002 -+++ linux-2.4.18-p4smp1Guser-pschwan/fs/file_table.c Thu Sep 25 00:22:15 2003 +--- linux-2.4.18-chaos/fs/file_table.c~nfs_export_kernel-2.4.18 2003-07-28 17:52:04.000000000 +0400 ++++ linux-2.4.18-chaos-alexey/fs/file_table.c 2003-10-08 01:10:58.000000000 +0400 @@ -82,7 +82,8 @@ struct file * get_empty_filp(void) * and call the open function (if any). The caller must verify that * inode->i_fop is not NULL. @@ -54,9 +42,9 @@ void fput(struct file * file) { ---- linux-2.4.18-p4smp1Guser/fs/inode.c~nfs_export_kernel-2.4.18 Wed Sep 24 23:35:07 2003 -+++ linux-2.4.18-p4smp1Guser-pschwan/fs/inode.c Wed Sep 24 23:35:08 2003 -@@ -988,9 +988,10 @@ struct inode *igrab(struct inode *inode) +--- linux-2.4.18-chaos/fs/inode.c~nfs_export_kernel-2.4.18 2003-10-08 00:58:35.000000000 +0400 ++++ linux-2.4.18-chaos-alexey/fs/inode.c 2003-10-08 01:10:58.000000000 +0400 +@@ -987,9 +987,10 @@ struct inode *igrab(struct inode *inode) } @@ -69,7 +57,7 @@ struct inode * inode; spin_lock(&inode_lock); -@@ -1003,6 +1004,24 @@ struct inode *iget4(struct super_block * +@@ -1002,6 +1003,24 @@ struct inode *iget4(struct super_block * } spin_unlock(&inode_lock); @@ -94,8 +82,20 @@ /* * get_new_inode() will do the right thing, re-trying the search * in case it had to block at any point. ---- linux-2.4.18-p4smp1Guser/fs/namei.c~nfs_export_kernel-2.4.18 Wed Sep 24 23:35:07 2003 -+++ linux-2.4.18-p4smp1Guser-pschwan/fs/namei.c Thu Sep 25 00:49:00 2003 +--- linux-2.4.18-chaos/fs/Makefile~nfs_export_kernel-2.4.18 2003-10-08 00:58:35.000000000 +0400 ++++ linux-2.4.18-chaos-alexey/fs/Makefile 2003-10-08 01:10:58.000000000 +0400 +@@ -9,7 +9,8 @@ + + O_TARGET := fs.o + +-export-objs := filesystems.o open.o dcache.o buffer.o inode.o ++export-objs := filesystems.o open.o dcache.o buffer.o inode.o namei.o \ ++ file_table.o + mod-subdirs := nls + + obj-y := open.o read_write.o devices.o file_table.o buffer.o \ +--- linux-2.4.18-chaos/fs/namei.c~nfs_export_kernel-2.4.18 2003-10-08 00:58:34.000000000 +0400 ++++ linux-2.4.18-chaos-alexey/fs/namei.c 2003-10-08 01:10:58.000000000 +0400 @@ -22,6 +22,7 @@ #include #include @@ -110,9 +110,9 @@ } +EXPORT_SYMBOL(intent_release); - static void *lock_dir(struct inode *dir, struct qstr *name) - { -@@ -945,7 +947,8 @@ struct dentry * lookup_hash(struct qstr + /* In order to reduce some races, while at the same time doing additional + * checking and hopefully speeding things up, we copy filenames to the +@@ -914,7 +916,8 @@ struct dentry * lookup_hash(struct qstr /* SMP-safe */ @@ -122,7 +122,7 @@ { unsigned long hash; struct qstr this; -@@ -965,11 +968,16 @@ struct dentry * lookup_one_len(const cha +@@ -934,11 +937,16 @@ struct dentry * lookup_one_len(const cha } this.hash = end_name_hash(hash); @@ -140,8 +140,22 @@ /* * namei() * ---- linux-2.4.18-p4smp1Guser/fs/nfsd/nfsfh.c~nfs_export_kernel-2.4.18 Tue Jun 25 21:16:24 2002 -+++ linux-2.4.18-p4smp1Guser-pschwan/fs/nfsd/nfsfh.c Wed Sep 24 23:35:08 2003 +--- linux-2.4.18-chaos/fs/nfsd/export.c~nfs_export_kernel-2.4.18 2003-07-28 17:52:06.000000000 +0400 ++++ linux-2.4.18-chaos-alexey/fs/nfsd/export.c 2003-10-08 01:10:58.000000000 +0400 +@@ -250,6 +250,11 @@ exp_export(struct nfsctl_export *nxp) + inode = nd.dentry->d_inode; + dev = inode->i_dev; + ino = inode->i_ino; ++ if ((inode->i_sb->s_type->fs_flags & FS_NFSEXP_FSID) && ++ !(nxp->ex_flags & NFSEXP_FSID)) { ++ nxp->ex_dev = inode->i_sb->s_dev; ++ nxp->ex_flags |= NFSEXP_FSID; ++ } + err = -EINVAL; + + exp = exp_get(clp, dev, ino); +--- linux-2.4.18-chaos/fs/nfsd/nfsfh.c~nfs_export_kernel-2.4.18 2003-07-28 17:52:06.000000000 +0400 ++++ linux-2.4.18-chaos-alexey/fs/nfsd/nfsfh.c 2003-10-08 01:10:58.000000000 +0400 @@ -37,6 +37,15 @@ struct nfsd_getdents_callback { int sequence; /* sequence counter */ }; @@ -273,8 +287,8 @@ goto out; } ---- linux-2.4.18-p4smp1Guser/fs/nfsd/vfs.c~nfs_export_kernel-2.4.18 Tue Jul 22 21:06:36 2003 -+++ linux-2.4.18-p4smp1Guser-pschwan/fs/nfsd/vfs.c Thu Sep 25 00:07:41 2003 +--- linux-2.4.18-chaos/fs/nfsd/vfs.c~nfs_export_kernel-2.4.18 2003-07-28 17:52:06.000000000 +0400 ++++ linux-2.4.18-chaos-alexey/fs/nfsd/vfs.c 2003-10-08 01:11:59.000000000 +0400 @@ -77,6 +77,128 @@ struct raparms { static struct raparms * raparml; static struct raparms * raparm_cache; @@ -665,38 +679,29 @@ } dput(rdentry); ---- linux-2.4.18-p4smp1Guser/fs/super.c~nfs_export_kernel-2.4.18 Wed Sep 24 23:35:00 2003 -+++ linux-2.4.18-p4smp1Guser-pschwan/fs/super.c Wed Sep 24 23:35:08 2003 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - #include - -@@ -58,7 +59,7 @@ static DECLARE_MUTEX(lockfs_sem); - */ - - static struct file_system_type *file_systems; --static rwlock_t file_systems_lock = RW_LOCK_UNLOCKED; -+rwlock_t file_systems_lock = RW_LOCK_UNLOCKED; - - /* WARNING: This can be used only if we _already_ own a reference */ - static void get_filesystem(struct file_system_type *fs) ---- linux-2.4.18-p4smp1Guser/include/linux/fs.h~nfs_export_kernel-2.4.18 Wed Sep 24 23:35:07 2003 -+++ linux-2.4.18-p4smp1Guser-pschwan/include/linux/fs.h Thu Sep 25 00:23:27 2003 -@@ -1147,6 +1147,9 @@ extern struct file *filp_open(const char +--- linux-2.4.18-chaos/include/linux/fs.h~nfs_export_kernel-2.4.18 2003-10-08 01:09:51.000000000 +0400 ++++ linux-2.4.18-chaos-alexey/include/linux/fs.h 2003-10-08 01:10:58.000000000 +0400 +@@ -93,6 +93,9 @@ extern int leases_enable, dir_notify_ena + #define FS_SINGLE 8 /* Filesystem that can have only one superblock */ + #define FS_NOMOUNT 16 /* Never mount from userland */ + #define FS_LITTER 32 /* Keeps the tree in dcache */ ++#define FS_NFSEXP_FSID 64 /* Use file system specific fsid for ++ * exporting non device filesystems. ++ */ + #define FS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon + * as nfs_rename() will be cleaned up + */ +@@ -1147,6 +1150,9 @@ extern struct file *filp_open(const char extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); extern struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it); +extern int revalidate_it(struct dentry *dentry, struct lookup_intent *it); -+extern int init_private_file_it(struct file *filp, struct dentry *dentry, int mode, -+ struct lookup_intent *it); ++extern int init_private_file_it(struct file *, struct dentry *dentry, int mode, ++ struct lookup_intent *it); extern int filp_close(struct file *, fl_owner_t id); extern char * getname(const char *); -@@ -1423,6 +1426,8 @@ extern void path_release(struct nameidat +@@ -1423,6 +1429,8 @@ extern void path_release(struct nameidat extern int follow_down(struct vfsmount **, struct dentry **); extern int follow_up(struct vfsmount **, struct dentry **); extern struct dentry * lookup_one_len(const char *, struct dentry *, int); @@ -705,7 +710,7 @@ 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) -@@ -1437,6 +1442,8 @@ extern ino_t iunique(struct super_block +@@ -1437,6 +1445,8 @@ extern ino_t iunique(struct super_block typedef int (*find_inode_t)(struct inode *, unsigned long, void *); extern struct inode * iget4(struct super_block *, unsigned long, find_inode_t, void *); @@ -714,16 +719,8 @@ static inline struct inode *iget(struct super_block *sb, unsigned long ino) { return iget4(sb, ino, NULL, NULL); -@@ -1541,6 +1548,7 @@ extern int vfs_stat(char *, struct kstat - extern int vfs_lstat(char *, struct kstat *); - extern int vfs_fstat(unsigned int, struct kstat *); - -+extern rwlock_t file_systems_lock; - extern struct file_system_type *get_fs_type(const char *name); - extern struct super_block *get_super(kdev_t); - extern void drop_super(struct super_block *sb); ---- linux-2.4.18-p4smp1Guser/kernel/ksyms.c~nfs_export_kernel-2.4.18 Wed Sep 24 23:35:00 2003 -+++ linux-2.4.18-p4smp1Guser-pschwan/kernel/ksyms.c Wed Sep 24 23:35:08 2003 +--- linux-2.4.18-chaos/kernel/ksyms.c~nfs_export_kernel-2.4.18 2003-10-08 00:58:34.000000000 +0400 ++++ linux-2.4.18-chaos-alexey/kernel/ksyms.c 2003-10-08 01:10:58.000000000 +0400 @@ -156,6 +156,7 @@ EXPORT_SYMBOL(fget); EXPORT_SYMBOL(igrab); EXPORT_SYMBOL(iunique); @@ -740,13 +737,5 @@ EXPORT_SYMBOL(lookup_hash); EXPORT_SYMBOL(sys_close); EXPORT_SYMBOL(sys_read); -@@ -630,6 +632,7 @@ EXPORT_SYMBOL(init_task_union); - - EXPORT_SYMBOL(tasklist_lock); - EXPORT_SYMBOL(pidhash); -+EXPORT_SYMBOL(file_systems_lock); - - /* for Linux-ABI */ - EXPORT_SYMBOL(do_fork); _ diff --git a/lustre/kernel_patches/pc/nfs_export_kernel-2.4.18.pc b/lustre/kernel_patches/pc/nfs_export_kernel-2.4.18.pc index 622704f..e70ab4d 100644 --- a/lustre/kernel_patches/pc/nfs_export_kernel-2.4.18.pc +++ b/lustre/kernel_patches/pc/nfs_export_kernel-2.4.18.pc @@ -1,9 +1,9 @@ -fs/Makefile fs/file_table.c fs/inode.c +fs/Makefile fs/namei.c +fs/nfsd/export.c fs/nfsd/nfsfh.c fs/nfsd/vfs.c -fs/super.c include/linux/fs.h kernel/ksyms.c diff --git a/lustre/kernel_patches/series/chaos-2.4.18 b/lustre/kernel_patches/series/chaos-2.4.18 index 0fad1af..3b45245 100644 --- a/lustre/kernel_patches/series/chaos-2.4.18 +++ b/lustre/kernel_patches/series/chaos-2.4.18 @@ -27,3 +27,4 @@ ext3-no-write-super-chaos.patch ext3-extents-2.4.18-chaos.patch ext3-extents-oflag-2.4.18-chaos.patch ext3-raw-lookup.patch +nfs_export_kernel-2.4.18 -- 1.8.3.1