From: alex Date: Wed, 8 Oct 2003 09:26:31 +0000 (+0000) Subject: - last nfs_export patch X-Git-Tag: v1_7_110~1^13~97 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0d75ebd7875be4515ab81dbed43456e557e62a32;p=fs%2Flustre-release.git - 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 --- diff --git a/lustre/kernel_patches/patches/nfs_export_kernel-2.4.20.patch b/lustre/kernel_patches/patches/nfs_export_kernel-2.4.20.patch index 1044a87..bb7e378 100644 --- a/lustre/kernel_patches/patches/nfs_export_kernel-2.4.20.patch +++ b/lustre/kernel_patches/patches/nfs_export_kernel-2.4.20.patch @@ -1,16 +1,6 @@ - fs/Makefile | 3 - fs/file_table.c | 11 ++ - fs/inode.c | 23 ++++- - fs/namei.c | 12 ++ - 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(-) - ---- lum-2.4.20-l27/fs/Makefile~nfs_export_kernel-2.4.20 Thu Sep 25 03:31:17 2003 -+++ lum-2.4.20-l27-phil/fs/Makefile Thu Sep 25 03:30:18 2003 +diff -uprN linux/fs/Makefile linux-2.4.20/fs/Makefile +--- linux/fs/Makefile Sun Oct 5 21:52:51 2003 ++++ linux-2.4.20/fs/Makefile Sun Oct 5 21:47:45 2003 @@ -7,7 +7,8 @@ O_TARGET := fs.o @@ -21,8 +11,9 @@ mod-subdirs := nls obj-y := open.o read_write.o devices.o file_table.o buffer.o \ ---- lum-2.4.20-l27/fs/file_table.c~nfs_export_kernel-2.4.20 Thu Nov 28 18:53:15 2002 -+++ lum-2.4.20-l27-phil/fs/file_table.c Thu Sep 25 03:25:12 2003 +diff -uprN linux/fs/file_table.c linux-2.4.20/fs/file_table.c +--- linux/fs/file_table.c Fri Nov 29 05:23:15 2002 ++++ linux-2.4.20/fs/file_table.c Sun Oct 5 21:47:45 2003 @@ -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,8 +45,9 @@ void fput(struct file * file) { ---- lum-2.4.20-l27/fs/inode.c~nfs_export_kernel-2.4.20 Thu Sep 25 02:30:45 2003 -+++ lum-2.4.20-l27-phil/fs/inode.c Thu Sep 25 02:30:56 2003 +diff -uprN linux/fs/inode.c linux-2.4.20/fs/inode.c +--- linux/fs/inode.c Sun Oct 5 21:52:49 2003 ++++ linux-2.4.20/fs/inode.c Sun Oct 5 21:47:45 2003 @@ -970,9 +970,10 @@ struct inode *igrab(struct inode *inode) } @@ -94,8 +86,9 @@ /* * get_new_inode() will do the right thing, re-trying the search * in case it had to block at any point. ---- lum-2.4.20-l27/fs/namei.c~nfs_export_kernel-2.4.20 Thu Sep 25 02:30:45 2003 -+++ lum-2.4.20-l27-phil/fs/namei.c Thu Sep 25 03:48:58 2003 +diff -uprN linux/fs/namei.c linux-2.4.20/fs/namei.c +--- linux/fs/namei.c Sun Oct 5 21:52:48 2003 ++++ linux-2.4.20/fs/namei.c Sun Oct 5 21:47:45 2003 @@ -22,6 +22,7 @@ #include #include @@ -140,8 +133,24 @@ /* * namei() * ---- lum-2.4.20-l27/fs/nfsd/nfsfh.c~nfs_export_kernel-2.4.20 Thu Nov 28 18:53:15 2002 -+++ lum-2.4.20-l27-phil/fs/nfsd/nfsfh.c Thu Sep 25 02:30:56 2003 +diff -uprN linux/fs/nfsd/export.c linux-2.4.20/fs/nfsd/export.c +--- linux/fs/nfsd/export.c Fri Nov 29 05:23:15 2002 ++++ linux-2.4.20/fs/nfsd/export.c Sun Oct 5 22:25:20 2003 +@@ -222,6 +222,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); +diff -uprN linux/fs/nfsd/nfsfh.c linux-2.4.20/fs/nfsd/nfsfh.c +--- linux/fs/nfsd/nfsfh.c Fri Nov 29 05:23:15 2002 ++++ linux-2.4.20/fs/nfsd/nfsfh.c Sun Oct 5 21:47:45 2003 @@ -36,6 +36,15 @@ struct nfsd_getdents_callback { int sequence; /* sequence counter */ }; @@ -273,8 +282,9 @@ goto out; } ---- lum-2.4.20-l27/fs/nfsd/vfs.c~nfs_export_kernel-2.4.20 Thu Nov 28 18:53:15 2002 -+++ lum-2.4.20-l27-phil/fs/nfsd/vfs.c Thu Sep 25 03:05:28 2003 +diff -uprN linux/fs/nfsd/vfs.c linux-2.4.20/fs/nfsd/vfs.c +--- linux/fs/nfsd/vfs.c Fri Nov 29 05:23:15 2002 ++++ linux-2.4.20/fs/nfsd/vfs.c Sun Oct 5 21:47:45 2003 @@ -77,6 +77,128 @@ struct raparms { static struct raparms * raparml; static struct raparms * raparm_cache; @@ -665,28 +675,20 @@ } dput(rdentry); ---- lum-2.4.20-l27/fs/super.c~nfs_export_kernel-2.4.20 Thu Sep 25 02:30:45 2003 -+++ lum-2.4.20-l27-phil/fs/super.c Thu Sep 25 02:30:56 2003 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - #include - -@@ -51,7 +52,7 @@ spinlock_t sb_lock = SPIN_LOCK_UNLOCKED; - */ - - 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) ---- lum-2.4.20-l27/include/linux/fs.h~nfs_export_kernel-2.4.20 Thu Sep 25 02:30:55 2003 -+++ lum-2.4.20-l27-phil/include/linux/fs.h Thu Sep 25 03:25:37 2003 -@@ -1098,6 +1098,9 @@ extern int open_namei_it(const char *fil +diff -uprN linux/include/linux/fs.h linux-2.4.20/include/linux/fs.h +--- linux/include/linux/fs.h Sun Oct 5 21:52:56 2003 ++++ linux-2.4.20/include/linux/fs.h Sun Oct 5 22:25:20 2003 +@@ -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 + */ +@@ -1099,6 +1102,9 @@ extern int open_namei_it(const char *fil struct nameidata *nd, struct lookup_intent *it); extern struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it); @@ -696,7 +698,7 @@ extern int filp_close(struct file *, fl_owner_t id); extern char * getname(const char *); -@@ -1368,6 +1371,8 @@ extern void path_release(struct nameidat +@@ -1369,6 +1375,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 +707,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) -@@ -1381,6 +1386,8 @@ extern ino_t iunique(struct super_block +@@ -1382,6 +1390,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 +716,9 @@ static inline struct inode *iget(struct super_block *sb, unsigned long ino) { return iget4(sb, ino, NULL, NULL); -@@ -1496,6 +1503,7 @@ extern int dcache_dir_fsync(struct file - extern int dcache_readdir(struct file *, void *, filldir_t); - extern struct file_operations dcache_dir_ops; - -+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); ---- lum-2.4.20-l27/kernel/ksyms.c~nfs_export_kernel-2.4.20 Thu Sep 25 02:30:49 2003 -+++ lum-2.4.20-l27-phil/kernel/ksyms.c Thu Sep 25 02:30:56 2003 +diff -uprN linux/kernel/ksyms.c linux-2.4.20/kernel/ksyms.c +--- linux/kernel/ksyms.c Sun Oct 5 21:52:51 2003 ++++ linux-2.4.20/kernel/ksyms.c Sun Oct 5 22:25:20 2003 @@ -146,6 +146,7 @@ EXPORT_SYMBOL(fget); EXPORT_SYMBOL(igrab); EXPORT_SYMBOL(iunique); @@ -740,10 +735,3 @@ EXPORT_SYMBOL(lookup_hash); EXPORT_SYMBOL(sys_close); EXPORT_SYMBOL(dcache_lock); -@@ -590,3 +592,4 @@ EXPORT_SYMBOL(pidhash); - - /* debug */ - EXPORT_SYMBOL(dump_stack); -+EXPORT_SYMBOL(file_systems_lock); - -_ diff --git a/lustre/kernel_patches/pc/nfs_export_kernel-2.4.20.pc b/lustre/kernel_patches/pc/nfs_export_kernel-2.4.20.pc index 622704f..e70ab4d 100644 --- a/lustre/kernel_patches/pc/nfs_export_kernel-2.4.20.pc +++ b/lustre/kernel_patches/pc/nfs_export_kernel-2.4.20.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/llite/llite_lib.c b/lustre/llite/llite_lib.c index 2dfd6bb..435ef48 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -394,9 +394,6 @@ int ll_fill_super(struct super_block *sb, void *data, int silent) devno = get_uuid2int(sbi2mdc(sbi)->cl_import->imp_target_uuid.uuid, strlen(sbi2mdc(sbi)->cl_import->imp_target_uuid.uuid)); - write_lock(&file_systems_lock); - sb->s_type->fs_flags = FS_REQUIRES_DEV; - write_unlock(&file_systems_lock); sb->s_dev = devno; obd = class_name2obd(osc); @@ -503,9 +500,6 @@ void ll_put_super(struct super_block *sb) ENTRY; CDEBUG(D_VFSTRACE, "VFS Op: sb %p\n", sb); - write_lock(&file_systems_lock); - sb->s_type->fs_flags = 0; - write_unlock(&file_systems_lock); list_del(&sbi->ll_conn_chain); obd_disconnect(sbi->ll_osc_exp, 0);