Skip to content

Commit

Permalink
Merge branch 'for-2.6.33' of git://linux-nfs.org/~bfields/linux
Browse files Browse the repository at this point in the history
* 'for-2.6.33' of git://linux-nfs.org/~bfields/linux: (42 commits)
  nfsd: remove pointless paths in file headers
  nfsd: move most of nfsfh.h to fs/nfsd
  nfsd: remove unused field rq_reffh
  nfsd: enable V4ROOT exports
  nfsd: make V4ROOT exports read-only
  nfsd: restrict filehandles accepted in V4ROOT case
  nfsd: allow exports of symlinks
  nfsd: filter readdir results in V4ROOT case
  nfsd: filter lookup results in V4ROOT case
  nfsd4: don't continue "under" mounts in V4ROOT case
  nfsd: introduce export flag for v4 pseudoroot
  nfsd: let "insecure" flag vary by pseudoflavor
  nfsd: new interface to advertise export features
  nfsd: Move private headers to source directory
  vfs: nfsctl.c un-used nfsd #includes
  lockd: Remove un-used nfsd headers #includes
  s390: remove un-used nfsd #includes
  sparc: remove un-used nfsd #includes
  parsic: remove un-used nfsd #includes
  compat.c: Remove dependence on nfsd private headers
  ...
  • Loading branch information
Linus Torvalds committed Dec 16, 2009
2 parents 5ac4d63 + 7663dac commit 37c24b3
Show file tree
Hide file tree
Showing 63 changed files with 719 additions and 863 deletions.
12 changes: 2 additions & 10 deletions Documentation/filesystems/00-INDEX
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
00-INDEX
- this file (info on some of the filesystems supported by linux).
Exporting
- explanation of how to make filesystems exportable.
Locking
- info on locking rules as they pertain to Linux VFS.
9p.txt
Expand Down Expand Up @@ -68,12 +66,8 @@ mandatory-locking.txt
- info on the Linux implementation of Sys V mandatory file locking.
ncpfs.txt
- info on Novell Netware(tm) filesystem using NCP protocol.
nfs41-server.txt
- info on the Linux server implementation of NFSv4 minor version 1.
nfs-rdma.txt
- how to install and setup the Linux NFS/RDMA client and server software.
nfsroot.txt
- short guide on setting up a diskless box with NFS root filesystem.
nfs/
- nfs-related documentation.
nilfs2.txt
- info and mount options for the NILFS2 filesystem.
ntfs.txt
Expand All @@ -92,8 +86,6 @@ relay.txt
- info on relay, for efficient streaming from kernel to user space.
romfs.txt
- description of the ROMFS filesystem.
rpc-cache.txt
- introduction to the caching mechanisms in the sunrpc layer.
seq_file.txt
- how to use the seq_file API
sharedsubtree.txt
Expand Down
16 changes: 16 additions & 0 deletions Documentation/filesystems/nfs/00-INDEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
00-INDEX
- this file (nfs-related documentation).
Exporting
- explanation of how to make filesystems exportable.
knfsd-stats.txt
- statistics which the NFS server makes available to user space.
nfs.txt
- nfs client, and DNS resolution for fs_locations.
nfs41-server.txt
- info on the Linux server implementation of NFSv4 minor version 1.
nfs-rdma.txt
- how to install and setup the Linux NFS/RDMA client and server software
nfsroot.txt
- short guide on setting up a diskless box with NFS root filesystem.
rpc-cache.txt
- introduction to the caching mechanisms in the sunrpc layer.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interoperability problems with future clients. Known issues:
conformant with the spec (for example, we don't use kerberos
on the backchannel correctly).
- no trunking support: no clients currently take advantage of
trunking, but this is a mandatory failure, and its use is
trunking, but this is a mandatory feature, and its use is
recommended to clients in a number of places. (E.g. to ensure
timely renewal in case an existing connection's retry timeouts
have gotten too long; see section 8.3 of the draft.)
Expand Down Expand Up @@ -213,3 +213,10 @@ The following cases aren't supported yet:
DESTROY_CLIENTID, DESTROY_SESSION, EXCHANGE_ID.
* DESTROY_SESSION MUST be the final operation in the COMPOUND request.

