1. 09 9月, 2009 3 次提交
  2. 24 8月, 2009 1 次提交
    • C
      NFS: Handle a zero-length auth flavor list · 5eecfde6
      Chuck Lever 提交于
      Some releases of Linux rpc.mountd (nfs-utils 1.1.4 and later) return an
      empty auth flavor list if no sec= was specified for the export.  This is
      notably broken server behavior.
      
      The new auth flavor list checking added in a recent commit rejects this
      case.  The OpenSolaris client does too.
      
      The broken mountd implementation is already widely deployed.  To avoid
      a behavioral regression, the kernel's mount client skips flavor checking
      (ie reverts to the pre-2.6.32 behavior) if mountd returns an empty
      flavor list.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      5eecfde6
  3. 20 8月, 2009 3 次提交
  4. 15 8月, 2009 19 次提交
  5. 12 8月, 2009 1 次提交
  6. 10 8月, 2009 13 次提交
    • 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