1. 15 Sep, 2009 23 commits
    • Greg Kroah-Hartman's avatar
      Linux 2.6.30.7 · 20a807a7
      Greg Kroah-Hartman authored
      20a807a7
    • Mikulas Patocka's avatar
      dm snapshot: fix on disk chunk size validation · 0ce76a2b
      Mikulas Patocka authored
      commit ae0b7448 upstream.
      
      Fix some problems seen in the chunk size processing when activating a
      pre-existing snapshot.
      
      For a new snapshot, the chunk size can either be supplied by the creator
      or a default value can be used.  For an existing snapshot, the
      chunk size in the snapshot header on disk should always be used.
      
      If someone attempts to load an existing snapshot and has the 'default
      chunk size' option set, the kernel uses its default value even when it
      is incorrect for the snapshot being loaded.  This patch ensures the
      correct on-disk value is always used.
      
      Secondly, when the code does use the chunk size stored on the disk it is
      prudent to revalidate it, so the code can exit cleanly if it got
      corrupted as happened in
      https://bugzilla.redhat.com/show_bug.cgi?id=461506
      
       .
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0ce76a2b
    • Mikulas Patocka's avatar
      dm exception store: split set_chunk_size · da834163
      Mikulas Patocka authored
      commit 2defcc3f
      
       upstream.
      
      Break the function set_chunk_size to two functions in preparation for
      the fix in the following patch.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      da834163
    • Mikulas Patocka's avatar
      dm snapshot: fix header corruption race on invalidation · 30d026ad
      Mikulas Patocka authored
      commit 61578dcd upstream.
      
      If a persistent snapshot fills up, a race can corrupt the on-disk header
      which causes a crash on any future attempt to activate the snapshot
      (typically while booting).  This patch fixes the race.
      
      When the snapshot overflows, __invalidate_snapshot is called, which calls
      snapshot store method drop_snapshot. It goes to persistent_drop_snapshot that
      calls write_header. write_header constructs the new header in the "area"
      location.
      
      Concurrently, an existing kcopyd job may finish, call copy_callback
      and commit_exception method, that goes to persistent_commit_exception.
      persistent_commit_exception doesn't do locking, relying on the fact that
      callbacks are single-threaded, but it can race with snapshot invalidation and
      overwrite the header that is just being written while the snapshot is being
      invalidated.
      
      The result of this race is a corrupted header being written that can
      lead to a crash on further reactivation (if chunk_size is zero in the
      corrupted header).
      
      The fix is to use separate memory areas for each.
      
      See the bug: https://bugzilla.redhat.com/show_bug.cgi?id=461506
      
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      30d026ad
    • Mikulas Patocka's avatar
      dm snapshot: refactor zero_disk_area to use chunk_io · 008f14e7
      Mikulas Patocka authored
      commit 02d2fd31
      
       upstream.
      
      Refactor chunk_io to prepare for the fix in the following patch.
      
      Pass an area pointer to chunk_io and simplify zero_disk_area to use
      chunk_io.  No functional change.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      008f14e7
    • Jonathan Brassow's avatar
      dm raid1: do not allow log_failure variable to unset after being set · 8c57b590
      Jonathan Brassow authored
      commit d2b69864
      
       upstream.
      
      This patch fixes a bug which was triggering a case where the primary leg
      could not be changed on failure even when the mirror was in-sync.
      
      The case involves the failure of the primary device along with
      the transient failure of the log device.  The problem is that
      bios can be put on the 'failures' list (due to log failure)
      before 'fail_mirror' is called due to the primary device failure.
      Normally, this is fine, but if the log device failure is transient,
      a subsequent iteration of the work thread, 'do_mirror', will
      reset 'log_failure'.  The 'do_failures' function then resets
      the 'in_sync' variable when processing bios on the failures list.
      The 'in_sync' variable is what is used to determine if the
      primary device can be switched in the event of a failure.  Since
      this has been reset, the primary device is incorrectly assumed
      to be not switchable.
      
      The case has been seen in the cluster mirror context, where one
      machine realizes the log device is dead before the other machines.
      As the responsibilities of the server migrate from one node to
      another (because the mirror is being reconfigured due to the failure),
      the new server may think for a moment that the log device is fine -
      thus resetting the 'log_failure' variable.
      
      In any case, it is inappropiate for us to reset the 'log_failure'
      variable.  The above bug simply illustrates that it can actually
      hurt us.
      Signed-off-by: default avatarJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8c57b590
    • Clemens Ladisch's avatar
      sound: oxygen: fix MCLK rate for 192 kHz playback · 8f78d18b
      Clemens Ladisch authored
      commit b91ab72b
      
       upstream.
      
      Do not forget to program the MCLK ratio for the I2S output.
      Otherwise, the master clock frequency can be too high for
      the DACs at sample frequencies above 96 kHz.
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8f78d18b
    • Clemens Ladisch's avatar
      sound: oxygen: handle cards with missing EEPROM · ec202825
      Clemens Ladisch authored
      commit 92653453
      
       upstream.
      
      The card model detection code introduced in 2.6.30 that tries to work
      around partially broken EEPROM contents by reading the EEPROM directly
      does not handle cards where the EEPROM has been omitted.  In this case,
      we have to use the default ID to allow the driver to load.
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Reported-and-tested-by: default avatarOzan Çağlayan <ozan@pardus.org.tr>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ec202825
    • James Bottomley's avatar
      SCSI: sd: fix bug in SCSI async probing · 65a11d23
      James Bottomley authored
      commit 601e7638
      
       upstream.
      
      The async split up of probing in sd.c created a potential failure case where
      something goes wrong with device_add(), but which we don't recover properly.
      Since, in general, asynchronous error handling is hard, move the device_add()
      into the asynchronous path (it should be fast) and make sure all the deferred
      processing cannot fail.
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      65a11d23
    • Chris Wright's avatar
      PCI SR-IOV: correct broken resource alignment calculations · 354c51ed
      Chris Wright authored
      commit 6faf17f6
      
       upstream.
      
      An SR-IOV capable device includes an SR-IOV PCIe capability which
      describes the Virtual Function (VF) BAR requirements.  A typical SR-IOV
      device can support multiple VFs whose BARs must be in a contiguous region,
      effectively an array of VF BARs.  The BAR reports the size requirement
      for a single VF.  We calculate the full range needed by simply multiplying
      the VF BAR size with the number of possible VFs and create a resource
      spanning the full range.
      
      This all seems sane enough except it artificially inflates the alignment
      requirement for the VF BAR.  The VF BAR need only be aligned to the size
      of a single BAR not the contiguous range of VF BARs.  This can cause us
      to fail to allocate resources for the BAR despite the fact that we
      actually have enough space.
      
      This patch adds a thin PCI specific layer over the generic
      resource_alignment() function which is aware of the special nature of
      VF BARs and does sorting and allocation based on the smaller alignment
      requirement.
      
      I recognize that while resource_alignment is generic, it's basically a
      PCI helper.  An alternative to this patch is to add PCI VF BAR specific
      information to struct resource.  I opted for the extra layer rather than
      adding such PCI specific information to struct resource.  This does
      have the slight downside that we don't cache the BAR size and re-read
      for each alignment query (happens a small handful of times during boot
      for each VF BAR).
      Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Yu Zhao <yu.zhao@intel.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      354c51ed
    • Ryusuke Konishi's avatar
      nilfs2: fix preempt count underflow in nilfs_btnode_prepare_change_key · 820fdfd8
      Ryusuke Konishi authored
      commit b1f1b8ce
      
       upstream.
      
      This will fix the following preempt count underflow reported from
      users with the title "[NILFS users] segctord problem" (Message-ID:
      <949415.6494.qm@web58808.mail.re1.yahoo.com> and Message-ID:
      <debc30fc0908270825v747c1734xa59126623cfd5b05@mail.gmail.com>):
      
       WARNING: at kernel/sched.c:4890 sub_preempt_count+0x95/0xa0()
       Hardware name: HP Compaq 6530b (KR980UT#ABC)
       Modules linked in: bridge stp llc bnep rfcomm l2cap xfs exportfs nilfs2 cowloop loop vboxnetadp vboxnetflt vboxdrv btusb bluetooth uvcvideo videodev v4l1_compat v4l2_compat_ioctl32 arc4 snd_hda_codec_analog ecb iwlagn iwlcore rfkill lib80211 mac80211 snd_hda_intel snd_hda_codec ehci_hcd uhci_hcd usbcore snd_hwdep snd_pcm tg3 cfg80211 psmouse snd_timer joydev libphy ohci1394 snd_page_alloc hp_accel lis3lv02d ieee1394 led_class i915 drm i2c_algo_bit video backlight output i2c_core dm_crypt dm_mod
       Pid: 4197, comm: segctord Not tainted 2.6.30-gentoo-r4-64 #7
       Call Trace:
        [<ffffffff8023fa05>] ? sub_preempt_count+0x95/0xa0
        [<ffffffff802470f8>] warn_slowpath_common+0x78/0xd0
        [<ffffffff8024715f>] warn_slowpath_null+0xf/0x20
        [<ffffffff8023fa05>] sub_preempt_count+0x95/0xa0
        [<ffffffffa04ce4db>] nilfs_btnode_prepare_change_key+0x11b/0x190 [nilfs2]
        [<ffffffffa04d01ad>] nilfs_btree_assign_p+0x19d/0x1e0 [nilfs2]
        [<ffffffffa04d10ad>] nilfs_btree_assign+0xbd/0x130 [nilfs2]
        [<ffffffffa04cead7>] nilfs_bmap_assign+0x47/0x70 [nilfs2]
        [<ffffffffa04d9bc6>] nilfs_segctor_do_construct+0x956/0x20f0 [nilfs2]
        [<ffffffff805ac8e2>] ? _spin_unlock_irqrestore+0x12/0x40
        [<ffffffff803c06e0>] ? __up_write+0xe0/0x150
        [<ffffffff80262959>] ? up_write+0x9/0x10
        [<ffffffffa04ce9f3>] ? nilfs_bmap_test_and_clear_dirty+0x43/0x60 [nilfs2]
        [<ffffffffa04cd627>] ? nilfs_mdt_fetch_dirty+0x27/0x60 [nilfs2]
        [<ffffffffa04db5fc>] nilfs_segctor_construct+0x8c/0xd0 [nilfs2]
        [<ffffffffa04dc3dc>] nilfs_segctor_thread+0x15c/0x3a0 [nilfs2]
        [<ffffffffa04dbe20>] ? nilfs_construction_timeout+0x0/0x10 [nilfs2]
        [<ffffffff80252633>] ? add_timer+0x13/0x20
        [<ffffffff802370da>] ? __wake_up_common+0x5a/0x90
        [<ffffffff8025e960>] ? autoremove_wake_function+0x0/0x40
        [<ffffffffa04dc280>] ? nilfs_segctor_thread+0x0/0x3a0 [nilfs2]
        [<ffffffffa04dc280>] ? nilfs_segctor_thread+0x0/0x3a0 [nilfs2]
        [<ffffffff8025e556>] kthread+0x56/0x90
        [<ffffffff8020cdea>] child_rip+0xa/0x20
        [<ffffffff8025e500>] ? kthread+0x0/0x90
        [<ffffffff8020cde0>] ? child_rip+0x0/0x20
      
      This problem was caused due to a missing radix_tree_preload() call in
      the retry path of nilfs_btnode_prepare_change_key() function.
      Reported-by: default avatarEric A <eric225125@yahoo.com>
      Reported-by: default avatarJerome Poulin <jeromepoulin@gmail.com>
      Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Tested-by: default avatarJerome Poulin <jeromepoulin@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      820fdfd8
    • Eric Dumazet's avatar
      slub: Fix kmem_cache_destroy() with SLAB_DESTROY_BY_RCU · e8f23f08
      Eric Dumazet authored
      commit d76b1590
      
       upstream.
      
      kmem_cache_destroy() should call rcu_barrier() *after* kmem_cache_close() and
      *before* sysfs_slab_remove() or risk rcu_free_slab() being called after
      kmem_cache is deleted (kfreed).
      
      rmmod nf_conntrack can crash the machine because it has to kmem_cache_destroy()
      a SLAB_DESTROY_BY_RCU enabled cache.
      Reported-by: default avatarZdenek Kabelac <zdenek.kabelac@gmail.com>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e8f23f08
    • Massimo Cirillo's avatar
      JFFS2: add missing verify buffer allocation/deallocation · 6c135b4e
      Massimo Cirillo authored
      commit bc8cec0d
      
       upstream.
      
      The function jffs2_nor_wbuf_flash_setup() doesn't allocate the verify buffer
      if CONFIG_JFFS2_FS_WBUF_VERIFY is defined, so causing a kernel panic when
      that macro is enabled and the verify function is called. Similarly the
      jffs2_nor_wbuf_flash_cleanup() must free the buffer if
      CONFIG_JFFS2_FS_WBUF_VERIFY is enabled.
      The following patch fixes the problem.
      The following patch applies to 2.6.30 kernel.
      Signed-off-by: default avatarMassimo Cirillo <maxcir@gmail.com>
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6c135b4e
    • Mathieu Desnoyers's avatar
      sparc: sys32.S incorrect compat-layer splice() system call · 22a3f9b7
      Mathieu Desnoyers authored
      [ Upstream commit e2c6cbd9
      
       ]
      
      I think arch/sparc/kernel/sys32.S has an incorrect splice definition:
      
      SIGN2(sys32_splice, sys_splice, %o0, %o1)
      
      The splice() prototype looks like :
      
             long splice(int fd_in, loff_t *off_in, int fd_out,
                         loff_t *off_out, size_t len, unsigned int flags);
      
      So I think we should have :
      
      SIGN2(sys32_splice, sys_splice, %o0, %o2)
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      22a3f9b7
    • David S. Miller's avatar
      sparc64: Fix bootup with mcount in some configs. · eb2bbea7
      David S. Miller authored
      [ Upstream commit bd4352ca
      
       ]
      
      Functions invoked early when booting up a cpu can't use
      tracing because mcount requires a valid 'current_thread_info()'
      and TLB mappings to be setup.
      
      The code path of sun4v_register_mondo_queues --> register_one_mondo
      is one such case.  sun4v_register_mondo_queues already has the
      necessary 'notrace' annotation, but register_one_mondo does not.
      
      Normally register_one_mondo is inlined so the bug doesn't trigger,
      but with some config/compiler combinations, it won't be so we
      must properly mark it notrace.
      
      While we're here, add 'notrace' annoations to prom_printf and
      prom_halt so that early error handling won't have the same problem.
      Reported-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
      Reported-by: default avatarLeif Sawyer <lsawyer@gci.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      eb2bbea7
    • David S. Miller's avatar
      sparc64: Validate linear D-TLB misses. · db945b99
      David S. Miller authored
      [ Upstream commit d8ed1d43
      
       ]
      
      When page alloc debugging is not enabled, we essentially accept any
      virtual address for linear kernel TLB misses.  But with kgdb, kernel
      address probing, and other facilities we can try to access arbitrary
      crap.
      
      So, make sure the address we miss on will translate to physical memory
      that actually exists.
      
      In order to make this work we have to embed the valid address bitmap
      into the kernel image.  And in order to make that less expensive we
      make an adjustment, in that the max physical memory address is
      decreased to "1 << 41", even on the chips that support a 42-bit
      physical address space.  We can do this because bit 41 indicates
      "I/O space" and thus covers non-memory ranges.
      
      The result of this is that:
      
      1) kpte_linear_bitmap shrinks from 2K to 1K in size
      
      2) we need 64K more for the valid address bitmap
      
      We can't let the valid address bitmap be dynamically allocated
      once we start using it to validate TLB misses, otherwise we have
      crazy issues to deal with wrt. recursive TLB misses and such.
      
      If we're in a TLB miss it could be the deepest trap level that's legal
      inside of the cpu.  So if we TLB miss referencing the bitmap, the cpu
      will be out of trap levels and enter RED state.
      
      To guard against out-of-range accesses to the bitmap, we have to check
      to make sure no bits in the physical address above bit 40 are set.  We
      could export and use last_valid_pfn for this check, but that's just an
      unnecessary extra memory reference.
      
      On the plus side of all this, since we load all of these translations
      into the special 4MB mapping TSB, and we check the TSB first for TLB
      misses, there should be absolutely no real cost for these new checks
      in the TLB miss path.
      
      Reported-by: heyongli@gmail.com
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      db945b99
    • David S. Miller's avatar
      sparc64: Kill spurious NMI watchdog triggers by increasing limit to 30 seconds. · 5522658d
      David S. Miller authored
      [ Upstream commit e6617c6e
      
       ]
      
      This is a compromise and a temporary workaround for bootup NMI
      watchdog triggers some people see with qla2xxx devices present.
      
      This happens when, for example:
      
      CPU 0 is in the driver init and looping submitting mailbox commands to
      load the firmware, then waiting for completion.
      
      CPU 1 is receiving the device interrupts.  CPU 1 is where the NMI
      watchdog triggers.
      
      CPU 0 is submitting mailbox commands fast enough that by the time CPU
      1 returns from the device interrupt handler, a new one is pending.
      This sequence runs for more than 5 seconds.
      
      The problematic case is CPU 1's timer interrupt running when the
      barrage of device interrupts begin.  Then we have:
      
      	timer interrupt
      	return for softirq checking
      	pending, thus enable interrupts
      
      		 qla2xxx interrupt
      		 return
      		 qla2xxx interrupt
      		 return
      		 ... 5+ seconds pass
      		 final qla2xxx interrupt for fw load
      		 return
      
      	run timer softirq
      	return
      
      At some point in the multi-second qla2xxx interrupt storm we trigger
      the NMI watchdog on CPU 1 from the NMI interrupt handler.
      
      The timer softirq, once we get back to running it, is smart enough to
      run the timer work enough times to make up for the missed timer
      interrupts.
      
      However, the NMI watchdogs (both x86 and sparc) use the timer
      interrupt count to notice the cpu is wedged.  But in the above
      scenerio we'll receive only one such timer interrupt even if we last
      all the way back to running the timer softirq.
      
      The default watchdog trigger point is only 5 seconds, which is pretty
      low (the softwatchdog triggers at 60 seconds).  So increase it to 30
      seconds for now.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5522658d
    • Eric Dumazet's avatar
      net: net_assign_generic() fix · 461eca1d
      Eric Dumazet authored
      [ Upstream commit 14458630
      
       ]
      
      memcpy() should take into account size of pointers,
      not only number of pointers to copy.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Acked-by: default avatarPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      461eca1d
    • Eric Dumazet's avatar
      pppol2tp: calls unregister_pernet_gen_device() at unload time · bcb9e524
      Eric Dumazet authored
      [ Upstream commit 446e72f3
      
       ]
      
      Failure to call unregister_pernet_gen_device() can exhaust memory
      if module is loaded/unloaded many times.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Acked-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      bcb9e524
    • Ben McKeegan's avatar
      ppp: fix lost fragments in ppp_mp_explode() (resubmit) · 0f316c42
      Ben McKeegan authored
      [ Upstream commit a53a8b56 ]
      
      This patch fixes the corner cases where the sum of MTU of the free
      channels (adjusted for fragmentation overheads) is less than the MTU
      of PPP link.  There are at least 3 situations where this case might
      arise:
      
      - some of the channels are busy
      
      - the multilink session is running in a degraded state (i.e. with less
      than its full complement of active channels)
      
      - by design, where multilink protocol is being used to artificially
      increase the effective link MTU of a single link.
      
      Without this patch, at most 1 fragment is ever sent per free channel
      for a given PPP frame and any remaining part of the PPP frame that
      does not fit into those fragments is silently discarded.
      
      This patch restores the original behaviour which was broken by commit
      9c705260
      
       'ppp:ppp_mp_explode()
      redesign'.  Once all 'free' channels have been given a fragment, an
      additional fragment is queued to each available channel in turn, as many
      times as necessary, until the entire PPP frame has been consumed.
      Signed-off-by: default avatarBen McKeegan <ben@netservers.co.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0f316c42
    • Tom Goff's avatar
      gre: Fix MTU calculation for bound GRE tunnels · f94cae42
      Tom Goff authored
      [ Upstream commit 8cdb0456 ]
      
      The GRE header length should be subtracted when the tunnel MTU is
      calculated.  This just corrects for the associativity change
      introduced by commit 42aa9162
      
      
      ("gre: Move MTU setting out of ipgre_tunnel_bind_dev").
      Signed-off-by: default avatarTom Goff <thomas.goff@boeing.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f94cae42
    • Krzysztof Hałasa's avatar
      E100: fix interaction with swiotlb on X86. · 4d422a05
      Krzysztof Hałasa authored
      [ Upstream commit 6ff9c2e7
      
       ]
      
      E100 places it's RX packet descriptors inside skb->data and uses them
      with bidirectional streaming DMA mapping. Data in descriptors is
      accessed simultaneously by the chip (writing status and size when
      a packet is received) and CPU (reading to check if the packet was
      received). This isn't a valid usage of PCI DMA API, which requires use
      of the coherent (consistent) memory for such purpose. Unfortunately e100
      chips working in "simplified" RX mode have to store received data
      directly after the descriptor. Fixing the driver to conform to the API
      would require using unsupported "flexible" RX mode or receiving data
      into a coherent memory and using CPU to copy it to network buffers.
      
      This patch, while not yet making the driver conform to the PCI DMA API,
      allows it to work correctly on X86 with swiotlb (while not breaking
      other architectures).
      Signed-off-by: default avatarKrzysztof Hałasa <khc@pm.waw.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4d422a05
    • Wei Yongjun's avatar
      dccp: missing destroy of percpu counter variable while unload module · 64a0893c
      Wei Yongjun authored
      [ Upstream commit 476181cb
      
       ]
      
      percpu counter dccp_orphan_count is init in dccp_init() by
      percpu_counter_init() while dccp module is loaded, but the
      destroy of it is missing while dccp module is unloaded. We
      can get the kernel WARNING about this. Reproduct by the
      following commands:
      
        $ modprobe dccp
        $ rmmod dccp
        $ modprobe dccp
      
      WARNING: at lib/list_debug.c:26 __list_add+0x27/0x5c()
      Hardware name: VMware Virtual Platform
      list_add corruption. next->prev should be prev (c080c0c4), but was (null). (next
      =ca7188cc).
      Modules linked in: dccp(+) nfsd lockd nfs_acl auth_rpcgss exportfs sunrpc
      Pid: 1956, comm: modprobe Not tainted 2.6.31-rc5 #55
      Call Trace:
       [<c042f8fa>] warn_slowpath_common+0x6a/0x81
       [<c053a6cb>] ? __list_add+0x27/0x5c
       [<c042f94f>] warn_slowpath_fmt+0x29/0x2c
       [<c053a6cb>] __list_add+0x27/0x5c
       [<c053c9b3>] __percpu_counter_init+0x4d/0x5d
       [<ca9c90c7>] dccp_init+0x19/0x2ed [dccp]
       [<c0401141>] do_one_initcall+0x4f/0x111
       [<ca9c90ae>] ? dccp_init+0x0/0x2ed [dccp]
       [<c06971b5>] ? notifier_call_chain+0x26/0x48
       [<c0444943>] ? __blocking_notifier_call_chain+0x45/0x51
       [<c04516f7>] sys_init_module+0xac/0x1bd
       [<c04028e4>] sysenter_do_call+0x12/0x22
      Signed-off-by: default avatarWei Yongjun <yjwei@cn.fujitsu.com>
      Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      64a0893c
  2. 09 Sep, 2009 17 commits