Nonstandard compound limitations:
* No support for a sessions fore channel RPC compound that requires both a
ca_maxrequestsize request and a ca_maxresponsesize reply, so we may
fail to live up to the promise we made in CREATE_SESSION fore channel
negotiation.
* No more than one IO operation (read, write, readdir) allowed per
compound.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Documentation/filesystems/porting
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Callers of notify_change() need ->i_mutex now.
New super_block field "struct export_operations *s_export_op" for
explicit support for exporting, e.g. via NFS. The structure is fully
documented at its declaration in include/linux/fs.h, and in
Documentation/filesystems/Exporting.
Documentation/filesystems/nfs/Exporting.

Briefly it allows for the definition of decode_fh and encode_fh operations
to encode and decode filehandles, and allows the filesystem to use
Expand Down
6 changes: 3 additions & 3 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ and is between 256 and 4096 characters. It is defined in the file
No delay

ip= [IP_PNP]
See Documentation/filesystems/nfsroot.txt.
See Documentation/filesystems/nfs/nfsroot.txt.

ip2= [HW] Set IO/IRQ pairs for up to 4 IntelliPort boards
See comment before ip2_setup() in
Expand Down Expand Up @@ -1553,10 +1553,10 @@ and is between 256 and 4096 characters. It is defined in the file
going to be removed in 2.6.29.

nfsaddrs= [NFS]
See Documentation/filesystems/nfsroot.txt.
See Documentation/filesystems/nfs/nfsroot.txt.

nfsroot= [NFS] nfs root filesystem for disk-less boxes.
See Documentation/filesystems/nfsroot.txt.
See Documentation/filesystems/nfs/nfsroot.txt.

nfs.callback_tcpport=
[NFS] set the TCP port on which the NFSv4 callback
Expand Down
6 changes: 0 additions & 6 deletions arch/parisc/kernel/sys_parisc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@
#include <linux/shm.h>
#include <linux/slab.h>
#include <linux/uio.h>
#include <linux/nfs_fs.h>
#include <linux/ncp_fs.h>
#include <linux/sunrpc/svc.h>
#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/cache.h>
#include <linux/nfsd/xdr.h>
#include <linux/nfsd/syscall.h>
#include <linux/poll.h>
#include <linux/personality.h>
#include <linux/stat.h>
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

/*
* See Documentation/filesystems/Exporting
* See Documentation/filesystems/nfs/Exporting
* and examples in fs/exportfs
*
* Since cifs is a network file system, an "fsid" must be included for
Expand Down
2 changes: 0 additions & 2 deletions fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
#include <linux/dirent.h>
#include <linux/fsnotify.h>
#include <linux/highuid.h>
#include <linux/sunrpc/svc.h>
#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/syscall.h>
#include <linux/personality.h>
#include <linux/rwsem.h>
Expand Down
2 changes: 1 addition & 1 deletion fs/exportfs/expfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* and for mapping back from file handles to dentries.
*
* For details on why we do all the strange and hairy things in here
* take a look at Documentation/filesystems/Exporting.
* take a look at Documentation/filesystems/nfs/Exporting.
*/
#include <linux/exportfs.h>
#include <linux/fs.h>
Expand Down
2 changes: 1 addition & 1 deletion fs/isofs/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* The following files are helpful:
*
* Documentation/filesystems/Exporting
* Documentation/filesystems/nfs/Exporting
* fs/exportfs/expfs.c.
*/

Expand Down
4 changes: 0 additions & 4 deletions fs/lockd/svc4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
#include <linux/time.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/in.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/clnt.h>
#include <linux/nfsd/nfsd.h>
#include <linux/lockd/lockd.h>
#include <linux/lockd/share.h>

