13 Aug, 2015

6 commits


11 Aug, 2015

22 commits


01 Aug, 2015

1 commit

  • Currently, preprocess_stateid_op calls nfs4_check_olstateid which
    verifies that the open stateid corresponds to the current filehandle in the
    call by calling nfs4_check_fh.

    If the stateid is a NFS4_DELEG_STID however, then no such check is done.
    This could cause incorrect enforcement of permissions, because the
    nfsd_permission() call in nfs4_check_file uses current the current
    filehandle, but any subsequent IO operation will use the file descriptor
    in the stateid.

    Move the call to nfs4_check_fh into nfs4_check_file instead so that it
    can be done for all stateid types.

    Signed-off-by: Jeff Layton
    Cc: stable@vger.kernel.org
    [bfields: moved fh check to avoid NULL deref in special stateid case]
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     

21 Jul, 2015

11 commits

  • Commit 0bf4828983df ("svcrdma: refactor marshalling logic") removed
    the last call site for svc_rdma_fastreg().

    Signed-off-by: Chuck Lever
    Signed-off-by: J. Bruce Fields

    Chuck Lever
     
  • Kernel coding conventions frown upon having large nontrivial
    functions in header files, and the preference these days is to
    allow the compiler to make inlining decisions if possible.

    As these functions are re-homed into a .c file, be sure that
    comparisons with fields in struct rpcrdma_msg are with be32
    constants.

    This is a refactoring change; no behavior change is intended.

    Signed-off-by: Chuck Lever
    Signed-off-by: J. Bruce Fields

    Chuck Lever
     
  • The Linux NFS server returns garbage in the data payload of inline
    NFS/RDMA READ replies. These are READs of under 1000 bytes or so
    where the client has not provided either a reply chunk or a write
    list.

    The NFS server delivers the data payload for an NFS READ reply to
    the transport in an xdr_buf page list. If the NFS client did not
    provide a reply chunk or a write list, send_reply() is supposed to
    set up a separate sge for the page containing the READ data, and
    another sge for XDR padding if needed, then post all of the sges via
    a single SEND Work Request.

    The problem is send_reply() does not advance through the xdr_buf
    when setting up scatter/gather entries for SEND WR. It always calls
    dma_map_xdr with xdr_off set to zero. When there's more than one
    sge, dma_map_xdr() sets up the SEND sge's so they all point to the
    xdr_buf's head.

    The current Linux NFS/RDMA client always provides a reply chunk or
    a write list when performing an NFS READ over RDMA. Therefore, it
    does not exercise this particular case. The Linux server has never
    had to use more than one extra sge for building RPC/RDMA replies
    with a Linux client.

    However, an NFS/RDMA client _is_ allowed to send small NFS READs
    without setting up a write list or reply chunk. The NFS READ reply
    fits entirely within the inline reply buffer in this case. This is
    perhaps a more efficient way of performing NFS READs that the Linux
    NFS/RDMA client may some day adopt.

    Fixes: b432e6b3d9c1 ('svcrdma: Change DMA mapping logic to . . .')
    BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=285
    Signed-off-by: Chuck Lever
    Signed-off-by: J. Bruce Fields

    Chuck Lever
     
  • When removing underlying RDMA device, the rmmod will hang forever if there
    are any outstanding NFS/RDMA client mounts. The outstanding NFS/RDMA counts
    could also prevent the server from shutting down. Further debugging shows
    that the existing connections are not teared down and resource are not
    released when receiving RDMA_CM_EVENT_DEVICE_REMOVAL event. It seems the
    original code missing svc_xprt_put() in RDMA_CM_EVENT_REMOVAL event handler
    thus svc_xprt_free is never invoked to release the existing connection
    resources.

    The patch has been passed removing, adding device back and forth without
    stopping NFS/RDMA service. This will also allow a device to be unplugged
    and swapped out without shutting down NFS service.

    BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=252
    Signed-off-by: Shirley Ma
    Reviewed-by: Chuck Lever
    Signed-off-by: J. Bruce Fields

    Shirley Ma
     
  • Signed-off-by: Kinglong Mee
    Signed-off-by: J. Bruce Fields

    Kinglong Mee
     
  • Just using the macro defined in nfs_idmap.h.

    Signed-off-by: Kinglong Mee
    Signed-off-by: J. Bruce Fields

    Kinglong Mee
     
  • nfs_fs.h is a client's header file.

    # ll fs/nfsd/nfs4acl.o fs/nfsd/nfsd.ko
    -rw-r--r--. 1 root root 328248 Jul 3 19:26 fs/nfsd/nfs4acl.o
    -rw-r--r--. 1 root root 7452016 Jul 3 19:26 fs/nfsd/nfsd.ko

    After this patch,
    # ll fs/nfsd/nfs4acl.o fs/nfsd/nfsd.ko
    -rw-r--r--. 1 root root 150872 Jul 3 19:15 fs/nfsd/nfs4acl.o
    -rw-r--r--. 1 root root 7273792 Jul 3 19:23 fs/nfsd/nfsd.ko

    Signed-off-by: Kinglong Mee
    Signed-off-by: J. Bruce Fields

    Kinglong Mee
     
  • After proc_layoutcommit success, i_size_read(inode) always >= new_size.
    Just set lc_size_chg before proc_layoutcommit, if proc_layoutcommit
    failed, nfsd will skip the lc_size_chg, so it's no harm.

    Signed-off-by: Kinglong Mee
    Signed-off-by: J. Bruce Fields

    Kinglong Mee
     
  • This reverts commit 731d5cca82729c85ca3296902a64836619f4ba2d.

    Commit ffe1f0df5862 ("rpcrdma: Merge svcrdma and xprtrdma modules into
    one") forgot to update the corresponding documentation.

    Reported-by: Valentin Rothberg
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • If lookup_one_len() failed, nfsd should free those memory allocated for fname.

    Signed-off-by: Kinglong Mee
    Signed-off-by: J. Bruce Fields

    Kinglong Mee
     
  • If nfsd4_layout_setlease fails, nfsd will not put ls->ls_file.

    Fix commit c5c707f96f "nfsd: implement pNFS layout recalls".

    Signed-off-by: Kinglong Mee
    Signed-off-by: J. Bruce Fields

    Kinglong Mee