diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
commit | 012bb3e61e5eced6c610f9e036372bf0c8def2d1 (patch) | |
tree | 87efc733f9b164e8c85c0336f92c8fb7eff6d183 /fs/nfsd | |
parent | 625a1589d3d6464b5d90b8a0918789e3afffd220 (diff) |
Merge with Linux 2.4.0-test9. Please check DECstation, I had a number
of rejects to fixup while integrating Linus patches. I also found
that this kernel will only boot SMP on Origin; the UP kernel freeze
soon after bootup with SCSI timeout messages. I commit this anyway
since I found that the last CVS versions had the same problem.
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/export.c | 14 | ||||
-rw-r--r-- | fs/nfsd/nfs3proc.c | 1 | ||||
-rw-r--r-- | fs/nfsd/nfs3xdr.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfsctl.c | 10 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfssvc.c | 10 | ||||
-rw-r--r-- | fs/nfsd/nfsxdr.c | 2 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 46 |
8 files changed, 69 insertions, 18 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index df2532048..2beed5cf9 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -1,3 +1,4 @@ +#define MSNFS /* HACK HACK */ /* * linux/fs/nfsd/export.c * @@ -56,12 +57,12 @@ struct svc_clnthash { struct svc_client * h_client; }; static struct svc_clnthash * clnt_hash[CLIENT_HASHMAX]; -static svc_client * clients = NULL; -static int initialized = 0; +static svc_client * clients; +static int initialized; -static int hash_lock = 0; -static int want_lock = 0; -static int hash_count = 0; +static int hash_lock; +static int want_lock; +static int hash_count; static DECLARE_WAIT_QUEUE_HEAD( hash_wait ); @@ -556,6 +557,9 @@ struct flags { { NFSEXP_CROSSMNT, {"nohide", ""}}, { NFSEXP_NOSUBTREECHECK, {"no_subtree_check", ""}}, { NFSEXP_NOAUTHNLM, {"insecure_locks", ""}}, +#ifdef NSMFS + { NFSEXP_MSNFS, {"msnfs", ""}}, +#endif { 0, {"", ""}} }; diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c index e6118a967..a513bfbe0 100644 --- a/fs/nfsd/nfs3proc.c +++ b/fs/nfsd/nfs3proc.c @@ -11,6 +11,7 @@ #include <linux/errno.h> #include <linux/locks.h> #include <linux/fs.h> +#include <linux/ext2_fs.h> #include <linux/stat.h> #include <linux/fcntl.h> #include <linux/net.h> diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 308db4cd5..d97e1717d 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c @@ -193,7 +193,7 @@ encode_fattr3(struct svc_rqst *rqstp, u32 *p, struct dentry *dentry) p = xdr_encode_hyper(p, (u64) inode->i_dev); p = xdr_encode_hyper(p, (u64) inode->i_ino); p = encode_time3(p, inode->i_atime); - p = encode_time3(p, inode->i_mtime); + p = encode_time3(p, lease_get_mtime(inode)); p = encode_time3(p, inode->i_ctime); return p; diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 20e82fa7a..7a80fe990 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -46,7 +46,7 @@ static int nfsctl_getfs(struct nfsctl_fsparm *, struct knfsd_fh *); static int nfsctl_ugidupdate(struct nfsctl_ugidmap *data); #endif -static int initialized = 0; +static int initialized; int exp_procfs_exports(char *buffer, char **start, off_t offset, int length, int *eof, void *data); @@ -312,7 +312,9 @@ done: EXPORT_NO_SYMBOLS; MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>"); -extern long (*do_nfsservctl)(int, void *, void *); +struct nfsd_linkage nfsd_linkage_s = { + do_nfsservctl: handle_sys_nfsservctl, +}; /* * Initialize the module @@ -321,7 +323,7 @@ int init_module(void) { printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); - do_nfsservctl = handle_sys_nfsservctl; + nfsd_linkage = &nfsd_linkage_s; return 0; } @@ -331,7 +333,7 @@ init_module(void) void cleanup_module(void) { - do_nfsservctl = NULL; + nfsd_linkage = NULL; nfsd_export_shutdown(); nfsd_cache_shutdown(); remove_proc_entry("fs/nfs/exports", NULL); diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index d1b6306db..672d66bf8 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -405,7 +405,7 @@ find_fh_dentry(struct super_block *sb, ino_t ino, int generation, ino_t dirino, || !S_ISDIR(dentry->d_inode->i_mode)) { goto err_dentry; } - if ((!dentry->d_flags & DCACHE_NFSD_DISCONNECTED)) + if (!(dentry->d_flags & DCACHE_NFSD_DISCONNECTED)) found = 1; tmp = splice(result, dentry); err = PTR_ERR(tmp); diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 11297fef5..a4a642c44 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -41,9 +41,9 @@ extern struct svc_program nfsd_program; static void nfsd(struct svc_rqst *rqstp); -struct timeval nfssvc_boot = { 0, 0 }; -static struct svc_serv *nfsd_serv = NULL; -static int nfsd_busy = 0; +struct timeval nfssvc_boot; +static struct svc_serv *nfsd_serv; +static int nfsd_busy; static unsigned long nfsd_last_call; struct nfsd_list { @@ -155,6 +155,8 @@ nfsd(struct svc_rqst *rqstp) sprintf(current->comm, "nfsd"); current->fs->umask = 0; + current->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY; + nfsdstats.th_cnt++; /* Let svc_process check client's authentication. */ rqstp->rq_auth = 1; @@ -213,7 +215,7 @@ nfsd(struct svc_rqst *rqstp) unsigned int signo; for (signo = 1; signo <= _NSIG; signo++) - if (sigismember(¤t->signal, signo) && + if (sigismember(¤t->pending.signal, signo) && !sigismember(¤t->blocked, signo)) break; printk(KERN_WARNING "nfsd: terminating on signal %d\n", signo); diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c index 9127e0869..fcbddc5ed 100644 --- a/fs/nfsd/nfsxdr.c +++ b/fs/nfsd/nfsxdr.c @@ -155,7 +155,7 @@ encode_fattr(struct svc_rqst *rqstp, u32 *p, struct inode *inode) *p++ = htonl((u32) inode->i_ino); *p++ = htonl((u32) inode->i_atime); *p++ = 0; - *p++ = htonl((u32) inode->i_mtime); + *p++ = htonl((u32) lease_get_mtime(inode)); *p++ = 0; *p++ = htonl((u32) inode->i_ctime); *p++ = 0; diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 20fa7fafe..a796885e3 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1,3 +1,4 @@ +#define MSNFS /* HACK HACK */ /* * linux/fs/nfsd/vfs.c * @@ -142,6 +143,7 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name, } else dentry = dget(dparent->d_parent); } else { + fh_lock(fhp); dentry = lookup_one(name, dparent); err = PTR_ERR(dentry); if (IS_ERR(dentry)) @@ -248,6 +250,15 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap) if (err) goto out; } + + /* + * If we are changing the size of the file, then + * we need to break all leases. + */ + err = get_lease(inode, FMODE_WRITE); + if (err) + goto out_nfserr; + err = get_write_access(inode); if (err) goto out_nfserr; @@ -442,6 +453,14 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, if (!inode->i_fop) goto out; + /* + * Check to see if there are any leases on this file. + * This may block while leases are broken. + */ + err = get_lease(inode, (access & MAY_WRITE) ? FMODE_WRITE : 0); + if (err) + goto out_nfserr; + if ((access & MAY_WRITE) && (err = get_write_access(inode)) != 0) goto out_nfserr; @@ -450,11 +469,11 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, atomic_set(&filp->f_count, 1); filp->f_dentry = dentry; if (access & MAY_WRITE) { - filp->f_flags = O_WRONLY; + filp->f_flags = O_WRONLY|O_LARGEFILE; filp->f_mode = FMODE_WRITE; DQUOT_INIT(inode); } else { - filp->f_flags = O_RDONLY; + filp->f_flags = O_RDONLY|O_LARGEFILE; filp->f_mode = FMODE_READ; } @@ -576,6 +595,11 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, err = nfserr_perm; if (!file.f_op->read) goto out_close; +#ifdef MSNFS + if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) && + (!lock_may_read(file.f_dentry->d_inode, offset, *count))) + goto out_close; +#endif /* Get readahead parameters */ ra = nfsd_get_raparms(fhp->fh_export->ex_dev, fhp->fh_dentry->d_inode->i_ino); @@ -642,6 +666,11 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, err = nfserr_perm; if (!file.f_op->write) goto out_close; +#ifdef MSNFS + if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) && + (!lock_may_write(file.f_dentry->d_inode, offset, cnt))) + goto out_close; +#endif dentry = file.f_dentry; inode = dentry->d_inode; @@ -1249,6 +1278,13 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen, goto out_dput_old; +#ifdef MSNFS + if ((ffhp->fh_export->ex_flags & NFSEXP_MSNFS) && + ((atomic_read(&odentry->d_count) > 1) + || (atomic_read(&ndentry->d_count) > 1))) { + err = nfserr_perm; + } else +#endif err = vfs_rename(fdir, odentry, tdir, ndentry); if (!err && EX_ISSYNC(tfhp->fh_export)) { nfsd_sync_dir(tdentry); @@ -1310,6 +1346,12 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, } if (type != S_IFDIR) { /* It's UNLINK */ +#ifdef MSNFS + if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) && + (atomic_read(&rdentry->d_count) > 1)) { + err = nfserr_perm; + } else +#endif err = vfs_unlink(dirp, rdentry); } else { /* It's RMDIR */ err = vfs_rmdir(dirp, rdentry); |