Expand Down
4 changes: 0 additions & 4 deletions fs/lockd/svcproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
#include <linux/time.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/in.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/clnt.h>
#include <linux/nfsd/nfsd.h>
#include <linux/lockd/lockd.h>
#include <linux/lockd/share.h>

Expand Down
2 changes: 1 addition & 1 deletion fs/nfs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ config ROOT_NFS
If you want your system to mount its root file system via NFS,
choose Y here. This is common practice for managing systems
without local permanent storage. For details, read
<file:Documentation/filesystems/nfsroot.txt>.
<file:Documentation/filesystems/nfs/nfsroot.txt>.

Most people say N here.

Expand Down
2 changes: 0 additions & 2 deletions fs/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include <linux/types.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/sunrpc/svc.h>
#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/syscall.h>
#include <linux/cred.h>
#include <linux/sched.h>
Expand Down
12 changes: 2 additions & 10 deletions fs/nfsd/auth.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
/*
* linux/fs/nfsd/auth.c
*
* Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
*/
/* Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de> */

#include <linux/types.h>
#include <linux/sched.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/svcauth.h>
#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/export.h>
#include "nfsd.h"
#include "auth.h"

int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
Expand Down
5 changes: 1 addition & 4 deletions include/linux/nfsd/cache.h → fs/nfsd/cache.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* include/linux/nfsd/cache.h
*
* Request reply cache. This was heavily inspired by the
* implementation in 4.3BSD/4.4BSD.
*
Expand All @@ -10,8 +8,7 @@
#ifndef NFSCACHE_H
#define NFSCACHE_H

#include <linux/in.h>
#include <linux/uio.h>
#include <linux/sunrpc/svc.h>

/*
* Representation of a reply cache entry.
Expand Down
65 changes: 37 additions & 28 deletions fs/nfsd/export.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#define MSNFS /* HACK HACK */
/*
* linux/fs/nfsd/export.c
*
* NFS exporting and validation.
*
* We maintain a list of clients, each of which has a list of
Expand All @@ -14,29 +12,16 @@
* Copyright (C) 1995, 1996 Olaf Kirch, <okir@monad.swb.de>
*/

#include <linux/unistd.h>
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/in.h>
#include <linux/seq_file.h>
#include <linux/syscalls.h>
#include <linux/rwsem.h>
#include <linux/dcache.h>
#include <linux/namei.h>
#include <linux/mount.h>
#include <linux/hash.h>
#include <linux/module.h>
#include <linux/exportfs.h>

#include <linux/sunrpc/svc.h>
#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/nfsfh.h>
#include <linux/nfsd/syscall.h>
#include <linux/lockd/bind.h>
#include <linux/sunrpc/msg_prot.h>
#include <linux/sunrpc/gss_api.h>
#include <net/ipv6.h>

#include "nfsd.h"
#include "nfsfh.h"

#define NFSDDBG_FACILITY NFSDDBG_EXPORT

typedef struct auth_domain svc_client;
Expand Down Expand Up @@ -369,16 +354,25 @@ static struct svc_export *svc_export_update(struct svc_export *new,
struct svc_export *old);
static struct svc_export *svc_export_lookup(struct svc_export *);

