14 Dec, 2006

2 commits

  • Run this:

    #!/bin/sh
    for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
    echo "De-casting $f..."
    perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
    done

    And then go through and reinstate those cases where code is casting pointers
    to non-pointers.

    And then drop a few hunks which conflicted with outstanding work.

    Cc: Russell King , Ian Molton
    Cc: Mikael Starvik
    Cc: Yoshinori Sato
    Cc: Roman Zippel
    Cc: Geert Uytterhoeven
    Cc: Ralf Baechle
    Cc: Paul Mackerras
    Cc: Kyle McMartin
    Cc: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Greg KH
    Cc: Jens Axboe
    Cc: Paul Fulghum
    Cc: Alan Cox
    Cc: Karsten Keil
    Cc: Mauro Carvalho Chehab
    Cc: Jeff Garzik
    Cc: James Bottomley
    Cc: Ian Kent
    Cc: Steven French
    Cc: David Woodhouse
    Cc: Neil Brown
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Annotated, all places switched to keeping status net-endian.

    Signed-off-by: Al Viro
    Acked-by: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     

09 Dec, 2006

1 commit


08 Dec, 2006

3 commits


06 Dec, 2006

1 commit


06 Nov, 2006

1 commit

  • This patch takes the CTL_UNNUMBERD concept from NFS and makes it available to
    all new sysctl users.

    At the same time the sysctl binary interface maintenance documentation is
    updated to mention and to describe what is needed to successfully maintain the
    sysctl binary interface.

    Signed-off-by: Eric W. Biederman
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

21 Oct, 2006

2 commits


17 Oct, 2006

2 commits

  • It is possible for the ->fopen callback from lockd into nfsd to find that an
    answer cannot be given straight away (an upcall is needed) and so the request
    has to be 'dropped', to be retried later. That error status is not currently
    propagated back.

    So:
    Change nlm_fopen to return nlm error codes (rather than a private
    protocol) and define a new nlm_drop_reply code.
    Cause nlm_drop_reply to cause the rpc request to get rpc_drop_reply
    when this error comes back.
    Cause svc_process to drop a request which returns a status of
    rpc_drop_reply.

    [akpm@osdl.org: fix warning storm]
    Cc: Marc Eshel
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • When an nfs server shuts down, lockd needs to release all the locks even
    though the client still holds them.

    It should therefore not 'unmonitor' the clients, so that the files in nfs/sm
    will still be there when the nfs server restarts, so that those clients will
    be told to reclaim their locks.

    However the hosts are fully unmonitored, so statd may well remove the files.

    lockd has a test for 'sm_sticky' and avoid the unmonitor call if it is set,
    but it is currently not set.

    So set it when tearing down lockd.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     

04 Oct, 2006

