1. 15 8月, 2009 19 次提交
  2. 12 8月, 2009 1 次提交
  3. 10 8月, 2009 17 次提交
    • B
      nfs: remove superfluous BUG_ON()s · e576e05a
      Bartlomiej Zolnierkiewicz 提交于
      Subject: [PATCH] nfs: remove superfluous BUG_ON()s
      
      Remove duplicated BUG_ON()s from nfs[4]_create_server()
      (we make the same checks earlier in both functions).
      
      This takes care of the following entries from Dan's list:
      
      fs/nfs/client.c +1078 nfs_create_server(47) warning: variable derefenced before check 'server->nfs_client'
      fs/nfs/client.c +1079 nfs_create_server(48) warning: variable derefenced before check 'server->nfs_client->rpc_ops'
      fs/nfs/client.c +1363 nfs4_create_server(43) warning: variable derefenced before check 'server->nfs_client'
      fs/nfs/client.c +1364 nfs4_create_server(44) warning: variable derefenced before check 'server->nfs_
      Reported-by: NDan Carpenter <error27@gmail.com>
      Cc: corbet@lwn.net
      Cc: eteo@redhat.com
      Cc: Julia Lawall <julia@diku.dk>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      e576e05a
    • P
      NFS: read-modify-write page updating · 38c73044
      Peter Staubach 提交于
      Hi.
      
      I have a proposal for possibly resolving this issue.
      
      I believe that this situation occurs due to the way that the
      Linux NFS client handles writes which modify partial pages.
      
      The Linux NFS client handles partial page modifications by
      allocating a page from the page cache, copying the data from
      the user level into the page, and then keeping track of the
      offset and length of the modified portions of the page.  The
      page is not marked as up to date because there are portions
      of the page which do not contain valid file contents.
      
      When a read call comes in for a portion of the page, the
      contents of the page must be read in the from the server.
      However, since the page may already contain some modified
      data, that modified data must be written to the server
      before the file contents can be read back in the from server.
      And, since the writing and reading can not be done atomically,
      the data must be written and committed to stable storage on
      the server for safety purposes.  This means either a
      FILE_SYNC WRITE or a UNSTABLE WRITE followed by a COMMIT.
      This has been discussed at length previously.
      
      This algorithm could be described as modify-write-read.  It
      is most efficient when the application only updates pages
      and does not read them.
      
      My proposed solution is to add a heuristic to decide whether
      to do this modify-write-read algorithm or switch to a read-
      modify-write algorithm when initially allocating the page
      in the write system call path.  The heuristic uses the modes
      that the file was opened with, the offset in the page to
      read from, and the size of the region to read.
      
      If the file was opened for reading in addition to writing
      and the page would not be filled completely with data from
      the user level, then read in the old contents of the page
      and mark it as Uptodate before copying in the new data.  If
      the page would be completely filled with data from the user
      level, then there would be no reason to read in the old
      contents because they would just be copied over.
      
      This would optimize for applications which randomly access
      and update portions of files.  The linkage editor for the
      C compiler is an example of such a thing.
      
      I tested the attached patch by using rpmbuild to build the
      current Fedora rawhide kernel.  The kernel without the
      patch generated about 269,500 WRITE requests.  The modified
      kernel containing the patch generated about 261,000 WRITE
      requests.  Thus, about 8,500 fewer WRITE requests were
      generated.  I suspect that many of these additional
      WRITE requests were probably FILE_SYNC requests to WRITE
      a single page, but I didn't test this theory.
      
      The difference between this patch and the previous one was
      to remove the unneeded PageDirty() test.  I then retested to
      ensure that the resulting system continued to behave as
      desired.
      
      	Thanx...
      
      		ps
      Signed-off-by: NPeter Staubach <staubach@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      38c73044
    • T
      NFS: Add a ->migratepage() aop for NFS · 074cc1de
      Trond Myklebust 提交于
      Make NFS a bit more friendly to NUMA and memory hot removal...
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      074cc1de
    • T
    • T
      SUNRPC: Constify rpc_pipe_ops... · b693ba4a
      Trond Myklebust 提交于
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      b693ba4a
    • C
      NFS: Replace nfs_set_port() with rpc_set_port() · ec6ee612
      Chuck Lever 提交于
      Clean up.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ec6ee612
    • C
      NFS: Replace nfs_parse_ip_address() with rpc_pton() · 53a0b9c4
      Chuck Lever 提交于
      Clean up: Use the common routine now provided in sunrpc.ko for parsing mount
      addresses.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      53a0b9c4
    • C
      SUNRPC: Provide functions for managing universal addresses · a02d6926
      Chuck Lever 提交于
      Introduce a set of functions in the kernel's RPC implementation for
      converting between a socket address and either a standard
      presentation address string or an RPC universal address.
      
      The universal address functions will be used to encode and decode
      RPCB_FOO and NFSv4 SETCLIENTID arguments.  The other functions are
      part of a previous promise to deliver shared functions that can be
      used by upper-layer protocols to display and manipulate IP
      addresses.
      
      The kernel's current address printf formatters were designed
      specifically for kernel to user-space APIs that require a particular
      string format for socket addresses, thus are somewhat limited for the
      purposes of sunrpc.ko.  The formatter for IPv6 addresses, %pI6, does
      not support short-handing or scope IDs.  Also, these printf formatters
      are unique per address family, so a separate formatter string is
      required for printing AF_INET and AF_INET6 addresses.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a02d6926
    • C
      NFS: Use the authentication flavor list returned by mountd · ec88f28d
      Chuck Lever 提交于
      Commit a14017db added support in the kernel's NFS mount client to
      decode the authentication flavor list returned by mountd.
      
      The NFS client can now use this list to determine whether the
      authentication flavor requested by the user is actually supported
      by the server.
      
      Note we don't actually negotiate the security flavor if none was
      specified by the user.  Instead, we try to use AUTH_SYS, and fail if
      the server does not support it.  This prevents us from negotiating
      an inappropriate security flavor (some servers list AUTH_NULL first).
      
      If the server does not support AUTH_SYS, the user must provide an
      appropriate security flavor by specifying the "sec=" mount option.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ec88f28d
    • C
      NFS: Fix auth flavor len accounting · 059f90b3
      Chuck Lever 提交于
      Previous logic in the NFS mount parsing code path assumed
      auth_flavor_len was set to zero for simple authentication flavors
      (like AUTH_UNIX), and 1 for compound flavors (like AUTH_GSS).
      
      At some earlier point (maybe even before the option parsers were
      merged?) specific checks for auth_flavor_len being zero were removed
      from the functions that validate the mount option that sets the mount
      point's authentication flavor.
      
      Since we are populating an array for authentication flavors, the
      auth_flavor_len should always be set to the number of flavors.  Let's
      eliminate some cleverness here, and prepare for new logic that needs
      to know the number of flavors in the auth_flavors[] array.
      
      (auth_flavors[] is an array because at some point we want to allow a
      list of acceptable authentication flavors to be specified via the sec=
      mount option.  For now it remains a single element array).
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      059f90b3
    • C
      NFS: Add ability to send MOUNTPROC_UMNT to the kernel's mountd client · 0b524123
      Chuck Lever 提交于
      After certain failure modes of an NFS mount, an NFS client should send
      a MOUNTPROC_UMNT request to remove the just-added mount entry from the
      server's mount table.  While no-one should rely on the accuracy of the
      server's mount table, sending a UMNT is simply being a good internet
      neighbor.
      
      Since NFS mount processing is handled in the kernel now, we will need
      a function in the kernel's mountd client that can post a MOUNTRPC_UMNT
      request, in order to handle these failure modes.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      0b524123
    • C
      NFS: Fix up new minorversion= option · f3f4f4ed
      Chuck Lever 提交于
      The new minorversion= mount option (commit 3fd5be9e) was merged at
      the same time as the recent sloppy parser fixes (commit a5a16bae),
      so minorversion= still uses the old value parsing logic.
      
      If the minorversion= option specifies a bogus value, it should fail
      with "bad value" not "bad option."
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      f3f4f4ed
    • T
      NFSv4: Clean up the nfs.callback_tcpport option · c140aa91
      Trond Myklebust 提交于
      Tighten up the validity checking in param_set_port: check for NULL pointers.
      Ensure that the option shows up on 'modinfo' output.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      c140aa91
    • T
      NFSv4: Don't do idmapper upcalls for asynchronous RPC calls · 80e52ace
      Trond Myklebust 提交于
      We don't want to cause rpciod to hang...
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      80e52ace
    • T
      NFSv4: Add 'server capability' flags for NFSv4 recommended attributes · 62ab460c
      Trond Myklebust 提交于
      If the NFSv4 server doesn't support a POSIX attribute, the generic NFS code
      needs to know that, so that it don't keep trying to poll for it.
      
      However, by the same count, if the NFSv4 server does support that
      attribute, then we should ensure that the inode metadata is appropriately
      labelled as being untrusted. For instance, if we don't know the correct
      value of the file's uid, we should certainly not be caching ACLs or ACCESS
      results.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      62ab460c
    • T
      NFSv4: Don't loop forever on state recovery failure... · a78cb57a
      Trond Myklebust 提交于
      If the server is broken, then retrying forever won't fix it. We
      should just give up after a while, and return an error to the user.
      We set the number of retries to 10 for now...
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a78cb57a
    • R
      nfs: Keep index within mnt_errtbl[] · dd8ac1da
      Roel Kluin 提交于
      Ensure that index i remains within array mnt_errtbl[] and mnt3_errtbl[].
      Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      dd8ac1da
  4. 22 7月, 2009 3 次提交
    • T
      NFSv4: Fix a problem whereby a buggy server can oops the kernel · d953126a
      Trond Myklebust 提交于
      We just had a case in which a buggy server occasionally returns the wrong
      attributes during an OPEN call. While the client does catch this sort of
      condition in nfs4_open_done(), and causes the nfs4_atomic_open() to return
      -EISDIR, the logic in nfs_atomic_lookup() is broken, since it causes a
      fallback to an ordinary lookup instead of just returning the error.
      
      When the buggy server then returns a regular file for the fallback lookup,
      the VFS allows the open, and bad things start to happen, since the open
      file doesn't have any associated NFSv4 state.
      
      The fix is firstly to return the EISDIR/ENOTDIR errors immediately, and
      secondly to ensure that we are always careful when dereferencing the
      nfs_open_context state pointer.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d953126a
    • T
      NFSv4: Fix an NFSv4 mount regression · fccba804
      Trond Myklebust 提交于
      Commit 008f55d0 (nfs41: recover lease in
      _nfs4_lookup_root) forces the state manager to always run on mount. This is
      a bug in the case of NFSv4.0, which doesn't require us to send a
      setclientid until we want to grab file state.
      
      In any case, this is completely the wrong place to be doing state
      management. Moving that code into nfs4_init_session...
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      fccba804
    • T
      NFSv4: Fix an Oops in nfs4_free_lock_state · b64aec8d
      Trond Myklebust 提交于
      The oops http://www.kerneloops.org/raw.php?rawid=537858&msgid= appears to
      be due to the nfs4_lock_state->ls_state field being uninitialised. This
      happens if the call to nfs4_free_lock_state() is triggered at the end of
      nfs4_get_lock_state().
      
      The fix is to move the initialisation of ls_state into the allocator.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      b64aec8d