20 Oct, 2011

1 commit


26 Jul, 2011

1 commit

  • If the task that initiated the sillyrename ends up being killed by a
    fatal signal, then it will eventually return back to userspace and end
    up releasing the i_mutex. d_move however needs to be done while holding
    the i_mutex.

    Instead of using d_move here, just unhash the old and new dentries to
    prevent them from being found by lookups. With this change though, the
    dentries are now incorrect post-rename and do not reflect the actual
    name of the file on the server. I'm proceeding under the assumption
    that since they are unhashed that this isn't really a problem.

    In order for the sillydelete to still work though, the dname must be
    copied earlier when setting up the sillydelete info, and the name must
    be recopied if the sillydelete info has to be moved to a new dentry.

    Reported-by: Al Viro
    Signed-off-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Jeff Layton
     

16 Jul, 2011

1 commit

  • Somebody working on this code asked what the deal was with NFSv4, since
    this comment notes that it's v2/v3's statelessness that requires
    sillyrename. Shouldn't hurt to document the answer.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    J. Bruce Fields
     

17 Mar, 2011

1 commit

  • part 2: make sure that disconnected roots have corresponding mnt_devname
    values stashed into them.

    Have nfs*_get_root() stuff a copy of devname into ->d_fsdata of the
    found root, provided that it is disconnected.

    Have ->d_release() free it when dentry goes away.

    Have the places where NFS uses ->d_fsdata for sillyrename (and that
    can *never* happen to a disconnected root - dentry will be attached
    to its parent) free old devname copies if they find those.

    Signed-off-by: Al Viro

    Al Viro
     

11 Mar, 2011

1 commit

  • Although they run as rpciod background tasks, under normal operation
    (i.e. no SIGKILL), functions like nfs_sillyrename(), nfs4_proc_unlck()
    and nfs4_do_close() want to be fully synchronous. This means that when we
    exit, we want all references to the rpc_task to be gone, and we want
    any dentry references etc. held by that task to be released.

    For this reason these functions call __rpc_wait_for_completion_task(),
    followed by rpc_put_task() in the expectation that the latter will be
    releasing the last reference to the rpc_task, and thus ensuring that the
    callback_ops->rpc_release() has been called synchronously.

    This patch fixes a race which exists due to the fact that
    rpciod calls rpc_complete_task() (in order to wake up the callers of
    __rpc_wait_for_completion_task()) and then subsequently calls
    rpc_put_task() without ensuring that these two steps are done atomically.

    In order to avoid adding new spin locks, the patch uses the existing
    waitqueue spin lock to order the rpc_task reference count releases between
    the waiting process and rpciod.
    The common case where nobody is waiting for completion is optimised for by
    checking if the RPC_TASK_ASYNC flag is cleared and/or if the rpc_task
    reference count is 1: in those cases we drop trying to grab the spin lock,
    and immediately free up the rpc_task.

    Those few processes that need to put the rpc_task from inside an
    asynchronous context and that do not care about ordering are given a new
    helper: rpc_put_task_async().

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

12 Jan, 2011

1 commit

  • * 'nfs-for-2.6.38' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (89 commits)
    NFS fix the setting of exchange id flag
    NFS: Don't use vm_map_ram() in readdir
    NFSv4: Ensure continued open and lockowner name uniqueness
    NFS: Move cl_delegations to the nfs_server struct
    NFS: Introduce nfs_detach_delegations()
    NFS: Move cl_state_owners and related fields to the nfs_server struct
    NFS: Allow walking nfs_client.cl_superblocks list outside client.c
    pnfs: layout roc code
    pnfs: update nfs4_callback_recallany to handle layouts
    pnfs: add CB_LAYOUTRECALL handling
    pnfs: CB_LAYOUTRECALL xdr code
    pnfs: change lo refcounting to atomic_t
    pnfs: check that partial LAYOUTGET return is ignored
    pnfs: add layout to client list before sending rpc
    pnfs: serialize LAYOUTGET(openstateid)
    pnfs: layoutget rpc code cleanup
    pnfs: change how lsegs are removed from layout list
    pnfs: change layout state seqlock to a spinlock
    pnfs: add prefix to struct pnfs_layout_hdr fields
    pnfs: add prefix to struct pnfs_layout_segment fields
    ...

    Linus Torvalds
     

07 Jan, 2011

1 commit

  • Make d_count non-atomic and protect it with d_lock. This allows us to ensure a
    0 refcount dentry remains 0 without dcache_lock. It is also fairly natural when
    we start protecting many other dentry members with d_lock.

    Signed-off-by: Nick Piggin

    Nick Piggin
     

22 Dec, 2010

1 commit


29 Oct, 2010

1 commit


24 Sep, 2010

1 commit

  • Having to explicitly initialize sr_slotid to NFS4_MAX_SLOT_TABLE
    resulted in numerous bugs. Keeping the current slot as a pointer
    to the slot table is more straight forward and robust as it's
    implicitly set up to NULL wherever the seq_res member is initialized
    to zeroes.

    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Benny Halevy
     

22 Sep, 2010

1 commit


18 Sep, 2010

