15 Jan, 2012

1 commit

  • * 'for-3.3' of git://linux-nfs.org/~bfields/linux: (31 commits)
    nfsd4: nfsd4_create_clid_dir return value is unused
    NFSD: Change name of extended attribute containing junction
    svcrpc: don't revert to SVC_POOL_DEFAULT on nfsd shutdown
    svcrpc: fix double-free on shutdown of nfsd after changing pool mode
    nfsd4: be forgiving in the absence of the recovery directory
    nfsd4: fix spurious 4.1 post-reboot failures
    NFSD: forget_delegations should use list_for_each_entry_safe
    NFSD: Only reinitilize the recall_lru list under the recall lock
    nfsd4: initialize special stateid's at compile time
    NFSd: use network-namespace-aware cache registering routines
    SUNRPC: create svc_xprt in proper network namespace
    svcrpc: update outdated BKL comment
    nfsd41: allow non-reclaim open-by-fh's in 4.1
    svcrpc: avoid memory-corruption on pool shutdown
    svcrpc: destroy server sockets all at once
    svcrpc: make svc_delete_xprt static
    nfsd: Fix oops when parsing a 0 length export
    nfsd4: Use kmemdup rather than duplicating its implementation
    nfsd4: add a separate (lockowner, inode) lookup
    nfsd4: fix CONFIG_NFSD_FAULT_INJECTION compile error
    ...

    Linus Torvalds
     

15 Dec, 2011

1 commit


14 Dec, 2011

1 commit


13 Dec, 2011

1 commit


02 Dec, 2011

1 commit


26 Nov, 2011

1 commit


16 Nov, 2011

2 commits


09 Nov, 2011

1 commit


08 Nov, 2011

6 commits

  • Hash lockowners on just the owner string rather than on (owner, inode).
    This makes the owner-string lookup needed for RELEASE_LOCKOWNER simpler
    (currently it's doing at a linear search through the entire hash
    table!). That may come at the expense of making (owner, inode) lookups
    more expensive if a client reuses the same lockowner across multiple
    files. We might add a separate lookup for that.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • init_nfsd() was calling free_slabs() during cleanup code, but the call
    to init_slabs() was hidden in nfsd4_state_init(). This could be
    confusing to people unfamiliar with the code.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: J. Bruce Fields

    Bryan Schumaker
     
  • Fault injection on the NFS server makes it easier to test the client's
    state manager and recovery threads. Simulating errors on the server is
    easier than finding the right conditions that cause them naturally.

    This patch uses debugfs to add a simple framework for fault injection to
    the server. This framework is a config option, and can be enabled
    through CONFIG_NFSD_FAULT_INJECTION. Assuming you have debugfs mounted
    to /sys/debug, a set of files will be created in /sys/debug/nfsd/.
    Writing to any of these files will cause the corresponding action and
    write a log entry to dmesg.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: J. Bruce Fields

    Bryan Schumaker
     
  • Instead of creating a new lockowner and stateid for every
    open_to_lockowner call, reuse the existing lockowner if it exists.

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

    J. Bruce Fields
     
  • I'd rather the "ignore clientid in sessions case" rule be enforced in
    just one place.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Lockowners are looked up by file as well as by owner, but we were
    forgetting to do a comparison on the file. This could cause an
    incorrect result from lockt.

    (Note looking up the inode from the lockowner is pretty awkward here.
    The data structures need fixing.)

    Cc: stable@kernel.org
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

24 Oct, 2011

3 commits


19 Oct, 2011

2 commits


18 Oct, 2011

6 commits

  • As with the nfs4_file, we'd prefer to find out about any failure before
    creating a new file rather than after.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Move idr preallocation out of stateid initialization, into stateid
    allocation, so that we no longer have to handle any errors from the
    former.

    This is a little subtle due to the way the idr code manages these
    preallocated items--document that in comments.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Creating a new file is an irrevocable step--once it's visible in the
    filesystem, other processes may have seen it and done something with it,
    and unlinking it wouldn't simply undo the effects of the create.

    Therefore, in the case where OPEN creates a new file, we shouldn't do
    the create until we know that the rest of the OPEN processing will
    succeed.

    For example, we should preallocate a struct file in case we need it
    until waiting to allocate it till process_open2(), which is already too
    late.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • If process_open1() creates a new open owner, but the open later fails,
    the current code will leave the open owner around. It won't be on the
    close_lru list, and the client isn't expected to send a CLOSE, so it
    will hang around as long as the client does.

    Similarly, if process_open1() removes an existing open owner from the
    close lru, anticipating that an open owner that previously had no
    associated stateid's now will, but the open subsequently fails, then
    we'll again be left with the same leak.

    Fix both problems.

    Reported-by: Bryan Schumaker
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • No change in behavior.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • There doesn't seem to be any harm to renewing the client a bit earlier,
    when it is looked up. That saves us from having to sprinkle
    renew_client calls over quite so many places.

    Also remove a redundant comment and do a little cleanup.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

