02 Oct, 2014

1 commit

  • We now have cb_to_delegation and to_delegation, which do the same thing
    and are defined separately in different .c files. Move the
    cb_to_delegation definition into a header file and eliminate the
    redundant to_delegation definition.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jeff Layton

    Jeff Layton
     

27 Sep, 2014

6 commits

  • Add a higher level abstraction than the rpc_ops for callback operations.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Christoph Hellwig
     
  • Split out initializing the nfs4_callback structure from using it. For
    the NULL callback this gets rid of tons of pointless re-initializations.

    Note that I don't quite understand what protects us from running multiple
    NULL callbacks at the same time, but at least this chance doesn't make
    it worse..

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Christoph Hellwig
     
  • Add a helper to queue up a callback. CB_NULL has a bit of special casing
    because it is special in the specification, but all other new callback
    operations will be able to share code with this and a few more changes
    to refactor the callback code.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Christoph Hellwig
     
  • We can always get at the private data by using container_of, no need for
    a void pointer. Also introduce a little to_delegation helper to avoid
    opencoding the container_of everywhere.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Christoph Hellwig
     
  • This is incorrect when a callback is has to be restarted, in which case
    the XDR decoding of the second iteration will see a NULL cb argument.

    [hch: updated description]
    Signed-off-by: Benny Halevy
    Signed-off-by: Christoph Hellwig
    Signed-off-by: J. Bruce Fields

    Benny Halevy
     
  • For any error that is not EBADHANDLE or NFS4ERR_BAD_STATEID,
    nfsd4_cb_recall_done first marks the connection down, then
    retries until dl_retries hits zero, then marks the connection down
    again and sets cb_done. This changes the code to only retry
    for EBADHANDLE or NFS4ERR_BAD_STATEID, and factors setting
    cb_done into a single point in the function.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: J. Bruce Fields

    Christoph Hellwig
     

01 Aug, 2014

2 commits

  • All stateids are associated with a nfs4_file. Let's consolidate.
    Replace delegation->dl_file with the dl_stid.sc_file, and
    nfs4_ol_stateid->st_file with st_stid.sc_file.

    Signed-off-by: Trond Myklebust
    Reviewed-by: Christoph Hellwig
    Signed-off-by: J. Bruce Fields

    Trond Myklebust
     
  • When we remove the client_mutex, we'll need to be able to ensure that
    these objects aren't destroyed while we're not holding locks.

    Add a ->free() callback to the struct nfs4_stid, so that we can
    release a reference to the stid without caring about the contents.

    Signed-off-by: Trond Myklebust
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Trond Myklebust
     

30 Jul, 2014

1 commit


24 Jul, 2014

1 commit

  • Replace a comma between expression statements by a semicolon. This changes
    the semantics of the code, but given the current indentation appears to be
    what is intended.

    A simplified version of the Coccinelle semantic patch that performs this
    transformation is as follows:
    //
    @r@
    expression e1,e2;
    @@

    e1
    -,
    +;
    e2;
    //

    Signed-off-by: Himangi Saraogi
    Acked-by: Julia Lawall
    Signed-off-by: J. Bruce Fields

    Himangi Saraogi
     

18 Jul, 2014

1 commit

  • The current code always selects XPRT_TRANSPORT_BC_TCP for the back
    channel, even when the forward channel was not TCP (eg, RDMA). When
    a 4.1 mount is attempted with RDMA, the server panics in the TCP BC
    code when trying to send CB_NULL.

    Instead, construct the transport protocol number from the forward
    channel transport or'd with XPRT_TRANSPORT_BC. Transports that do
    not support bi-directional RPC will not have registered a "BC"
    transport, causing create_backchannel_client() to fail immediately.

    Fixes: https://bugzilla.linux-nfs.org/show_bug.cgi?id=265
    Signed-off-by: Chuck Lever
    Signed-off-by: J. Bruce Fields

    Chuck Lever
     

17 Jul, 2014

2 commits

  • state_lock is a heavily contended global lock. We don't want to grab
    that while simultaneously holding the inode->i_lock.

    Add a new per-nfs4_file lock that we can use to protect the
    per-nfs4_file delegation list. Hold that while walking the list in the
    break_deleg callback and queue the workqueue job for each one.

    The workqueue job can then take the state_lock and do the list
    manipulations without the i_lock being held prior to starting the
    rpc call.

    Signed-off-by: Trond Myklebust
    Signed-off-by: Jeff Layton
    Reviewed-by: Christoph Hellwig
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     
  • It's just an obfuscated INIT_WORK call. Just make the work_func_t a
    non-static symbol and use a normal INIT_WORK call.

    Signed-off-by: Jeff Layton
    Reviewed-by: Christoph Hellwig
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     

18 Apr, 2014

