1. 18 10月, 2011 7 次提交
  2. 17 10月, 2011 1 次提交
  3. 12 10月, 2011 3 次提交
  4. 11 10月, 2011 5 次提交
    • J
      nfsd4: move access/deny validity checks to xdr code · 04f9e664
      J. Bruce Fields 提交于
      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: NJ. Bruce Fields <bfields@redhat.com>
      04f9e664
    • J
      nfsd4: ignore WANT bits in open downgrade · c30e92df
      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: NJ. Bruce Fields <bfields@redhat.com>
      c30e92df
    • J
      nfsd4: cleanup state.h comments · b31b30e5
      J. Bruce Fields 提交于
      These comments are mostly out of date.
      Reported-by: NBryan Schumaker <bjschuma@netapp.com>
      b31b30e5
    • J
      nfsd4: clean up downgrading code · 6409a5a6
      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: NSteve Dickson <steved@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      6409a5a6
    • J
      nfsd4: fix state lock usage in LOCKU · 71c3bcd7
      J. Bruce Fields 提交于
      In commit 5ec094c1 "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]  [<ffffffff8105fa4f>] warn_slowpath_common+0x7f/0xc0
      [  142.152927]  [<ffffffff8105faaa>] warn_slowpath_null+0x1a/0x20
      [  142.152927]  [<ffffffff810960ca>] debug_mutex_unlock+0xda/0xe0
      [  142.152927]  [<ffffffff813e4200>] __mutex_unlock_slowpath+0x80/0x140
      [  142.152927]  [<ffffffff813e42ce>] mutex_unlock+0xe/0x10
      [  142.152927]  [<ffffffffa03bd3f5>] nfs4_lock_state+0x35/0x40 [nfsd]
      [  142.152927]  [<ffffffffa03b0b71>] nfsd4_proc_compound+0x2a1/0x690
      [nfsd]
      [  142.152927]  [<ffffffffa039f9fb>] nfsd_dispatch+0xeb/0x230 [nfsd]
      [  142.152927]  [<ffffffffa02b1055>] svc_process_common+0x345/0x690
      [sunrpc]
      [  142.152927]  [<ffffffff81058d10>] ? try_to_wake_up+0x280/0x280
      [  142.152927]  [<ffffffffa02b16e2>] svc_process+0x102/0x150 [sunrpc]
      [  142.152927]  [<ffffffffa039f0bd>] nfsd+0xbd/0x160 [nfsd]
      [  142.152927]  [<ffffffffa039f000>] ? 0xffffffffa039efff
      [  142.152927]  [<ffffffff8108230c>] kthread+0x8c/0xa0
      [  142.152927]  [<ffffffff813e8694>] kernel_thread_helper+0x4/0x10
      [  142.152927]  [<ffffffff81082280>] ? kthread_worker_fn+0x190/0x190
      [  142.152927]  [<ffffffff813e8690>] ? gs_change+0x13/0x13
      Reported-by: NBryan Schumaker <bjschuma@netapp.com>
      Tested-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      71c3bcd7
  5. 27 9月, 2011 4 次提交
  6. 21 9月, 2011 3 次提交
    • J
      leases: split up generic_setlease into lock/unlock cases · 8335ebd9
      J. Bruce Fields 提交于
      Eventually we should probably do the same thing to the file operations
      as well.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      8335ebd9
    • J
      nfsd4: make op_cacheresult another flag · c856694e
      J. Bruce Fields 提交于
      I'm not sure why I used a new field for this originally.
      
      Also, the differences between some of these flags are a little subtle;
      add some comments to explain.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      c856694e
    • J
      nfsd4: fix open downgrade, again · 3d02fa29
      J. Bruce Fields 提交于
      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: NJ. Bruce Fields <bfields@redhat.com>
      3d02fa29
  7. 19 9月, 2011 2 次提交
    • J
      nfsd4: hash closed stateid's like any other · f7a4d872
      J. Bruce Fields 提交于
      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: NJ. Bruce Fields <bfields@redhat.com>
      f7a4d872
    • J
      nfsd4: construct stateid from clientid and counter · d3b313a4
      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: NJ. Bruce Fields <bfields@redhat.com>
      d3b313a4
  8. 17 9月, 2011 3 次提交
  9. 16 9月, 2011 1 次提交
    • M
      nfsd41: try to check reply size before operation · 58e7b33a
      Mi Jinlong 提交于
      For checking the size of reply before calling a operation,
      we need try to get maxsize of the operation's reply.
      
      v3: using new method as Bruce said,
      
       "we could handle operations in two different ways:
      
      	- For operations that actually change something (write, rename,
      	  open, close, ...), do it the way we're doing it now: be
      	  very careful to estimate the size of the response before even
      	  processing the operation.
      	- For operations that don't change anything (read, getattr, ...)
      	  just go ahead and do the operation.  If you realize after the
      	  fact that the response is too large, then return the error at
      	  that point.
      
        So we'd add another flag to op_flags: say, OP_MODIFIES_SOMETHING.  And for
        operations with OP_MODIFIES_SOMETHING set, we'd do the first thing.  For
        operations without it set, we'd do the second."
      Signed-off-by: NMi Jinlong <mijinlong@cn.fujitsu.com>
      [bfields@redhat.com: crash, don't attempt to handle, undefined op_rsize_bop]
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      58e7b33a
  10. 14 9月, 2011 11 次提交