2 commits

  • A synchronous rename can be interrupted by a SIGKILL. If that happens
    during a sillyrename operation, it's possible for the rename call to
    be sent to the server, but the task exits before processing the
    reply. If this happens, the sillyrenamed file won't get cleaned up
    during nfs_dentry_iput and the server is left with a dangling .nfs* file
    hanging around.

    Fix this problem by turning sillyrename into an asynchronous operation
    and have the task doing the sillyrename just wait on the reply. If the
    task is killed before the sillyrename completes, it'll still proceed
    to completion.

    Signed-off-by: Jeff Layton
    Reviewed-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Jeff Layton
     
  • ...since that's where most of the sillyrenaming code lives. A comment
    block is added to the beginning as well to clarify how sillyrenaming
    works. Also, make nfs_async_unlink static as nfs_sillyrename is the only
    caller.

    Signed-off-by: Jeff Layton
    Reviewed-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Jeff Layton
     

23 Jun, 2010

1 commit


15 May, 2010

1 commit


07 Dec, 2009

1 commit


06 Dec, 2009

1 commit


05 Dec, 2009

1 commit

  • nfs41_sequence_free_slot can be called multiple times on SEQUENCE operation
    errors.
    No reason to inline nfs4_restart_rpc

    Reported-by: Trond Myklebust

    nfs_writeback_done and nfs_readpage_retry call nfs4_restart_rpc outside the
    error handler, and the slot is not freed prior to restarting in the rpc_prepare
    state during session reset.

    Fix this by moving the call to nfs41_sequence_free_slot from the error
    path of nfs41_sequence_done into nfs4_restart_rpc, and by removing the test
    for NFS4CLNT_SESSION_SETUP.
    Always free slot and goto the rpc prepare state on async errors.

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

    Andy Adamson
     

18 Jun, 2009

3 commits

  • [nfs41: change nfs4_restart_rpc argument]
    [nfs41: check for session not minorversion]
    [nfs41: trigger the state manager for session reset]
    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    [always define nfs4_restart_rpc]
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • Implement the rpc_call_prepare methods for
    asynchronuos nfs rpcs, call nfs41_setup_sequence from
    respective rpc_call_validate_args methods.

    Call nfs4_sequence_done from respective rpc_call_done methods.

    Note that we need to pass a pointer to the nfs_server in calls data
    for passing on to nfs4_sequence_done.

    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    [pnfs: client data server write validate and release]
    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    [nfs41: separate free slot from sequence done]
    [nfs41: sequence res use slotid]
    [nfs41: remove SEQ4_STATUS_USE_TK_STATUS]
    [nfs41: nfs4_sequence_free_slot use nfs_client for data server]
    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • Initialize nfs4_sequence_res sr_slotid to NFS4_MAX_SLOT_TABLE.

    [was nfs41: sequence res use slotid]
    Signed-off-by: Andy Adamson
    [pulled definition of struct nfs4_sequence_res.sr_slotid to here]
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Andy Adamson
     

07 Oct, 2008

1 commit

  • Instead of causing umount requests to block on server->active_wq while the
    asynchronous sillyrename deletes are executing, we can use the sb->s_active
    counter to obtain a reference to the super_block, and then release that
    reference in nfs_async_unlink_release().

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

28 Jul, 2008

1 commit


15 Mar, 2008

1 commit

  • The NFSv4 protocol allows clients to negotiate security protocols on the
    fly in the case where an administrator on the server changes the export
    settings and/or in the case where we may have a filesystem migration event.

    Instead of having the NFS client code cache credentials that are tied to a
    particular AUTH method it is therefore preferable to have a generic credential
    that can be converted into whatever AUTH is in use by the RPC client when
    the read/write/sillyrename/... is put on the wire.

    We do this by means of the new "generic" credential, which basically just
    caches the minimal information that is needed to look up an RPCSEC_GSS,
    AUTH_SYS, or AUTH_NULL credential.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

30 Jan, 2008

5 commits


22 Oct, 2007

1 commit


20 Oct, 2007

2 commits

  • Erez Zadok reports that certain configurations fail to build due to
    schedule() TASK_[UN]INTERRUPTIBLE not being declared. Add proper
    include files to fix.

    Cc: Erez Zadok
    Cc: Trond Myklebust
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • lookup() and sillyrename() can race one another because the sillyrename()
    completion cannot take the parent directory's inode->i_mutex since the
    latter may be held by whoever is calling dput().

    We therefore have little option but to add extra locking to ensure that
    nfs_lookup() and nfs_atomic_open() do not race with the sillyrename
    completion.
    If somebody has looked up the sillyrenamed file in the meantime, we just
    transfer the sillydelete information to the new dentry.

    Please refer to the bug-report at
    http://bugzilla.linux-nfs.org/show_bug.cgi?id=150

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

10 Oct, 2007

1 commit


20 Jul, 2007

1 commit

  • Fix a couple of bugs:
    - Don't rely on the parent dentry still being valid when the call completes.
    Fixes a race with shrink_dcache_for_umount_subtree()

    - Don't remove the file if the filehandle has been labelled as stale.

    Fix a couple of inefficiencies
    - Remove the global list of sillyrenamed files. Instead we can cache the
    sillyrename information in the dentry->d_fsdata
    - Move common code from unlink_setup/unlink_done into fs/nfs/unlink.c

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

21 Mar, 2006

1 commit


07 Jan, 2006

2 commits


07 Nov, 2005

1 commit

  • This is the fs/ part of the big kfree cleanup patch.

    Remove pointless checks for NULL prior to calling kfree() in fs/.

    Signed-off-by: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     

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