03 Aug, 2012

1 commit


31 Jul, 2012

3 commits

  • This patch exports symbols needed by the v4 module. In addition, I also
    switch over to using IS_ENABLED() to check if CONFIG_NFS_V4 or
    CONFIG_NFS_V4_MODULE are set.

    The module (nfs4.ko) will be created in the same directory as nfs.ko and
    will be automatically loaded the first time you try to mount over NFS v4.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • v2 and v4 don't use it, so I create two new nfs_rpc_ops functions to
    initialize the ACL client only when we are using v3.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • I'm already looking up the nfs subversion in nfs_fs_mount(), so I have
    easy access to rpc_ops that used to be difficult to reach. This allows
    me to set up a different mount path for NFS v2/3 and NFS v4.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     

17 Jul, 2012

1 commit


14 Jul, 2012

1 commit

  • Don't pass nfs_open_context() to ->create(). Only the NFS4 implementation
    needed that and only because it wanted to return an open file using open
    intents. That task has been replaced by ->atomic_open so it is not necessary
    anymore to pass the context to the create rpc operation.

    Despite nfs4_proc_create apparently being okay with a NULL context it Oopses
    somewhere down the call chain. So allocate a context here.

    Signed-off-by: Miklos Szeredi
    CC: Trond Myklebust
    Signed-off-by: Al Viro

    Miklos Szeredi
     

29 Jun, 2012

7 commits


06 Jun, 2012

1 commit

  • The new commit code fails to copy the verifier into the wb_verf field
    of _all_ the nfs_page structures; it only copies it into the first entry.
    The consequence is that most requests end up failing to match in
    nfs_commit_release.

    Fix is to copy the verifier into the req->wb_verf field in
    nfs_write_completion.

    Signed-off-by: Trond Myklebust
    Cc: Fred Isaman

    Trond Myklebust
     

05 Jun, 2012

1 commit

  • The open recovery code does not need to request a new value for the
    mdsthreshold, and so does not allocate a struct nfs4_threshold.
    The problem is that encode_getfattr_open() will still request an
    mdsthreshold, and so we end up Oopsing in decode_attr_mdsthreshold.

    This patch fixes encode_getfattr_open so that it doesn't request an
    mdsthreshold when the caller isn't asking for one. It also fixes
    decode_attr_mdsthreshold so that it errors if the server returns
    an mdsthreshold that we didn't ask for (instead of Oopsing).

    Signed-off-by: Trond Myklebust
    Cc: Andy Adamson

    Trond Myklebust
     

27 May, 2012

1 commit

  • If the EXCHGID4_FLAG_CONFIRMED_R flag is set, the client is in theory
    supposed to already know the correct value of the seqid, in which case
    RFC5661 states that it should ignore the value returned.

    Also ensure that if the sanity check in nfs4_check_cl_exchange_flags
    fails, then we must not change the nfs_client fields.

    Finally, clean up the code: we don't need to retest the value of
    'status' unless it can change.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

25 May, 2012

2 commits


23 May, 2012

4 commits

  • Save the server major and minor ID results from EXCHANGE_ID, as they
    are needed for detecting server trunking.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • "noresvport" and "discrtry" can be passed to nfs_create_rpc_client()
    by setting flags in the passed-in nfs_client. This change makes it
    easy to add new flags.

    Note that these settings are now "sticky" over the lifetime of a
    struct nfs_client, and may even be copied when an nfs_client is
    cloned.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Clean up: Continue to rationalize the locking in nfs_get_client() by
    moving the logic that handles the case where a matching server IP
    address is not found.

    When we support server trunking detection, client initialization may
    return a different nfs_client struct than was passed to it. Change
    the synopsis of the init_client methods to return an nfs_client.

    The client initialization logic in nfs_get_client() is not much more
    than a wrapper around ->init_client. It's simpler to keep the little
    bits of error handling in the version-specific init_client methods.

    No behavior change is expected.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Clean up: When naming fields and data types, follow established
    conventions to facilitate accurate grep/cscope searches.

    Additionally, for consistency, move the scope field into the NFSv4-
    specific part of the nfs_client, and free that memory in the logic
    that shuts down NFSv4 nfs_clients.

    Introduced by commit 99fe60d0 "nfs41: exchange_id operation", April
    1 2009.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

02 May, 2012

4 commits


01 May, 2012

1 commit


28 Apr, 2012

13 commits

  • Now that I'm doing secinfo automatically in the v4 code this extra
    argument isn't needed.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • This simplifies the code for v2 and v3 and gives v4 a chance to decide
    on referrals without needing to modify the generic client.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • And also remove the unneeded rpc_op.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • Need this to pass into nfs_commitdata_init, in order to keep data->dreq
    accurate.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • Factors out the code that needs to change when directio
    starts using these code paths.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • It is COMMIT that is handled the most differently between
    the paged and direct paths. Create a structure that encapsulates
    everything either path needs to know about the commit state.

    We could use void to hide some of the layout driver stuff, but
    Trond suggests pulling it out to ensure type checking, given the
    huge changes being made, and the fact that it doesn't interfere
    with other drivers.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • This also has the advantage that it allows directio to use pnfs.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • Factors out the code that will need to change when directio
    starts using these code paths. This will allow directio to use
    the generic pagein and flush routines

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • Decouple nfs_pgio_header and nfs_write_data, and have (possibly
    multiple) nfs_write_datas each take a refcount on nfs_pgio_header.

    For the moment keeps nfs_write_header as a way to preallocate a single
    nfs_write_data with the nfs_pgio_header. The code doesn't need this,
    and would be prettier without, but given the amount of churn I am
    already introducing I didn't want to play with tuning new mempools.

    This also fixes bug in pnfs_ld_handle_write_error. In the case of
    desc->pg_bsize < PAGE_CACHE_SIZE, the pages list was empty, causing
    replay attempt to do nothing.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • Decouple nfs_pgio_header and nfs_read_data, and have (possibly
    multiple) nfs_read_datas each take a refcount on nfs_pgio_header.

    For the moment keeps nfs_read_header as a way to preallocate a single
    nfs_read_data with the nfs_pgio_header. The code doesn't need this,
    and would be prettier without, but given the amount of churn I am
    already introducing I didn't want to play with tuning new mempools.

    This also fixes bug in pnfs_ld_handle_read_error. In the case of
    desc->pg_bsize < PAGE_CACHE_SIZE, the pages list was empty, causing
    replay attempt to do nothing.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • Both nfs_read_data and nfs_write_data devote several fields which
    can be combined into a single shared struct.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • In order to avoid duplicating all the data in nfs_read_data whenever we
    split it up into multiple RPC calls (either due to a short read result
    or due to rsize < PAGE_SIZE), we split out the bits that are the same
    per RPC call into a separate "header" structure.

    The goal this patch moves towards is to have a single header
    refcounted by several rpc_data structures. Thus, want to always refer
    from rpc_data to the header, and not the other way. This patch comes
    close to that ideal, but the directio code currently needs some
    special casing, isolated in the nfs_direct_[read_write]hdr_release()
    functions. This will be dealt with in a future patch.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • Commits don't need the vectors of pages, etc. that writes do. Split out
    a separate structure for the commit operation.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman