30 May, 2011

1 commit

  • * 'for-2.6.40' of git://linux-nfs.org/~bfields/linux: (22 commits)
    nfsd: make local functions static
    NFSD: Remove unused variable from nfsd4_decode_bind_conn_to_session()
    NFSD: Check status from nfsd4_map_bcts_dir()
    NFSD: Remove setting unused variable in nfsd_vfs_read()
    nfsd41: error out on repeated RECLAIM_COMPLETE
    nfsd41: compare request's opcnt with session's maxops at nfsd4_sequence
    nfsd v4.1 lOCKT clientid field must be ignored
    nfsd41: add flag checking for create_session
    nfsd41: make sure nfs server process OPEN with EXCLUSIVE4_1 correctly
    nfsd4: fix wrongsec handling for PUTFH + op cases
    nfsd4: make fh_verify responsibility of nfsd_lookup_dentry caller
    nfsd4: introduce OPDESC helper
    nfsd4: allow fh_verify caller to skip pseudoflavor checks
    nfsd: distinguish functions of NFSD_MAY_* flags
    svcrpc: complete svsk processing on cb receive failure
    svcrpc: take advantage of tcp autotuning
    SUNRPC: Don't wait for full record to receive tcp data
    svcrpc: copy cb reply instead of pages
    svcrpc: close connection if client sends short packet
    svcrpc: note network-order types in svc_process_calldir
    ...

    Linus Torvalds
     

19 May, 2011

1 commit


31 Mar, 2011

1 commit


09 Dec, 2010

1 commit

  • If vfs_getattr in fill_post_wcc returns an error, we don't
    set fh_post_change.
    For NFSv4, this can result in set_change_info triggering a BUG_ON.
    i.e. fh_post_saved being zero isn't really a bug.

    So:
    - instead of BUGging when fh_post_saved is zero, just clear ->atomic.
    - if vfs_getattr fails in fill_post_wcc, take a copy of i_ctime anyway.
    This will be used i seg_change_info, but not overly trusted.
    - While we are there, remove the pointless 'if' statements in set_change_info.
    There is no harm setting all the values.

    Signed-off-by: NeilBrown
    Cc: stable@kernel.org
    Signed-off-by: J. Bruce Fields

    Neil Brown
     

16 Dec, 2009

1 commit


15 Dec, 2009

2 commits


15 Nov, 2009

1 commit

  • Commit 8177e6d6dfb9cd03d9bdeb647c32161f8f58f686 ("nfsd: clean up
    readdirplus encoding") introduced single character typo in nfs3 readdir+
    implementation. Unfortunately that typo has quite bad side effects:
    random memory corruption, followed (on my box) with immediate
    spontaneous box reboot.

    Using 'p1' instead of 'p' fixes my Linux box rebooting whenever VMware
    ESXi box tries to list contents of my home directory.

    Signed-off-by: Petr Vandrovec
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Signed-off-by: Linus Torvalds

    Petr Vandrovec
     

05 Sep, 2009

2 commits


29 Apr, 2009

1 commit

  • ext4 supports a real NFSv4 change attribute, which is bumped whenever
    the ctime would be updated, including times when two updates arrive
    within a jiffy of each other. (Note that although ext4 has space for
    nanosecond-precision ctime, the real resolution is lower: it actually
    uses jiffies as the time-source.) This ensures clients will invalidate
    their caches when they need to.

    There is some fear that keeping the i_version up-to-date could have
    performance drawbacks, so for now it's turned on only by a mount option.
    We hope to do something better eventually.

    Signed-off-by: J. Bruce Fields
    Cc: Theodore Tso

    J. Bruce Fields
     

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

4 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
     

28 Mar, 2007

1 commit

  • ->readdir passes lofft_t offsets (used as nfs cookies) to
    nfs3svc_encode_entry{,_plus}, but when they pass it on to encode_entry it
    becomes an 'off_t', which isn't good.

    So filesystems that returned 64bit offsets would lose.

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

    NeilBrown
     

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

3 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
     

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
     

07 Nov, 2005

1 commit

  • There are a couple of tests which could possibly be confused by extremely
    large numbers appearing in 'xdr' packets. I think the closest to an exploit
    you could get would be writing random data from a free page into a file - i.e.
    leak data out of kernel space.

    I'm fairly sure they cannot be used for remote compromise.

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

    NeilBrown
     

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