07 May, 2007

3 commits

  • Rewrite nlmsvc_lock() to use the asynchronous interface.

    As with testlock, we answer nlm requests in nlmsvc_lock by first looking up
    the block and then using the results we find in the block if B_QUEUED is
    set, and calling vfs_lock_file() otherwise.

    If this a new lock request and we get -EINPROGRESS return on a non-blocking
    request then we defer the request.

    Also modify nlmsvc_unlock() to call the filesystem method if appropriate.

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

    Marc Eshel
     
  • Rewrite nlmsvc_testlock() to use the new asynchronous interface: instead of
    immediately doing a posix_test_lock(), we first look for a matching block.
    If the subsequent test_lock returns anything other than -EINPROGRESS, we
    then remove the block we've found and return the results.

    If it returns -EINPROGRESS, then we defer the lock request.

    In the case where the block we find in the first step has B_QUEUED set,
    we bypass the vfs_test_lock entirely, instead using the block to decide how
    to respond:
    with nlm_lck_denied if B_TIMED_OUT is set.
    with nlm_granted if B_GOT_CALLBACK is set.
    by dropping if neither B_TIMED_OUT nor B_GOT_CALLBACK is set

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

    Marc Eshel
     
  • 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
     

13 Feb, 2007

2 commits

  • Expand the rq_addr field to allow it to contain larger addresses.

    Specifically, we replace a 'sockaddr_in' with a 'sockaddr_storage', then
    everywhere the 'sockaddr_in' was referenced, we use instead an accessor
    function (svc_addr_in) which safely casts the _storage to _in.

    Signed-off-by: Chuck Lever
    Cc: Aurelien Charbon
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chuck Lever
     
  • There are loads of places where the RPC server assumes that the rq_addr fields
    contains an IPv4 address. Top among these are error and debugging messages
    that display the server's IP address.

    Let's refactor the address printing into a separate function that's smart
    enough to figure out the difference between IPv4 and IPv6 addresses.

    Signed-off-by: Chuck Lever
    Cc: Aurelien Charbon
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chuck Lever
     

06 Dec, 2006

1 commit


21 Oct, 2006

2 commits


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

5 commits

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

21 Mar, 2006

3 commits


15 Feb, 2006

1 commit

  • If 2 threads attached to the same process are blocking on different locks on
    different files (maybe even on different servers) but have the same lock
    arguments (i.e. same offset+length - actually quite common, since most
    processes try to lock the entire file) then the first GRANTED call that wakes
    one up will also wake the other.

    Currently when the NLM_GRANTED callback comes in, lockd walks the list of
    blocked locks in search of a match to the lock that the NLM server has
    granted. Although it checks the lock pid, start and end, it fails to check
    the filehandle and the server address.

    By checking the filehandle and server IP address, we ensure that this only
    happens if the locks truly are referencing the same file.

    Signed-off-by: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Trond Myklebust
     

07 Jan, 2006

1 commit

  • Shrink the RPC task structure. Instead of storing separate pointers
    for task->tk_exit and task->tk_release, put them in a structure.

    Also pass the user data pointer as a parameter instead of passing it via
    task->tk_calldata. This enables us to nest callbacks.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds