1. 26 3月, 2012 2 次提交
    • J
      nfsd: convert nfs4_client->cl_cb_flags to a generic flags field · a52d726b
      Jeff Layton 提交于
      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: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      a52d726b
    • J
      Merge nfs containerization work from Trond's tree · 1df00640
      J. Bruce Fields 提交于
      The nfs containerization work is a prerequisite for Jeff Layton's reboot
      recovery rework.
      1df00640
  2. 21 3月, 2012 18 次提交
  3. 20 3月, 2012 2 次提交
  4. 19 3月, 2012 3 次提交
  5. 17 3月, 2012 3 次提交
    • S
      Try using machine credentials for RENEW calls · e49a29bd
      Sachin Prabhu 提交于
      Using user credentials for RENEW calls will fail when the user
      credentials have expired.
      
      To avoid this, try using the machine credentials when making RENEW
      calls. If no machine credentials have been set, fall back to using user
      credentials as before.
      Signed-off-by: NSachin Prabhu <sprabhu@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      e49a29bd
    • T
      NFSv4.1: Fix a few issues in filelayout_commit_pagelist · 9390f425
      Trond Myklebust 提交于
      - Fix a race in which NFS_I(inode)->commits_outstanding could potentially
        go to zero (triggering a call to nfs_commit_clear_lock()) before we're
        done sending out all the commit RPC calls.
      
      - If nfs_commitdata_alloc fails, there is no reason why we shouldn't
        try to send off all the commits-to-ds.
      
      - Simplify the error handling.
      
      - Change pnfs_commit_list() to always return either
        PNFS_ATTEMPTED or PNFS_NOT_ATTEMPTED.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Fred Isaman <iisaman@netapp.com>
      9390f425
    • T
      NFSv4.1: Clean ups and bugfixes for the pNFS read/writeback/commit code · 8dd37758
      Trond Myklebust 提交于
      Move more pnfs-isms out of the generic commit code.
      
      Bugfixes:
      
      - filelayout_scan_commit_lists doesn't need to get/put the lseg.
        In fact since it is run under the inode->i_lock, the lseg_put()
        can deadlock.
      
      - Ensure that we distinguish between what needs to be done for
        commit-to-data server and what needs to be done for commit-to-MDS
        using the new flag PG_COMMIT_TO_DS. Otherwise we may end up calling
        put_lseg() on a bucket for a struct nfs_page that got written
        through the MDS.
      
      - Fix a case where we were using list_del() on an nfs_page->wb_list
        instead of list_del_init().
      
      - filelayout_initiate_commit needs to call filelayout_commit_release
        on error instead of the mds_ops->rpc_release(). Otherwise it won't
        clear the commit lock.
      
      Cleanups:
      
      - Let the files layout manage the commit lists for the pNFS case.
        Don't expose stuff like pnfs_choose_commit_list, and the fact
        that the commit buckets hold references to the layout segment
        in common code.
      
      - Cast out the put_lseg() calls for the struct nfs_read/write_data->lseg
        into the pNFS layer from whence they came.
      
      - Let the pNFS layer manage the NFS_INO_PNFS_COMMIT bit.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Fred Isaman <iisaman@netapp.com>
      8dd37758
  6. 15 3月, 2012 1 次提交
  7. 14 3月, 2012 4 次提交
    • W
      NFSv4: Rate limit the state manager for lock reclaim warning messages · 96dcadc2
      William Dauchy 提交于
      Adding rate limit on `Lock reclaim failed` messages since it could fill
      up system logs
      Signed-off-by: NWilliam Dauchy <wdauchy@gmail.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      96dcadc2
    • B
      pnfs-obj: Uglify objio_segment allocation for the sake of the principle :-( · 5318a29c
      Boaz Harrosh 提交于
      At some past instance Linus Trovalds wrote:
      > From: Linus Torvalds <torvalds@linux-foundation.org>
      > commit a84a79e4 upstream.
      >
      > The size is always valid, but variable-length arrays generate worse code
      > for no good reason (unless the function happens to be inlined and the
      > compiler sees the length for the simple constant it is).
      >
      > Also, there seems to be some code generation problem on POWER, where
      > Henrik Bakken reports that register r28 can get corrupted under some
      > subtle circumstances (interrupt happening at the wrong time?).  That all
      > indicates some seriously broken compiler issues, but since variable
      > length arrays are bad regardless, there's little point in trying to
      > chase it down.
      >
      > "Just don't do that, then".
      
      Since then any use of "variable length arrays" has become blasphemous.
      Even in perfectly good, beautiful, perfectly safe code like the one
      below where the variable length arrays are only used as a sizeof()
      parameter, for type-safe dynamic structure allocations. GCC is not
      executing any stack allocation code.
      
      I have produced a small file which defines two functions main1(unsigned numdevs)
      and main2(unsigned numdevs). main1 uses code as before with call to malloc
      and main2 uses code as of after this patch. I compiled it as:
      	gcc -O2 -S see_asm.c
      and here is what I get:
      
      <see_asm.s>
      main1:
      .LFB7:
      	.cfi_startproc
      	mov	%edi, %edi
      	leaq	4(%rdi,%rdi), %rdi
      	salq	$3, %rdi
      	jmp	malloc
      	.cfi_endproc
      .LFE7:
      	.size	main1, .-main1
      	.p2align 4,,15
      	.globl	main2
      	.type	main2, @function
      main2:
      .LFB8:
      	.cfi_startproc
      	mov	%edi, %edi
      	addq	$2, %rdi
      	salq	$4, %rdi
      	jmp	malloc
      	.cfi_endproc
      .LFE8:
      	.size	main2, .-main2
      	.section	.text.startup,"ax",@progbits
      	.p2align 4,,15
      </see_asm.s>
      
      *Exact* same code !!!
      
      So please seriously consider not accepting this patch and leave the
      perfectly good code intact.
      
      CC: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      5318a29c
    • B
      fs: add new FMODE flags: FMODE_32bithash and FMODE_64bithash · 6a8a13e0
      Bernd Schubert 提交于
      Those flags are supposed to be set by NFS readdir() to tell ext3/ext4
      to 32bit (NFSv2) or 64bit hash values (offsets) in seekdir().
      Signed-off-by: NBernd Schubert <bernd.schubert@itwm.fraunhofer.de>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      6a8a13e0
    • D
      NFS: null dereference in dev_remove() · e138ead7
      Dan Carpenter 提交于
      In commit 5ffaf855 "NFS: replace global bl_wq with per-net one" we
      made "msg" a pointer instead of a struct stored in stack memory.  But we
      forgot to change the memset() here so we're still clearing stack memory
      instead clearing the struct like we intended.  It will lead to a kernel
      crash.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      e138ead7
  8. 13 3月, 2012 4 次提交
  9. 12 3月, 2012 2 次提交
    • T
      SUNRPC: Fix a few sparse warnings · 09acfea5
      Trond Myklebust 提交于
      net/sunrpc/svcsock.c:412:22: warning: incorrect type in assignment
      (different address spaces)
       - svc_partial_recvfrom now takes a struct kvec, so the variable
         save_iovbase needs to be an ordinary (void *)
      
      Make a bunch of variables in net/sunrpc/xprtsock.c static
      
      Fix a couple of "warning: symbol 'foo' was not declared. Should it be
      static?" reports.
      
      Fix a couple of conflicting function declarations.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      09acfea5
    • T
      NFS: Fix a number of sparse warnings · 17280175
      Trond Myklebust 提交于
      Fix a number of "warning: symbol 'foo' was not declared. Should it be
      static?" conditions.
      
      Fix 2 cases of "warning: Using plain integer as NULL pointer"
      
      fs/nfs/delegation.c:263:31: warning: restricted fmode_t degrades to integer
        - We want to allow upgrades to a WRITE delegation, but should otherwise
          consider servers that hand out duplicate delegations to be borken.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      17280175
  10. 11 3月, 2012 1 次提交
    • S
      NFS: replace global bl_wq with per-net one · 5ffaf855
      Stanislav Kinsbursky 提交于
      This queue is used for sleeping in kernel and it have to be per-net since we
      don't want to wake any other waiters except in out network nemespace.
      BTW, move wq to per-net data is easy. But some way to handle upcall timeouts
      have to be provided. On message destroy in case of timeout, tasks, waiting for
      message to be delivered, should be awakened. Thus, some data required to
      located the right wait queue. Chosen solution replaces rpc_pipe_msg object with
      new introduced bl_pipe_msg object, containing rpc_pipe_msg and proper wq.
      Signed-off-by: NStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      5ffaf855