25 Aug, 2011

1 commit

  • RFC3530 states that if the client holds a delegation, then it is obliged
    to continue to send RENEW calls once every lease period in order to allow
    the server to return NFS4ERR_CB_PATH_DOWN if the callback path is
    unreachable.

    This is not required for NFSv4.1, since the server can at any time set
    the SEQ4_STATUS_CB_PATH_DOWN_SESSION in any SEQUENCE operation.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

12 Mar, 2011

1 commit

  • Data servers not sharing a session with the mount MDS always have an empty
    cl_superblocks list.
    Replace the cl_superblocks empty list check to see if it is time to shut down
    renewd with the NFS_CS_STOP_RENEW bit which is not set by such a data server.

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

    Andy Adamson
     

07 Jan, 2011

2 commits

  • Delegations are per-inode, not per-nfs_client. When a server file
    system is migrated, delegations on the client must be moved from the
    source to the destination nfs_server. Make it easier to manage a
    mount point's delegation list across a migration event by moving the
    list to the nfs_server struct.

    Clean up: I added documenting comments to public functions I changed
    in this patch. For consistency I added comments to all the other
    public functions in fs/nfs/delegation.c.

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

    Chuck Lever
     
  • We're about to move some fields from struct nfs_client to struct
    nfs_server. There is a many-to-one relationship between nfs_servers
    and nfs_clients. After these fields are moved to the nfs_server
    struct, to visit all of the data in these fields that is owned by one
    nfs_client, code will need to visit each nfs_server on the
    cl_superblocks list for that nfs_client.

    To serialize changes to the cl_superblocks list during these little
    expeditions, protect the list with RCU.

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

    Chuck Lever
     

23 Jun, 2010

1 commit


03 Mar, 2010

1 commit

  • If the renewd send queue gets backlogged (e.g., if the server goes down),
    we will keep filling the queue with periodic RENEW/SEQUENCE requests.

    This patch schedules a new renewd request if and only if the previous one
    returns (either success or failure)

    Signed-off-by: Alexandros Batsakis
    [Trond.Myklebust@netapp.com: moved nfs4_schedule_state_renewal() into
    separate nfs4_renew_release() and nfs41_sequence_release() callbacks
    to ensure correct behaviour on call setup failure]
    Signed-off-by: Trond Myklebust

    Alexandros Batsakis
     

08 Oct, 2009

1 commit

  • The NFSv4 renew daemon is shared between all active super blocks that refer
    to a particular NFS server, so it is wrong to be shutting it down in
    nfs4_kill_super every time a super block is destroyed.

    This patch therefore kills nfs4_renewd_prepare_shutdown altogether, and
    leaves it up to nfs4_shutdown_client() to also shut down the renew daemon
    by means of the existing call to nfs4_kill_renewd().

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

18 Jun, 2009

2 commits

  • Use the machine cred for sending SEQUENCE to renew
    the client's lease.

    [revamp patch for new state management design starting 2.6.29]
    [nfs41: support minorversion 1 for nfs4_check_lease]
    Signed-off-by: Benny Halevy
    [nfs41: get cred in exchange_id when cred arg is NULL]
    Signed-off-by: Benny Halevy
    [nfs41: use cl_machined_cred instead of cl_ex_cred]
    Since EXCHANGE_ID insists on using the machine credential, cl_ex_cred is
    not needed. nfs4_proc_exchange_id() is only called if the machine credential
    is available. Remove the credential logic from nfs4_proc_exchange_id.
    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • Send a NFSv4.1 SEQUENCE op rather than RENEW that was deprecated in
    minorversion 1.
    Use the nfs_client minorversion to select reboot_recover/
    network_partition_recovery/state_renewal ops.

    Note: we use reclaimer to create the nfs41 session before there are any
    cl_superblocks for the nfs_client.

    Signed-off-by: Benny Halevy
    [nfs41: check for session not minorversion]
    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    [revamped patch for new nfs4_state_manager design]
    Signed-off-by: Benny Halevy
    [nfs41: obliterate nfs4_state_recovery_ops.renew_lease method]
    moved to nfs4_state_maintenance_ops
    [also undid per-minorversion nfs4_state_recovery_ops here]
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Benny Halevy
     

24 Dec, 2008

4 commits


17 May, 2008

1 commit


03 Jan, 2008

