1. 07 5月, 2007 12 次提交
    • M
      lockd: handle test_lock deferrals · 5ea0d750
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      5ea0d750
    • M
      lockd: pass cookie in nlmsvc_testlock · 85f3f1b3
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      85f3f1b3
    • M
      lockd: handle fl_grant callbacks · 0e4ac9d9
      Marc Eshel 提交于
      Add code to handle file system callback when the lock is finally granted.
      Signed-off-by: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      0e4ac9d9
    • M
      lockd: save lock state on deferral · 2b36f412
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      2b36f412
    • M
      locks: add fl_grant callback for asynchronous lock return · 2beb6614
      Marc Eshel 提交于
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      2beb6614
    • M
      nfsd4: Convert NFSv4 to new lock interface · fd85b817
      Marc Eshel 提交于
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      fd85b817
    • M
      locks: add lock cancel command · 9b9d2ab4
      Marc Eshel 提交于
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: N"J. Bruce Fields" <bfields@citi.umich.edu>
      9b9d2ab4
    • M
      locks: allow {vfs,posix}_lock_file to return conflicting lock · 150b3934
      Marc Eshel 提交于
      The nfsv4 protocol's lock operation, in the case of a conflict, returns
      information about the conflicting lock.
      
      It's unclear how clients can use this, so for now we're not going so far as to
      add a filesystem method that can return a conflicting lock, but we may as well
      return something in the local case when it's easy to.
      Signed-off-by: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: N"J. Bruce Fields" <bfields@citi.umich.edu>
      150b3934
    • M
      locks: factor out generic/filesystem switch from setlock code · 7723ec97
      Marc Eshel 提交于
      Factor out the code that switches between generic and filesystem-specific lock
      methods; eventually we want to call this from lock managers (lockd and nfsd)
      too; currently they only call the generic methods.
      
      This patch does that for all the setlk code.
      Signed-off-by: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: N"J. Bruce Fields" <bfields@citi.umich.edu>
      7723ec97
    • J
      locks: factor out generic/filesystem switch from test_lock · 3ee17abd
      J. Bruce Fields 提交于
      Factor out the code that switches between generic and filesystem-specific lock
      methods; eventually we want to call this from lock managers (lockd and nfsd)
      too; currently they only call the generic methods.
      
      This patch does that for test_lock.
      
      Note that this hasn't been necessary until recently, because the few
      filesystems that define ->lock() (nfs, cifs...) aren't exportable via NFS.
      However GFS (and, in the future, other cluster filesystems) need to implement
      their own locking to get cluster-coherent locking, and also want to be able to
      export locking to NFS (lockd and NFSv4).
      
      So we accomplish this by factoring out code such as this and exporting it for
      the use of lockd and nfsd.
      Signed-off-by: N"J. Bruce Fields" <bfields@citi.umich.edu>
      3ee17abd
    • M
      locks: give posix_test_lock same interface as ->lock · 9d6a8c5c
      Marc Eshel 提交于
      posix_test_lock() and ->lock() do the same job but have gratuitously
      different interfaces.  Modify posix_test_lock() so the two agree,
      simplifying some code in the process.
      Signed-off-by: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: N"J. Bruce Fields" <bfields@citi.umich.edu>
      9d6a8c5c
    • J
      locks: make ->lock release private data before returning in GETLK case · 70cc6487
      J. Bruce Fields 提交于
      The file_lock argument to ->lock is used to return the conflicting lock
      when found.  There's no reason for the filesystem to return any private
      information with this conflicting lock, but nfsv4 is.
      
      Fix nfsv4 client, and modify locks.c to stop calling fl_release_private
      for it in this case.
      Signed-off-by: N"J. Bruce Fields" <bfields@citi.umich.edu>
      Cc: "Trond Myklebust" <Trond.Myklebust@netapp.com>"
      70cc6487
  2. 17 4月, 2007 2 次提交
  3. 16 4月, 2007 2 次提交
  4. 15 4月, 2007 8 次提交
  5. 14 4月, 2007 10 次提交
    • J
      [SCSI] 3w-xxxx: fix oops caused by incorrect REQUEST_SENSE handling · 6e3b2bbb
      James Bottomley 提交于
      3w-xxxx emulates a REQUEST_SENSE response by simply returning nothing.
      Unfortunately, it's assuming that the REQUEST_SENSE command is
      implemented with use_sg == 0, which is no longer the case.  The oops
      occurs because it's clearing the scatterlist in request_buffer instead
      of the memory region.
      
      This is fixed by using tw_transfer_internal() to transfer correctly to
      the scatterlist.
      Acked-by: Nadam radford <aradford@gmail.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      6e3b2bbb
    • O
      DVB: dvb-usb-remote - fix oops when changing keymap · d791d413
      Olaf Kirch 提交于
      DVB USB remotes do not support changing keycode maps but set
      input_dev->keycodesize and input_dev->keycodemax without setting
      input_dev->keycode. This causes kernel oops when user tries to
      look up (or change) current keymap.
      
      While the proper fix would be to make remotes handle keymap changes
      we'll just remove keycodemax and keycodesize initialization so
      EVIOCGKEYCODE and EVIOCSKEYCODE will simply return -EINVAL.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=8312
      
      Signed-off-by: olaf.kirch@oracle.com
      Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d791d413
    • L
      Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6 · b1847a04
      Linus Torvalds 提交于
      * master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
        [SPARC64]: Fix inline directive in pci_iommu.c
        [SPARC64]: Fix arg passing to compat_sys_ipc().
        [SPARC]: Fix section mismatch warnings in pci.c and pcic.c
        [SUNRPC]: Make sure on-stack cmsg buffer is properly aligned.
        [SPARC]: avoid CHILD_MAX and OPEN_MAX constants
        [SPARC64]: Fix SBUS IOMMU allocation code.
      b1847a04
    • L
      Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 · 2918cd81
      Linus Torvalds 提交于
      * master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
        [NETFILTER] arp_tables: Fix unaligned accesses.
        [IPV6] SNMP: Fix {In,Out}NoRoutes statistics.
        [IPSEC] XFRM_USER: kernel panic when large security contexts in ACQUIRE
        [VLAN]: Allow VLAN interface on top of bridge interface
        [PKTGEN]: Add try_to_freeze()
        [NETFILTER]: ipt_ULOG: use put_unaligned
      2918cd81
    • D
      [NETFILTER] arp_tables: Fix unaligned accesses. · 49688c84
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      49688c84
    • Y
      [IPV6] SNMP: Fix {In,Out}NoRoutes statistics. · 612f09e8
      YOSHIFUJI Hideaki 提交于
      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: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      612f09e8
    • J
      [IPSEC] XFRM_USER: kernel panic when large security contexts in ACQUIRE · 661697f7
      Joy Latten 提交于
      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: NJoy Latten <latten@austin.ibm.com>
      Acked-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      661697f7
    • J
      [VLAN]: Allow VLAN interface on top of bridge interface · 279e172a
      Jerome Borsboom 提交于
      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: NJerome Borsboom <j.borsboom@erasmusmc.nl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      279e172a
    • T
      [SPARC64]: Fix inline directive in pci_iommu.c · 24fc6f00
      Tom "spot" Callaway 提交于
      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: NTom "spot" Callaway <tcallawa@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24fc6f00
    • D
      [SPARC64]: Fix arg passing to compat_sys_ipc(). · 5c7aa6ff
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      5c7aa6ff
  6. 13 4月, 2007 6 次提交