22 Dec, 2012

1 commit

  • This reverts commit 79f77bf9a4e3dd5ead006b8f17e7c4ff07d8374e.

    This is obviously wrong, and I have no idea how I missed seeing the
    warning in testing: I must just not have looked at the right logs. The
    caller bumps rq_resused/rq_next_page, so it will always be hit on a
    large enough read.

    Reported-by: Dave Jones
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     

18 Dec, 2012

6 commits


11 Dec, 2012

20 commits

  • If len == 0 we end up with size = (0 - 1), which could cause bad things
    to happen in copy_from_user().

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

    Bryan Schumaker
     
  • I honestly have no idea where I got 129 from, but it's a much bigger
    value than the actual buffer size (INET6_ADDRSTRLEN).

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

    Bryan Schumaker
     
  • Since NFSd service is per-net now, we have to pass proper network
    context in nfsd_shutdown() from NFSd kthreads.

    The simplest way I found is to get proper net from one of transports
    with permanent sockets.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • Function nfsd_shutdown is called from two places: nfsd_last_thread (when last
    kernel thread is exiting) and nfsd_svc (in case of kthreads starting error).
    When calling from nfsd_svc(), we can be sure that per-net resources are
    allocated, so we don't need to check per-net nfsd_net_up boolean flag.
    This allows us to remove nfsd_shutdown function at all and move check for
    per-net nfsd_net_up boolean flag to nfsd_last_thread.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • Since we have generic NFSd resurces, we have to introduce some way how to
    allocate and destroy those resources on first per-net NFSd start and on
    last per-net NFSd stop respectively.
    This patch replaces global boolean nfsd_up flag (which is unused now) by users
    counter and use it to determine either we need to allocate generic resources
    or destroy them.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • This patch moves nfsd_startup_generic() and nfsd_shutdown_generic()
    calls to nfsd_startup_net() and nfsd_shutdown_net() respectively, which
    allows us to call nfsd_startup_net() instead of nfsd_startup() and makes
    the code look clearer. It also modifies nfsd_svc() and nfsd_shutdown()
    to check nn->nfsd_net_up instead of global nfsd_up. The latter is now
    used only for generic resources shutdown and is currently useless. It
    will replaced by NFSd users counter later in this series.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • NFSd have per-net resources and resources, used globally.
    Let's move generic resources init and shutdown to separated functions since
    they are going to be allocated on first NFSd service start and destroyed after
    last NFSd service shutdown.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • This patch makes main step in NFSd containerisation.

    There could be different approaches to how to make NFSd able to handle
    incoming RPC request from different network namespaces. The two main
    options are:

    1) Share NFSd kthreads betwween all network namespaces.
    2) Create separated pool of threads for each namespace.

    While first approach looks more flexible, second one is simpler and
    non-racy. This patch implements the second option.

    To make it possible to allocate separate pools of threads, we have to
    make it possible to allocate separate NFSd service structures per net.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • This is simple: an NFSd service can be started at different times in
    different network environments. So, its "boot time" has to be assigned
    per net.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • This patch introduces introduces per-net "nfsd_net_up" boolean flag, which has
    the same purpose as general "nfsd_up" flag - skip init or shutdown of per-net
    resources in case of they are inited on shutted down respectively.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • NFSd resources are partially per-net and partially globally used.
    This patch splits resources init and shutdown and moves per-net code to
    separated functions.
    Generic and per-net init and shutdown are called sequentially for a while.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • Precursor patch. Hard-coded "init_net" will be replaced by proper one in
    future.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • Precursor patch. Hard-coded "init_net" will be replaced by proper one in
    future.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • Precursor patch. Hard-coded "init_net" will be replaced by proper one in
    future.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • Precursor patch. Hard-coded "init_net" will be replaced by proper one in
    future.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • Precursor patch. Hard-coded "init_net" will be replaced by proper one in
    future.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • Precursor patch. Hard-coded "init_net" will be replaced by proper one in
    future.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • There could be a situation, when NFSd was started in one network namespace, but
    stopped in another one.
    This will trigger kernel panic, because RPCBIND client is stored on per-net
    NFSd data, and will be NULL on NFSd shutdown.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • With NFSv4, if we create a file then open it we explicit avoid checking
    the permissions on the file during the open because the fact that we
    created it ensures we should be allow to open it (the create and the
    open should appear to be a single operation).

    However if the reply to an EXCLUSIVE create gets lots and the client
    resends the create, the current code will perform the permission check -
    because it doesn't realise that it did the open already..

    This patch should fix this.

    Note that I haven't actually seen this cause a problem. I was just
    looking at the code trying to figure out a different EXCLUSIVE open
    related issue, and this looked wrong.

    (Fix confirmed with pynfs 4.0 test OPEN4--bfields)

    Cc: stable@kernel.org
    Signed-off-by: NeilBrown
    [bfields: use OWNER_OVERRIDE and update for 4.1]
    Signed-off-by: J. Bruce Fields

    Neil Brown
     
  • Pointer to client tracking operations - client_tracking_ops - have to be
    containerized, because different environment can support different trackers
    (for example, legacy tracker currently is not suported in container).

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     

04 Dec, 2012

1 commit


03 Dec, 2012

10 commits


29 Nov, 2012

1 commit

  • There were only a small number of functions in this file and since they
    all affect stored state I think it makes sense to put them in state.h
    instead. I also dropped most static inline declarations since there are
    no callers when fault injection is not enabled.

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

    Bryan Schumaker
     

28 Nov, 2012

1 commit