1 commit

  • Erez Zadok reports:

    =======================================================
    [ INFO: possible circular locking dependency detected ]
    2.6.24-rc6-unionfs2 #80
    -------------------------------------------------------
    umount.nfs4/4017 is trying to acquire lock:
    (&(&clp->cl_renewd)->work){--..}, at: []
    __cancel_work_timer+0x83/0x17f

    but task is already holding lock:
    (&clp->cl_sem){----}, at: [] nfs4_kill_renewd+0x17/0x29 [nfs]

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #1 (&clp->cl_sem){----}:
    [] __lock_acquire+0x9cc/0xb95
    [] lock_acquire+0x5f/0x78
    [] down_read+0x3a/0x4c
    [] nfs4_renew_state+0x1c/0x1b8 [nfs]
    [] run_workqueue+0xd9/0x1ac
    [] worker_thread+0x7a/0x86
    [] kthread+0x3b/0x62
    [] kernel_thread_helper+0x7/0x10
    [] 0xffffffff

    -> #0 (&(&clp->cl_renewd)->work){--..}:
    [] __lock_acquire+0x8bc/0xb95
    [] lock_acquire+0x5f/0x78
    [] __cancel_work_timer+0xb7/0x17f
    [] cancel_delayed_work_sync+0xb/0xd
    [] nfs4_kill_renewd+0x1e/0x29 [nfs]
    [] nfs_free_client+0x37/0x9e [nfs]
    [] nfs_put_client+0x5d/0x62 [nfs]
    [] nfs_free_server+0x75/0xae [nfs]
    [] nfs4_kill_super+0x27/0x2b [nfs]
    [] deactivate_super+0x3f/0x51
    [] mntput_no_expire+0x42/0x67
    [] path_release_on_umount+0x15/0x18
    [] sys_umount+0x1a3/0x1cb
    [] sys_oldumount+0x19/0x1b
    [] sysenter_past_esp+0x5f/0xa5
    [] 0xffffffff

    Looking at the code, it would seem that taking the clp->cl_sem in
    nfs4_kill_renewd is completely redundant, since we're already guaranteed to
    have exclusive access to the nfs_client (we're shutting down).

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

08 Aug, 2007

1 commit

  • This will avoid deadlocks of the form:

    stack backtrace:
    [] show_trace_log_lvl+0x1a/0x30
    [] show_trace+0x12/0x20
    [] dump_stack+0x15/0x20
    [] __lock_acquire+0xc22/0x1030
    [] lock_acquire+0x61/0x80
    [] flush_workqueue+0x49/0x70
    [] flush_scheduled_work+0xd/0x10
    [] nfs_release_automount_timer+0x2c/0x30 [nfs]
    [] nfs_free_server+0x9e/0xd0 [nfs]
    [] nfs_kill_super+0x16/0x20 [nfs]
    [] deactivate_super+0x7d/0xa0
    [] mntput_no_expire+0x4b/0x80
    [] expire_mount_list+0xe4/0x140
    [] mark_mounts_for_expiry+0x99/0xb0
    [] nfs_expire_automounts+0xd/0x40 [nfs]
    [] run_workqueue+0x12b/0x1e0
    [] worker_thread+0x9b/0x100
    [] kthread+0x42/0x70
    [] kernel_thread_helper+0x7/0x18
    =======================

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

09 May, 2007

1 commit


15 Feb, 2007

1 commit

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

22 Nov, 2006

1 commit

  • Pass the work_struct pointer to the work function rather than context data.
    The work function can use container_of() to work out the data.

    For the cases where the container of the work_struct may go away the moment the
    pending bit is cleared, it is made possible to defer the release of the
    structure by deferring the clearing of the pending bit.

    To make this work, an extra flag is introduced into the management side of the
    work_struct. This governs auto-release of the structure upon execution.

    Ordinarily, the work queue executor would release the work_struct for further
    scheduling or deallocation by clearing the pending bit prior to jumping to the
    work function. This means that, unless the driver makes some guarantee itself
    that the work_struct won't go away, the work function may not access anything
    else in the work_struct or its container lest they be deallocated.. This is a
    problem if the auxiliary data is taken away (as done by the last patch).

    However, if the pending bit is *not* cleared before jumping to the work
    function, then the work function *may* access the work_struct and its container
    with no problems. But then the work function must itself release the
    work_struct by calling work_release().

    In most cases, automatic release is fine, so this is the default. Special
    initiators exist for the non-auto-release case (ending in _NAR).

    Signed-Off-By: David Howells

    David Howells
     

23 Sep, 2006

4 commits

  • Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • The attached patch makes NFS share superblocks between mounts from the same
    server and FSID over the same protocol.

    It does this by creating each superblock with a false root and returning the
    real root dentry in the vfsmount presented by get_sb(). The root dentry set
    starts off as an anonymous dentry if we don't already have the dentry for its
    inode, otherwise it simply returns the dentry we already have.

    We may thus end up with several trees of dentries in the superblock, and if at
    some later point one of anonymous tree roots is discovered by normal filesystem
    activity to be located in another tree within the superblock, the anonymous
    root is named and materialises attached to the second tree at the appropriate
    point.

    Why do it this way? Why not pass an extra argument to the mount() syscall to
    indicate the subpath and then pathwalk from the server root to the desired
    directory? You can't guarantee this will work for two reasons:

    (1) The root and intervening nodes may not be accessible to the client.

    With NFS2 and NFS3, for instance, mountd is called on the server to get
    the filehandle for the tip of a path. mountd won't give us handles for
    anything we don't have permission to access, and so we can't set up NFS
    inodes for such nodes, and so can't easily set up dentries (we'd have to
    have ghost inodes or something).

    With this patch we don't actually create dentries until we get handles
    from the server that we can use to set up their inodes, and we don't
    actually bind them into the tree until we know for sure where they go.

    (2) Inaccessible symbolic links.

    If we're asked to mount two exports from the server, eg:

    mount warthog:/warthog/aaa/xxx /mmm
    mount warthog:/warthog/bbb/yyy /nnn

    We may not be able to access anything nearer the root than xxx and yyy,
    but we may find out later that /mmm/www/yyy, say, is actually the same
    directory as the one mounted on /nnn. What we might then find out, for
    example, is that /warthog/bbb was actually a symbolic link to
    /warthog/aaa/xxx/www, but we can't actually determine that by talking to
    the server until /warthog is made available by NFS.

    This would lead to having constructed an errneous dentry tree which we
    can't easily fix. We can end up with a dentry marked as a directory when
    it should actually be a symlink, or we could end up with an apparently
    hardlinked directory.

    With this patch we need not make assumptions about the type of a dentry
    for which we can't retrieve information, nor need we assume we know its
    place in the grand scheme of things until we actually see that place.

    This patch reduces the possibility of aliasing in the inode and page caches for
    inodes that may be accessed by more than one NFS export. It also reduces the
    number of superblocks required for NFS where there are many NFS exports being
    used from a server (home directory server + autofs for example).

    This in turn makes it simpler to do local caching of network filesystems, as it
    can then be guaranteed that there won't be links from multiple inodes in
    separate superblocks to the same cache file.

    Obviously, cache aliasing between different levels of NFS protocol could still
    be a problem, but at least that gives us another key to use when indexing the
    cache.

    This patch makes the following changes:

    (1) The server record construction/destruction has been abstracted out into
    its own set of functions to make things easier to get right. These have
    been moved into fs/nfs/client.c.

    All the code in fs/nfs/client.c has to do with the management of
    connections to servers, and doesn't touch superblocks in any way; the
    remaining code in fs/nfs/super.c has to do with VFS superblock management.

    (2) The sequence of events undertaken by NFS mount is now reordered:

    (a) A volume representation (struct nfs_server) is allocated.

    (b) A server representation (struct nfs_client) is acquired. This may be
    allocated or shared, and is keyed on server address, port and NFS
    version.

    (c) If allocated, the client representation is initialised. The state
    member variable of nfs_client is used to prevent a race during
    initialisation from two mounts.

    (d) For NFS4 a simple pathwalk is performed, walking from FH to FH to find
    the root filehandle for the mount (fs/nfs/getroot.c). For NFS2/3 we
    are given the root FH in advance.

    (e) The volume FSID is probed for on the root FH.

    (f) The volume representation is initialised from the FSINFO record
    retrieved on the root FH.

    (g) sget() is called to acquire a superblock. This may be allocated or
    shared, keyed on client pointer and FSID.

    (h) If allocated, the superblock is initialised.

    (i) If the superblock is shared, then the new nfs_server record is
    discarded.

    (j) The root dentry for this mount is looked up from the root FH.

    (k) The root dentry for this mount is assigned to the vfsmount.

    (3) nfs_readdir_lookup() creates dentries for each of the entries readdir()
    returns; this function now attaches disconnected trees from alternate
    roots that happen to be discovered attached to a directory being read (in
    the same way nfs_lookup() is made to do for lookup ops).

    The new d_materialise_unique() function is now used to do this, thus
    permitting the whole thing to be done under one set of locks, and thus
    avoiding any race between mount and lookup operations on the same
    directory.

    (4) The client management code uses a new debug facility: NFSDBG_CLIENT which
    is set by echoing 1024 to /proc/net/sunrpc/nfs_debug.

    (5) Clone mounts are now called xdev mounts.

    (6) Use the dentry passed to the statfs() op as the handle for retrieving fs
    statistics rather than the root dentry of the superblock (which is now a
    dummy).

    Signed-Off-By: David Howells
    Signed-off-by: Trond Myklebust

    David Howells
     
  • Rename nfs_server::nfs4_state to nfs_client as it will be used to represent the
    client state for NFS2 and NFS3 also.

    Signed-Off-By: David Howells
    Signed-off-by: Trond Myklebust

    David Howells
     
  • Rename struct nfs4_client to struct nfs_client so that it can become the basis
    for a general client record for NFS2 and NFS3 in addition to NFS4.

    Signed-Off-By: David Howells
    Signed-off-by: Trond Myklebust

    David Howells
     

07 Jan, 2006

2 commits


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