14 Jul, 2016

1 commit


16 Apr, 2015

1 commit


23 Jun, 2014

1 commit


23 May, 2014

1 commit

  • Assignments should not happen inside an if conditional, but in the line
    before. This issue was reported by checkpatch.

    The semantic patch that makes this change is as follows
    (http://coccinelle.lip6.fr/):

    //

    @@
    identifier i1;
    expression e1;
    statement S;
    @@
    -if(!(i1 = e1)) S
    +i1 = e1;
    +if(!i1)
    +S

    //

    It has been tested by compilation.

    Signed-off-by: Benoit Taine
    Signed-off-by: J. Bruce Fields

    Benoit Taine
     

04 Apr, 2014

1 commit

  • This reverts the part of commit 6e14b46b91fee8a049b0940333ce13a820beaaa5
    that changes NFSv2 behavior.

    Mark Lord found that it broke nfs-root for Linux clients, because it
    broke NFSv2.

    In fact, from RFC 1094:

    "Notice that the file type is specified both in the mode bits
    and in the file type. This is really a bug in the protocol and
    will be fixed in future versions."

    So NFSv2 clients really are expected to depend on the high bits of the
    mode.

    Cc: stable@kernel.org
    Reported-by: Mark Lord
    Reviewed-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

11 Dec, 2013

1 commit

  • The Linux NFS server replies among other things to a "Check access permission"
    the following:

    NFS: File type = 2 (Directory)
    NFS: Mode = 040755

    A netapp server replies here:
    NFS: File type = 2 (Directory)
    NFS: Mode = 0755

    The RFC 1813 i read:
    fattr3

    struct fattr3 {
    ftype3 type;
    mode3 mode;
    uint32 nlink;
    ...
    For the mode bits only the lowest 9 are defined in the RFC

    As far as I can tell, knfsd has always done this, so apparently it's harmless.
    Nevertheless, it appears to be wrong.

    Note this is already correct in the NFSv4 case, only v2 and v3 need
    fixing.

    Signed-off-by: J. Bruce Fields

    Albert Fluegel
     

27 Feb, 2013

1 commit

  • Pull vfs pile (part one) from Al Viro:
    "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent
    locking violations, etc.

    The most visible changes here are death of FS_REVAL_DOT (replaced with
    "has ->d_weak_revalidate()") and a new helper getting from struct file
    to inode. Some bits of preparation to xattr method interface changes.

    Misc patches by various people sent this cycle *and* ocfs2 fixes from
    several cycles ago that should've been upstream right then.

    PS: the next vfs pile will be xattr stuff."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits)
    saner proc_get_inode() calling conventions
    proc: avoid extra pde_put() in proc_fill_super()
    fs: change return values from -EACCES to -EPERM
    fs/exec.c: make bprm_mm_init() static
    ocfs2/dlm: use GFP_ATOMIC inside a spin_lock
    ocfs2: fix possible use-after-free with AIO
    ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path
    get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero
    target: writev() on single-element vector is pointless
    export kernel_write(), convert open-coded instances
    fs: encode_fh: return FILEID_INVALID if invalid fid_type
    kill f_vfsmnt
    vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op
    nfsd: handle vfs_getattr errors in acl protocol
    switch vfs_getattr() to struct path
    default SET_PERSONALITY() in linux/elf.h
    ceph: prepopulate inodes only when request is aborted
    d_hash_and_lookup(): export, switch open-coded instances
    9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate()
    9p: split dropping the acls from v9fs_set_create_acl()
    ...

    Linus Torvalds
     

26 Feb, 2013

2 commits


13 Feb, 2013

2 commits

  • When reading uids and gids off the wire convert them to
    kuids and kgids. If the conversion results in an invalid
    result don't set the ATTR_UID or ATTR_GID.

    When putting kuids and kgids onto the wire first convert
    them to uids and gids the other side will understand.

    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • These trivial macros that don't currently do anything are the last
    vestiages of an old attempt at uid mapping that was removed from the
    kernel in September of 2002. Remove them to make it clear what the
    code is currently doing.

    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

18 Dec, 2012

1 commit


31 Mar, 2011

1 commit


16 Dec, 2009

1 commit


15 Dec, 2009

2 commits


15 Feb, 2008

1 commit

  • I'm embedding struct path into struct svc_export.

    [akpm@linux-foundation.org: coding-style fixes]
    [ezk@cs.sunysb.edu: NFSD: fix wrong mnt_writer count in rename]
    Signed-off-by: Jan Blunck
    Acked-by: J. Bruce Fields
    Acked-by: Christoph Hellwig
    Cc: Al Viro
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Cc: Trond Myklebust
    Signed-off-by: Erez Zadok
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Blunck
     

02 Feb, 2008

3 commits


14 Jan, 2008

1 commit

  • When RPCSEC/GSS and krb5i is used, requests are padded, typically to a multiple
    of 8 bytes. This can make the request look slightly longer than it
    really is.

    As of

    f34b95689d2ce001c "The NFSv2/NFSv3 server does not handle zero
    length WRITE request correctly",

    the xdr decode routines for NFSv2 and NFSv3 reject requests that aren't
    the right length, so krb5i (for example) WRITE requests can get lost.

    This patch relaxes the appropriate test and enhances the related comment.

    Signed-off-by: Neil Brown
    Signed-off-by: J. Bruce Fields
    Cc: Peter Staubach
    Signed-off-by: Linus Torvalds

    NeilBrown
     

10 Oct, 2007

1 commit

  • Modify the NFS server code to support 64 bit ino's, as
    appropriate for the system and the NFS protocol version.

    The gist of the changes is to query the underlying file system
    for attributes and not just to use the cached attributes in the
    inode. For this specific purpose, the inode only contains an
    ino field which unsigned long, which is large enough on 64 bit
    platforms, but is not large enough on 32 bit platforms.

    I haven't been able to find any reason why ->getattr can't be called
    while i_mutex. The specification indicates that i_mutex is not
    required to be held in order to invoke ->getattr, but it doesn't say
    that i_mutex can't be held while invoking ->getattr.

    I also haven't come to any conclusions regarding the value of
    lease_get_mtime() and whether it should or should not be invoked
    by fill_post_wcc() too. I chose not to change this because I
    thought that it was safer to leave well enough alone. If we
    decide to make a change, it can be done separately.

    Signed-off-by: Peter Staubach
    Signed-off-by: J. Bruce Fields
    Acked-by: Neil Brown

    Peter Staubach
     

10 May, 2007

2 commits

  • 1/ decode_sattr and decode_sattr3 never return NULL, so remove
    several checks for that. ditto for xdr_decode_hyper.

    2/ replace some open coded XDR_QUADLEN calls with calls to
    XDR_QUADLEN

    3/ in decode_writeargs, simply an 'if' to use a single
    calculation.
    .page_len is the length of that part of the packet that did
    not fit in the first page (the head).
    So the length of the data part is the remainder of the
    head, plus page_len.

    3/ other minor cleanups.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • The NFSv2 and NFSv3 servers do not handle WRITE requests for 0 bytes
    correctly. The specifications indicate that the server should accept the
    request, but it should mostly turn into a no-op. Currently, the server
    will return an XDR decode error, which it should not.

    Attached is a patch which addresses this issue. It also adds some boundary
    checking to ensure that the request contains as much data as was requested
    to be written. It also correctly handles an NFSv3 request which requests
    to write more data than the server has stated that it is prepared to
    handle. Previously, there was some support which looked like it should
    work, but wasn't quite right.

    Signed-off-by: Peter Staubach
    Acked-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Staubach
     

15 Feb, 2007

1 commit

  • Add support for using a filesystem UUID to identify and export point in the
    filehandle.

    For NFSv2, this UUID is xor-ed down to 4 or 8 bytes so that it doesn't take up
    too much room. For NFSv3+, we use the full 16 bytes, and possibly also a
    64bit inode number for exports beneath the root of a filesystem.

    When generating an fsid to return in 'stat' information, use the UUID (hashed
    down to size) if it is available and a small 'fsid' was not specifically
    provided.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     

27 Jan, 2007

1 commit

  • nfsd defines a type 'encode_dent_fn' which is much like 'filldir_t' except
    that the first pointer is 'struct readdir_cd *' rather than 'void *'. It
    then casts encode_dent_fn points to 'filldir_t' as needed. This hides any
    other type mismatches between the two such as the fact that the 'ino' arg
    recently changed from ino_t to u64.

    So: get rid of 'encode_dent_fn', get rid of the cast of the function type,
    change the first arg of various functions from 'struct readdir_cd *' to
    'void *', and live with the fact that we have a little less type checking
    on the calling of these functions now. Less internal (to nfsd) checking
    offset by more external checking, which is more important.

    Thanks to Gabriel Paubert for discovering this and
    providing an initial patch.

    Signed-off-by: Gabriel Paubert
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     

08 Dec, 2006

1 commit

  • This patch removes the unused NFSD_OPTIMIZE_SPACE.

    Additionally, it does differently what NFSD_OPTIMIZE_SPACE was supposed to do:

    Nowadays, gcc knows best when to inline code, and CONFIG_CC_OPTIMIZE_FOR_SIZE
    even tells gcc globally whether to optimize for size or for speed. Therefore,
    this patch also removes all inline's from these files.

    Signed-off-by: Adrian Bunk
    Acked-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

21 Oct, 2006

1 commit


04 Oct, 2006

4 commits

  • The limit over UDP remains at 32K. Also, make some of the apparently
    arbitrary sizing constants clearer.

    The biggest change here involves replacing NFSSVC_MAXBLKSIZE by a function of
    the rqstp. This allows it to be different for different protocols (udp/tcp)
    and also allows it to depend on the servers declared sv_bufsiz.

    Note that we don't actually increase sv_bufsz for nfs yet. That comes next.

    Signed-off-by: Greg Banks
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Greg Banks
     
  • .. by allocating the array of 'kvec' in 'struct svc_rqst'.

    As we plan to increase RPCSVC_MAXPAGES from 8 upto 256, we can no longer
    allocate an array of this size on the stack. So we allocate it in 'struct
    svc_rqst'.

    However svc_rqst contains (indirectly) an array of the same type and size
    (actually several, but they are in a union). So rather than waste space, we
    move those arrays out of the separately allocated union and into svc_rqst to
    share with the kvec moved out of svc_tcp_recvfrom (various arrays are used at
    different times, so there is no conflict).

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • We are planning to increase RPCSVC_MAXPAGES from about 8 to about 256. This
    means we need to be a bit careful about arrays of size RPCSVC_MAXPAGES.

    struct svc_rqst contains two such arrays. However the there are never more
    that RPCSVC_MAXPAGES pages in the two arrays together, so only one array is
    needed.

    The two arrays are for the pages holding the request, and the pages holding
    the reply. Instead of two arrays, we can simply keep an index into where the
    first reply page is.

    This patch also removes a number of small inline functions that probably
    server to obscure what is going on rather than clarify it, and opencode the
    needed functionality.

    Also remove the 'rq_restailpage' variable as it is *always* 0. i.e. if the
    response 'xdr' structure has a non-empty tail it is always in the same pages
    as the head.

    check counters are initilised and incr properly
    check for consistant usage of ++ etc
    maybe extra some inlines for common approach
    general review

    Signed-off-by: Neil Brown
    Cc: Magnus Maatta
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Many files include the filename at the beginning, serveral used a wrong one.

    Signed-off-by: Uwe Zeisberger
    Signed-off-by: Adrian Bunk

    Uwe Zeisberger
     

15 Jan, 2006

1 commit


07 Jan, 2006

1 commit

  • Both vfs_getattr and i_op->fsync return error statuses which nfsd was
    largely ignoring. This as noticed when exporting directories using fuse.

    This patch cleans up most of the offences, which involves moving the call
    to vfs_getattr out of the xdr encoding routines (where it is too late to
    report an error) into the main NFS procedure handling routines.

    There is still a called to vfs_gettattr (related to the ACL code) where the
    status is ignored, and called to nfsd_sync_dir don't check return status
    either.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Shaw
     

23 Jun, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds