18 Jul, 2007

1 commit

  • Both lockd and (in the nfsv4 case) nfsd enforce a "grace period" after reboot,
    during which clients may reclaim locks from the previous server instance, but
    may not acquire new locks.

    Currently the lockd and nfsd enforce grace periods of different lengths. This
    may cause problems when we reboot a server with both v2/v3 and v4 clients.
    For example, if the lockd grace period is shorter (as is likely the case),
    then a v3 client might acquire a new lock that conflicts with a lock already
    held (but not yet reclaimed) by a v4 client.

    This patch calculates a lease time that lockd and nfsd can both use.

    Signed-off-by: Marc Eshel
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marc Eshel
     

11 Jul, 2007

1 commit


15 May, 2007

1 commit

  • - fs/lockd/xdr4.c:140:27: warning: incorrect type in argument 2 (different
    explicit signedness)
    - fs/lockd/xdr4.c:141:27: warning: incorrect type in argument 2 (different
    explicit signedness)
    - fs/lockd/xdr4.c:432:28: warning: incorrect type in argument 2 (different
    explicit signedness)
    - fs/lockd/xdr4.c:433:28: warning: incorrect type in argument 2 (different
    explicit signedness)
    - fs/lockd/xdr4.c:587:20: warning: symbol 'nlm_version4' was not declared.
    Should it be static?

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

08 May, 2007

1 commit

  • * 'server-cluster-locking-api' of git://linux-nfs.org/~bfields/linux:
    gfs2: nfs lock support for gfs2
    lockd: add code to handle deferred lock requests
    lockd: always preallocate block in nlmsvc_lock()
    lockd: handle test_lock deferrals
    lockd: pass cookie in nlmsvc_testlock
    lockd: handle fl_grant callbacks
    lockd: save lock state on deferral
    locks: add fl_grant callback for asynchronous lock return
    nfsd4: Convert NFSv4 to new lock interface
    locks: add lock cancel command
    locks: allow {vfs,posix}_lock_file to return conflicting lock
    locks: factor out generic/filesystem switch from setlock code
    locks: factor out generic/filesystem switch from test_lock
    locks: give posix_test_lock same interface as ->lock
    locks: make ->lock release private data before returning in GETLK case
    locks: create posix-to-flock helper functions
    locks: trivial removal of unnecessary parentheses

    Linus Torvalds
     

07 May, 2007

2 commits

  • Change NLM internal interface to pass more information for test lock; we
    need this to make sure the cookie information is pushed down to the place
    where we do request deferral, which is handled for testlock by the
    following patch.

    Signed-off-by: Marc Eshel
    Signed-off-by: J. Bruce Fields

    Marc Eshel
     
  • We need to keep some state for a pending asynchronous lock request, so this
    patch adds that state to struct nlm_block.

    This also adds a function which defers the request, by calling
    rqstp->rq_chandle.defer and storing the resulting deferred request in a
    nlm_block structure which we insert into lockd's global block list. That
    new function isn't called yet, so it's dead code until a later patch.

    Signed-off-by: Marc Eshel
    Signed-off-by: J. Bruce Fields

    Marc Eshel
     

01 May, 2007

1 commit

  • NLM version 4 requests estimate the call and reply header sizes rather
    conservatively, using the very maximum size allowed in the protocol even
    though Linux always uses only a small fraction of the allowable space.

    Reduce the size of caller and lock arguments to conserve RPC buffer space
    while XDR encoding NLM4 arguments. Add compile-time checks to ensure the
    hostname string won't overflow NLM protocol maximums.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

14 Dec, 2006

1 commit


09 Dec, 2006

1 commit


08 Dec, 2006

1 commit


21 Oct, 2006

1 commit


17 Oct, 2006

1 commit

  • 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
     

04 Oct, 2006

16 commits

  • 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
     
  • 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 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
     
  • 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
     
  • Many files include the filename at the beginning, serveral used a wrong one.

    Signed-off-by: Uwe Zeisberger
    Signed-off-by: Adrian Bunk

    Uwe Zeisberger
     

02 Oct, 2006

2 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
     
  • 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
     

04 Aug, 2006

1 commit

  • We never actually set the b_done field any more; it's always zero.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust
    (cherry picked from af8412d4283ef91356e65e0ed9b025b376aebded commit)

    J. Bruce Fields
     

21 Jun, 2006

1 commit


09 Jun, 2006

3 commits


26 Apr, 2006

1 commit


21 Mar, 2006

4 commits