20 commits

  • If nlm_lookup_host finds what it is looking for it exits with an extra
    reference on the matching 'nsm' structure.

    So don't actually count the reference until we are (fairly) sure it is going
    to be used.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Both the (recently introduces) nsm_sema and the older f_sema are converted
    over.

    Cc: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Neil Brown
     
  • nlmclnt_recovery would try to force a portmap rebind by setting
    host->h_nextrebind to 0. The right thing to do here is to set it to the
    current time.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • Every NLM call includes the client's NSM state. Currently, the Linux client
    always reports 0 - which seems not to cause any problems, but is not what the
    protocol says.

    This patch exposes the kernel's internal variable to user space via a sysctl,
    which can be set at system boot time by statd.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • When we send a GRANTED_MSG call, we current copy the NLM cookie provided in
    the original LOCK call - because in 1996, some broken clients seemed to rely
    on this bug. However, this means the cookies are not unique, so that when the
    client's GRANTED_RES message comes back, we cannot simply match it based on
    the cookie, but have to use the client's IP address in addition. Which breaks
    when you have a multi-homed NFS client.

    The X/Open spec explicitly mentions that clients should not expect the same
    cookie; so one may hope that any clients that were broken in 1996 have either
    been fixed or rendered obsolete.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • The way we incremented the NLM cookie in nlmclnt_next_cookie was not thread
    safe. This patch changes the counter to an atomic_t

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • This patch adds the nsm_use_hostnames sysctl and module param. If set, lockd
    will use the client's name (as given in the NLM arguments) to find the NSM
    handle. This makes recovery work when the NFS peer is multi-homed, and the
    reboot notification arrives from a different IP than the original lock calls.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • As a result of previous patches, the loop in nlmsvc_invalidate_all just sets
    h_expires for all client/hosts to 0 (though does it in a very complicated
    way).

    This was possibly meant to trigger early garbage collection but half the time
    '0' is in the future and so it infact delays garbage collection.

    Pre-aging the 'hosts' is not really needed at this point anyway so we throw
    out the loop and nlm_find_client which is no longer needed.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • This patch moves the host destruction code out of nlm_host_gc into a function
    of its own.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • This patch makes nlm_traverse{locks,blocks,shares} and friends use a function
    pointer rather than a "action" enum.

    This function pointer is given two nlm_hosts (one given by the caller, the
    other taken from the lock/block/share currently visited), and is free to do
    with them as it wants. If it returns a non-zero value, the lockd/block/share
    is released.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • This changes struct nlm_file and the nlm_files hash table to use a hlist
    instead of the home-grown lists.

    This allows us to remove f_hash which was only used to find the right hash
    chain to delete an entry from.

    It also increases the size of the nlm_files hash table from 32 to 128.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • This patch changes the nlm_blocked list to use a list_node instead of
    homegrown linked list handling.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • Get rid of the home-grown singly linked lists for the nlm_host hash table.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • This converts the statd upcalls to use the nsm_handle

    This means that we only register each host once with statd, rather than
    registering each host/vers/protocol triple.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • This patch makes the SM_NOTIFY handling understand and use the nsm_handle.

    To make it a bit clear what is happening:

    nlmclent_prepare_reclaim and nlmclnt_finish_reclaim
    get open-coded into 'reclaimer'

    The result is tidied up.

    Then some of that functionality is moved out into nlm_host_rebooted (which
    calls nlmclnt_recovery which starts a thread which runs reclaimer).

    Also host_rebooted now finds an nsm_handle rather than a host, then then
    iterates over all hosts and deals with each host that shares that nsm_handle.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • cleans up some code in lockd/host.c, fixes an error printk and makes it a
    fatal BUG if nlmsvc_free_host_resources fails.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • This patch introduces the nsm_handle, which is shared by all nlm_host objects
    referring to the same client.

    With this patch applied, all nlm_hosts from the same address will share the
    same nsm_handle. A future patch will add sharing by name.

    Note: this patch changes h_name so that it is no longer guaranteed to be an IP
    address of the host. When the host represents an NFS server, h_name will be
    the name passed in the mount call. When the host represents a client, h_name
    will be the name presented in the lock request received from the client. A
    h_name is only used for printing informational messages, this change should
    not be significant.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • This patch adds the peer's hostname (and name length) to all calls to
    nlm*_lookup_host functions. A subsequent patch will make use of these (is
    requested by a sysctl).

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • Common code from nlm4svc_proc_sm_notify and nlmsvc_proc_sm_notify is moved
    into a new nlm_host_rebooted.

    This is in preparation of a patch that will change the reboot notification
    handling entirely.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • This patch moves all checks of the h_monitored flag into the
    nsm_monitor/unmonitor functions. A subsequent patch will replace the
    mechanism by which we mark a host as being monitored.

    There is still one occurence of h_monitored outside of mon.c and that is in
    clntlock.c where we respond to a reboot. The subsequent patch will modify
    this too.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     

02 Oct, 2006

6 commits

  • Replace references to system_utsname to the per-process uts namespace
    where appropriate. This includes things like uname.

    Changes: Per Eric Biederman's comments, use the per-process uts namespace
    for ELF_PLATFORM, sunrpc, and parts of net/ipv4/ipconfig.c

    [jdike@addtoit.com: UML fix]
    [clg@fr.ibm.com: cleanup]
    [akpm@osdl.org: build fix]
    Signed-off-by: Serge E. Hallyn
    Cc: Kirill Korotaev
    Cc: "Eric W. Biederman"
    Cc: Herbert Poetzl
    Cc: Andrey Savochkin
    Signed-off-by: Cedric Le Goater
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     
  • If lockd_up fails - what should we expect? Do we have to later call
    lockd_down?

    Well the nfs client thinks "no", the nfs server thinks "yes". lockd thinks
    "yes".

    The only answer that really makes sense is "no" !!

    So:
    Make lockd_up only increment nlmsvc_users on success.
    Make nfsd handle errors from lockd_up properly.
    Make sure lockd_up(0) never fails when lockd is running
    so that the 'reclaimer' call to lockd_up doesn't need to
    be error checked.

    Cc: "J. Bruce Fields"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Thus it is printed for any path that leads to failure (make_socks is called
    from two places).

    Cc: "J. Bruce Fields"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • It isn't needed as it is available in rqstp->rq_server, and dropping it allows
    some local vars to be dropped.

    [akpm@osdl.org: build fix]
    Cc: "J. Bruce Fields"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Currently lockd listens on UDP always, and TCP if CONFIG_NFSD_TCP is set.

    However as lockd performs services of the client as well, this is a problem.
    If CONFIG_NfSD_TCP is not set, and a tcp mount is used, the server will not be
    able to call back to lockd.

    So:
    - add an option to lockd_up saying which protocol is needed
    - Always open sockets for which an explicit port was given, otherwise
    only open a socket of the type required
    - Change nfsd to do one lockd_up per socket rather than one per thread.

    This
    - removes the dependancy on CONFIG_NFSD_TCP
    - means that lockd may open sockets other than at startup
    - means that lockd will *not* listen on UDP if the only
    mounts are TCP mount (and nfsd hasn't started).

    The latter is the only one that concerns me at all - I don't know if this
    might be a problem with some servers.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • nfsd has some cleanup that it wants to do when the last thread exits, and
    there will shortly be some more. So collect this all into one place and
    define a callback for an rpc service to call when the service is about to be
    destroyed.

    [akpm@osdl.org: cleanups, build fix]
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     

27 Sep, 2006

2 commits