1 commit


30 Mar, 2014

1 commit


10 Apr, 2013

1 commit


05 Apr, 2013

1 commit


28 Nov, 2012

1 commit


15 Nov, 2012

2 commits


08 Nov, 2012

3 commits


11 Sep, 2012

1 commit


21 Aug, 2012

1 commit

  • Commit d5497fc693a446ce9100fcf4117c3f795ddfd0d2 "nfsd4: move rq_flavor
    into svc_cred" forgot to remove cl_flavor from the client, leaving two
    places (cl_flavor and cl_cred.cr_flavor) for the flavor to be stored.
    After that patch, the latter was the one that was updated, but the
    former was the one that the callback used.

    Symptoms were a long delay on utime(). This is because the utime()
    generated a setattr which recalled a delegation, but the cb_recall was
    ignored by the client because it had the wrong security flavor.

    Cc: stable@vger.kernel.org
    Tested-by: Jamie Heilman
    Reported-by: Jamie Heilman
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

20 Jun, 2012

1 commit

  • For the most part readers of cl_cb_state only need a value that is
    "eventually" right. And the value is set only either 1) in response to
    some change of state, in which case it's set to UNKNOWN and then a
    callback rpc is sent to probe the real state, or b) in the handling of a
    response to such a callback. UNKNOWN is therefore always a "temporary"
    state, and for the other states we're happy to accept last writer wins.

    So I think we're OK here.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

01 Jun, 2012

1 commit


29 Mar, 2012

1 commit

  • This isn't actually correct, but it works with the Linux client, and
    agrees with the behavior we used to have before commit 80fc015bdfe.

    Later patches will implement the spec-mandated behavior (which is to use
    the security parameters explicitly given by the client in create_session
    or backchannel_ctl).

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

26 Mar, 2012

2 commits

  • We'll need a way to flag the nfs4_client as already being recorded on
    stable storage so that we don't continually upcall. Currently, that's
    recorded in the cl_firststate field of the client struct. Using an
    entire u32 to store a flag is rather wasteful though.

    The cl_cb_flags field is only using 2 bits right now, so repurpose that
    to a generic flags field. Rename NFSD4_CLIENT_KILL to
    NFSD4_CLIENT_CB_KILL to make it evident that it's part of the callback
    flags. Add a mask that we can use for existing checks that look to see
    whether any flags are set, so that the new flags don't interfere.

    Convert all references to cl_firstate to the NFSD4_CLIENT_STABLE flag,
    and add a new NFSD4_CLIENT_RECLAIM_COMPLETE flag.

    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     
  • The nfs containerization work is a prerequisite for Jeff Layton's reboot
    recovery rework.

    J. Bruce Fields
     

10 Mar, 2012

1 commit

  • Make sure this is set whenever there is no callback channel.

    If a client does not set up a callback channel at all, then it will get
    this flag set from the very start. That's OK, it can just ignore the
    flag if it doesn't care. If a client does care, I think it's better to
    inform it of the problem as early as possible.

    Reported-by: Rick Macklem
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

01 Feb, 2012

2 commits

  • Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • v2:
    1) "Over-put" of PipeFS mount point fixed. Fix is ugly, but allows to bisect
    the patch set. And it will be removed later in the series.

    This patch makes RPC clients PipeFs dentries allocations in it's owner network
    namespace context.
    RPC client pipefs dentries creation logic has been changed:
    1) Pipefs dentries creation by sb was moved to separated function, which will
    be used for handling PipeFS mount notification.
    2) Initial value of RPC client PipeFS dir dentry is set no NULL now.

    RPC client pipefs dentries cleanup logic has been changed:
    1) Cleanup is done now in separated rpc_remove_pipedir() function, which takes
    care about pipefs superblock locking.

    Also this patch removes slashes from cb_program.pipe_dir_name and from
    NFS_PIPE_DIRNAME to make rpc_d_lookup_sb() work. This doesn't affect
    vfs_path_lookup() results in nfs4blocklayout_init() since this slash is cutted
    off anyway in link_path_walk().

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: Trond Myklebust

    Stanislav Kinsbursky
     

05 Jan, 2012

1 commit


24 Oct, 2011

1 commit


27 Sep, 2011

1 commit


14 Sep, 2011

1 commit


23 Feb, 2011

1 commit

  • Fix bug introduced in patch
    85a56480 NFSD: Update XDR decoders in NFSv4 callback client

    Although decode_cb_sequence4resok ignores highest slotid and target highest slotid
    it must account for their space in their xdr stream when calling xdr_inline_decode

    Cc: Chuck Lever
    Signed-off-by: Benny Halevy
    Signed-off-by: J. Bruce Fields

    Benny Halevy
     

14 Feb, 2011

1 commit