12 Oct, 2011

2 commits


11 Oct, 2011

4 commits

  • I'd rather put more of these sorts of checks into standardized xdr
    decoders for the various types rather than have them cluttering up the
    core logic in nfs4proc.c and nfs4state.c.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • We don't use WANT bits yet--and sending them can probably trigger a
    BUG() further down.

    Cc: stable@kernel.org
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • In response to some review comments, get rid of the somewhat obscure
    for-loop with bitops, and improve a comment.

    Reported-by: Steve Dickson
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • In commit 5ec094c1096ab3bb795651855d53f18daa26afde "nfsd4: extend state
    lock over seqid replay logic" I modified the exit logic of all the
    seqid-based procedures except nfsd4_locku(). Fix the oversight.

    The result of the bug was a double-unlock while handling the LOCKU
    procedure, and a warning like:

    [ 142.150014] WARNING: at kernel/mutex-debug.c:78 debug_mutex_unlock+0xda/0xe0()
    ...
    [ 142.152927] Pid: 742, comm: nfsd Not tainted 3.1.0-rc1-SLIM+ #9
    [ 142.152927] Call Trace:
    [ 142.152927] [] warn_slowpath_common+0x7f/0xc0
    [ 142.152927] [] warn_slowpath_null+0x1a/0x20
    [ 142.152927] [] debug_mutex_unlock+0xda/0xe0
    [ 142.152927] [] __mutex_unlock_slowpath+0x80/0x140
    [ 142.152927] [] mutex_unlock+0xe/0x10
    [ 142.152927] [] nfs4_lock_state+0x35/0x40 [nfsd]
    [ 142.152927] [] nfsd4_proc_compound+0x2a1/0x690
    [nfsd]
    [ 142.152927] [] nfsd_dispatch+0xeb/0x230 [nfsd]
    [ 142.152927] [] svc_process_common+0x345/0x690
    [sunrpc]
    [ 142.152927] [] ? try_to_wake_up+0x280/0x280
    [ 142.152927] [] svc_process+0x102/0x150 [sunrpc]
    [ 142.152927] [] nfsd+0xbd/0x160 [nfsd]
    [ 142.152927] [] ? 0xffffffffa039efff
    [ 142.152927] [] kthread+0x8c/0xa0
    [ 142.152927] [] kernel_thread_helper+0x4/0x10
    [ 142.152927] [] ? kthread_worker_fn+0x190/0x190
    [ 142.152927] [] ? gs_change+0x13/0x13

    Reported-by: Bryan Schumaker
    Tested-by: Bryan Schumaker
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

27 Sep, 2011

4 commits


21 Sep, 2011

1 commit

  • Yet another open-management regression:

    - nfs4_file_downgrade() doesn't remove the BOTH access bit on
    downgrade, so the server's idea of the stateid's access gets
    out of sync with the client's. If we want to keep an O_RDWR
    open in this case, we should do that in the file_put_access
    logic rather than here.
    - We forgot to convert v4 access to an open mode here.

    This logic has proven too hard to get right. In the future we may
    consider:
    - reexamining the lock/openowner relationship (locks probably
    don't really need to take their own references here).
    - adding open upgrade/downgrade support to the vfs.
    - removing the atomic operations. They're redundant as long as
    this is all under some other lock.

    Also, maybe some kind of additional static checking would help catch
    O_/NFS4_SHARE_ACCESS confusion.

    Cc: stable@kernel.org
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

19 Sep, 2011

2 commits

  • Look up closed stateid's in the stateid hash like any other stateid
    rather than searching the close lru.

    This is simpler, and fixes a bug: currently we handle only the case of a
    close that is the last close for a given stateowner, but not the case of
    a close for a stateowner that still has active opens on other files.
    Thus in a case like:

    open(owner, file1)
    open(owner, file2)
    close(owner, file2)
    close(owner, file2)

    the final close won't be recognized as a retransmission.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Including the full clientid in the on-the-wire stateid allows more
    reliable detection of bad vs. expired stateid's, simplifies code, and
    ensures we won't reuse the opaque part of the stateid (as we currently
    do when the same openowner closes and reopens the same file).

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

17 Sep, 2011

1 commit