1. 07 May, 2007 9 commits
    • Marc Eshel's avatar
      lockd: add code to handle deferred lock requests · 1a8322b2
      Marc Eshel authored
      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: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      1a8322b2
    • Marc Eshel's avatar
      lockd: always preallocate block in nlmsvc_lock() · f8120480
      Marc Eshel authored
      Normally we could skip ever having to allocate a block in the case where
      the client asks for a non-blocking lock, or asks for a blocking lock that
      succeeds immediately.
      
      However we're going to want to always look up a block first in order to
      check whether we're revisiting a deferred lock call, and to be prepared to
      handle the case where the filesystem returns -EINPROGRESS--in that case we
      want to make sure the lock we've given the filesystem is the one embedded
      in the block that we'll use to track the deferred request.
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      f8120480
    • Marc Eshel's avatar
      lockd: handle test_lock deferrals · 5ea0d750
      Marc Eshel authored
      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: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      5ea0d750
    • Marc Eshel's avatar
      lockd: pass cookie in nlmsvc_testlock · 85f3f1b3
      Marc Eshel authored
      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: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      85f3f1b3
    • Marc Eshel's avatar
      lockd: handle fl_grant callbacks · 0e4ac9d9
      Marc Eshel authored
      Add code to handle file system callback when the lock is finally granted.
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      0e4ac9d9
    • Marc Eshel's avatar
      lockd: save lock state on deferral · 2b36f412
      Marc Eshel authored
      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: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      2b36f412
    • Marc Eshel's avatar
      locks: add fl_grant callback for asynchronous lock return · 2beb6614
      Marc Eshel authored
      Acquiring a lock on a cluster filesystem may require communication with
      remote hosts, and to avoid blocking lockd or nfsd threads during such
      communication, we allow the results to be returned asynchronously.
      
      When a ->lock() call needs to block, the file system will return
      -EINPROGRESS, and then later return the results with a call to the
      routine in the fl_grant field of the lock_manager_operations struct.
      
      This differs from the case when ->lock returns -EAGAIN to a blocking
      lock request; in that case, the filesystem calls fl_notify when the lock
      is granted, and the caller retries the original lock.  So while
      fl_notify is merely a hint to the caller that it should retry, fl_grant
      actually communicates the final result of the lock operation (with the
      lock already acquired in the succesful case).
      
      Therefore fl_grant takes a lock, a status and, for the test lock case, a
      conflicting lock.  We also allow fl_grant to return an error to the
      filesystem, to handle the case where the fl_grant requests arrives after
      the lock manager has already given up waiting for it.
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      2beb6614
    • Marc Eshel's avatar
      nfsd4: Convert NFSv4 to new lock interface · fd85b817
      Marc Eshel authored
      Convert NFSv4 to the new lock interface.  We don't define any callback for now,
      so we're not taking advantage of the asynchronous feature--that's less critical
      for the multi-threaded nfsd then it is for the single-threaded lockd.  But this
      does allow a cluster filesystems to export cluster-coherent locking to NFS.
      
      Note that it's cluster filesystems that are the issue--of the filesystems that
      define lock methods (nfs, cifs, etc.), most are not exportable by nfsd.
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      fd85b817
    • Marc Eshel's avatar
      locks: add lock cancel command · 9b9d2ab4
      Marc Eshel authored
      Lock managers need to be able to cancel pending lock requests.  In the case
      where the exported filesystem manages its own locks, it's not sufficient just
      to call posix_unblock_lock(); we need to let the filesystem know what's
      happening too.
      
      We do this by adding a new fcntl lock command: FL_CANCELLK.  Some day this
      might also be made available to userspace applications that could benefit from
      an asynchronous locking api.
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatar"J. Bruce Fields" <bfields@citi.umich.edu>
      9b9d2ab4
  2. 06 May, 2007 5 commits
  3. 16 Apr, 2007 2 commits
  4. 15 Apr, 2007 9 commits
  5. 14 Apr, 2007 5 commits
  6. 13 Apr, 2007 6 commits
    • David S. Miller's avatar
      [NETFILTER] arp_tables: Fix unaligned accesses. · 49688c84
      David S. Miller authored
      There are two device string comparison loops in arp_packet_match().
      The first one goes byte-by-byte but the second one tries to be
      clever and cast the string to a long and compare by longs.
      
      The device name strings in the arp table entries are not guarenteed
      to be aligned enough to make this value, so just use byte-by-byte
      for both cases.
      
      Based upon a report by <drraid@gmail.com>.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      49688c84
    • YOSHIFUJI Hideaki's avatar
      [IPV6] SNMP: Fix {In,Out}NoRoutes statistics. · 612f09e8
      YOSHIFUJI Hideaki authored
      A packet which is being discarded because of no routes in the
      forwarding path should not be counted as OutNoRoutes but as
      InNoRoutes.
      Additionally, on this occasion, a packet whose destinaion is
      not valid should be counted as InAddrErrors separately.
      
      Based on patch from Mitsuru Chinen <mitch@linux.vnet.ibm.com>.
      Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      612f09e8
    • Joy Latten's avatar
      [IPSEC] XFRM_USER: kernel panic when large security contexts in ACQUIRE · 661697f7
      Joy Latten authored
      When sending a security context of 50+ characters in an ACQUIRE 
      message, following kernel panic occurred.
      
      kernel BUG in xfrm_send_acquire at net/xfrm/xfrm_user.c:1781!
      cpu 0x3: Vector: 700 (Program Check) at [c0000000421bb2e0]
          pc: c00000000033b074: .xfrm_send_acquire+0x240/0x2c8
          lr: c00000000033b014: .xfrm_send_acquire+0x1e0/0x2c8
          sp: c0000000421bb560
         msr: 8000000000029032
        current = 0xc00000000fce8f00
        paca    = 0xc000000000464b00
          pid   = 2303, comm = ping
      kernel BUG in xfrm_send_acquire at net/xfrm/xfrm_user.c:1781!
      enter ? for help
      3:mon> t
      [c0000000421bb650] c00000000033538c .km_query+0x6c/0xec
      [c0000000421bb6f0] c000000000337374 .xfrm_state_find+0x7f4/0xb88
      [c0000000421bb7f0] c000000000332350 .xfrm_tmpl_resolve+0xc4/0x21c
      [c0000000421bb8d0] c0000000003326e8 .xfrm_lookup+0x1a0/0x5b0
      [c0000000421bba00] c0000000002e6ea0 .ip_route_output_flow+0x88/0xb4
      [c0000000421bbaa0] c0000000003106d8 .ip4_datagram_connect+0x218/0x374
      [c0000000421bbbd0] c00000000031bc00 .inet_dgram_connect+0xac/0xd4
      [c0000000421bbc60] c0000000002b11ac .sys_connect+0xd8/0x120
      [c0000000421bbd90] c0000000002d38d0 .compat_sys_socketcall+0xdc/0x214
      [c0000000421bbe30] c00000000000869c syscall_exit+0x0/0x40
      --- Exception: c00 (System Call) at 0000000007f0ca9c
      SP (fc0ef8f0) is in userspace
      
      We are using size of security context from xfrm_policy to determine
      how much space to alloc skb and then putting security context from
      xfrm_state into skb. Should have been using size of security context 
      from xfrm_state to alloc skb. Following fix does that
      Signed-off-by: default avatarJoy Latten <latten@austin.ibm.com>
      Acked-by: default avatarJames Morris <jmorris@namei.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      661697f7
    • Jerome Borsboom's avatar
      [VLAN]: Allow VLAN interface on top of bridge interface · 279e172a
      Jerome Borsboom authored
      When a VLAN interface is created on top of a bridge interface and 
      netfilter is enabled to see the bridged packets, the packets can be 
      corrupted when passing through the netfilter code. This is caused by the 
      VLAN driver not setting the 'protocol' and 'nh' members of the sk_buff 
      structure. In general, this is no problem as the VLAN interface is mostly 
      connected to a physical ethernet interface which does not use the 
      'protocol' and 'nh' members. For a bridge interface, however, these 
      members do matter.
      Signed-off-by: default avatarJerome Borsboom <j.borsboom@erasmusmc.nl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      279e172a
    • Tom "spot" Callaway's avatar
      [SPARC64]: Fix inline directive in pci_iommu.c · 24fc6f00
      Tom "spot" Callaway authored
      While building a test kernel for the new esp driver (against
      git-current), I hit this bug. Trivial fix, put the inline declaration
      in the right place. :)
      Signed-off-by: default avatarTom "spot" Callaway <tcallawa@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      24fc6f00
    • David S. Miller's avatar
      [SPARC64]: Fix arg passing to compat_sys_ipc(). · 5c7aa6ff
      David S. Miller authored
      Do not sign extend args using the sys32_ipc stub, that is
      buggy and unnecessary.
      
      Based upon an excellent report by Mikael Pettersson.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c7aa6ff
  7. 12 Apr, 2007 4 commits