static int check_export(struct inode *inode, int flags, unsigned char *uuid)
static int check_export(struct inode *inode, int *flags, unsigned char *uuid)
{

/* We currently export only dirs and regular files.
* This is what umountd does.
/*
* We currently export only dirs, regular files, and (for v4
* pseudoroot) symlinks.
*/
if (!S_ISDIR(inode->i_mode) &&
!S_ISLNK(inode->i_mode) &&
!S_ISREG(inode->i_mode))
return -ENOTDIR;

/*
* Mountd should never pass down a writeable V4ROOT export, but,
* just to make sure:
*/
if (*flags & NFSEXP_V4ROOT)
*flags |= NFSEXP_READONLY;

/* There are two requirements on a filesystem to be exportable.
* 1: We must be able to identify the filesystem from a number.
* either a device number (so FS_REQUIRES_DEV needed)
Expand All @@ -387,7 +381,7 @@ static int check_export(struct inode *inode, int flags, unsigned char *uuid)
* This means that s_export_op must be set.
*/
if (!(inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV) &&
!(flags & NFSEXP_FSID) &&
!(*flags & NFSEXP_FSID) &&
uuid == NULL) {
dprintk("exp_export: export of non-dev fs without fsid\n");
return -EINVAL;
Expand Down Expand Up @@ -602,7 +596,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
goto out4;
}

err = check_export(exp.ex_path.dentry->d_inode, exp.ex_flags,
err = check_export(exp.ex_path.dentry->d_inode, &exp.ex_flags,
exp.ex_uuid);
if (err)
goto out4;
Expand Down Expand Up @@ -1041,7 +1035,7 @@ exp_export(struct nfsctl_export *nxp)
goto finish;
}

err = check_export(path.dentry->d_inode, nxp->ex_flags, NULL);
err = check_export(path.dentry->d_inode, &nxp->ex_flags, NULL);
if (err) goto finish;

err = -ENOMEM;
Expand Down Expand Up @@ -1320,6 +1314,23 @@ rqst_exp_parent(struct svc_rqst *rqstp, struct path *path)
return exp;
}

static struct svc_export *find_fsidzero_export(struct svc_rqst *rqstp)
{
struct svc_export *exp;
u32 fsidv[2];

mk_fsid(FSID_NUM, fsidv, 0, 0, 0, NULL);

exp = rqst_exp_find(rqstp, FSID_NUM, fsidv);
/*
* We shouldn't have accepting an nfsv4 request at all if we
* don't have a pseudoexport!:
*/
if (IS_ERR(exp) && PTR_ERR(exp) == -ENOENT)
exp = ERR_PTR(-ESERVERFAULT);
return exp;
}

/*
* Called when we need the filehandle for the root of the pseudofs,
* for a given NFSv4 client. The root is defined to be the
Expand All @@ -1330,11 +1341,8 @@ exp_pseudoroot(struct svc_rqst *rqstp, struct svc_fh *fhp)
{
struct svc_export *exp;
__be32 rv;
u32 fsidv[2];

mk_fsid(FSID_NUM, fsidv, 0, 0, 0, NULL);

exp = rqst_exp_find(rqstp, FSID_NUM, fsidv);
exp = find_fsidzero_export(rqstp);
if (IS_ERR(exp))
return nfserrno(PTR_ERR(exp));
rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL);
Expand Down Expand Up @@ -1425,6 +1433,7 @@ static struct flags {
{ NFSEXP_CROSSMOUNT, {"crossmnt", ""}},
{ NFSEXP_NOSUBTREECHECK, {"no_subtree_check", ""}},
{ NFSEXP_NOAUTHNLM, {"insecure_locks", ""}},
{ NFSEXP_V4ROOT, {"v4root", ""}},
#ifdef MSNFS
{ NFSEXP_MSNFS, {"msnfs", ""}},
#endif
Expand Down
10 changes: 2 additions & 8 deletions fs/nfsd/lockd.c
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
/*
* linux/fs/nfsd/lockd.c
*
* This file contains all the stubs needed when communicating with lockd.
* This level of indirection is necessary so we can run nfsd+lockd without
* requiring the nfs client to be compiled in/loaded, and vice versa.
*
* Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
*/

#include <linux/types.h>
#include <linux/fs.h>
#include <linux/file.h>
#include <linux/mount.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc.h>
#include <linux/nfsd/nfsd.h>
#include <linux/lockd/bind.h>
#include "nfsd.h"
#include "vfs.h"

#define NFSDDBG_FACILITY NFSDDBG_LOCKD

Expand Down
Loading

0 comments on commit 37c24b3

Please sign in to comment.