13 years agomd: Protect access to mddev->disks list using RCU
NeilBrown [Mon, 21 Jul 2008 07:05:25 +0000 (17:05 +1000)]
md: Protect access to mddev->disks list using RCU

All modifications and most access to the mddev->disks list are made
under the reconfig_mutex lock.  However there are three places where
the list is walked without any locking.  If a reconfig happens at this
time, havoc (and oops) can ensue.

So use RCU to protect these accesses:
  - wrap them in rcu_read_{,un}lock()
  - use list_for_each_entry_rcu
  - add to the list with list_add_rcu
  - delete from the list with list_del_rcu
  - delay the 'free' with call_rcu rather than schedule_work

Note that export_rdev did a list_del_init on this list.  In almost all
cases the entry was not in the list anymore so it was a no-op and so
safe.  It is no longer safe as after list_del_rcu we may not touch
the list_head.
An audit shows that export_rdev is called:
  - after unbind_rdev_from_array, in which case the delete has
     already been done,
  - after bind_rdev_to_array fails, in which case the delete isn't needed.
  - before the device has been put on a list at all (e.g. in
      add_new_disk where reading the superblock fails).
  - and in autorun devices after a failure when the device is on a
      different list.

So remove the list_del_init call from export_rdev, and add it back
immediately before the called to export_rdev for that last case.

Note also that ->same_set is sometimes used for lists other than
mddev->list (e.g. candidates).  In these cases rcu is not needed.

Signed-off-by: NeilBrown <>
13 years agomd: only count actual openers as access which prevent a 'stop'
NeilBrown [Mon, 21 Jul 2008 07:05:25 +0000 (17:05 +1000)]
md: only count actual openers as access which prevent a 'stop'

Open isn't the only thing that increments ->active.  e.g. reading
/proc/mdstat will increment it briefly.  So to avoid false positives
in testing for concurrent access, introduce a new counter that counts
just the number of times the md device it open.

Signed-off-by: NeilBrown <>
13 years agomd: linear: Make array_size sector-based and rename it to array_sectors.
Andre Noll [Mon, 21 Jul 2008 07:05:25 +0000 (17:05 +1000)]
md: linear: Make array_size sector-based and rename it to array_sectors.

Signed-off-by: Andre Noll <>
Signed-off-by: NeilBrown <>
13 years agomd: Make mddev->array_size sector-based.
Andre Noll [Mon, 21 Jul 2008 07:05:22 +0000 (17:05 +1000)]
md: Make mddev->array_size sector-based.

This patch renames the array_size field of struct mddev_s to array_sectors
and converts all instances to use units of 512 byte sectors instead of 1k

Signed-off-by: Andre Noll <>
Signed-off-by: NeilBrown <>
13 years agomd: Make super_type->rdev_size_change() take sector-based sizes.
Andre Noll [Mon, 21 Jul 2008 04:42:12 +0000 (14:42 +1000)]
md: Make super_type->rdev_size_change() take sector-based sizes.

Also, change the type of the size parameter from unsigned long long to
sector_t and rename it to num_sectors.

Signed-off-by: Andre Noll <>
Signed-off-by: NeilBrown <>
13 years agomd: Fix check for overlapping devices.
Andre Noll [Mon, 21 Jul 2008 04:42:07 +0000 (14:42 +1000)]
md: Fix check for overlapping devices.

The checks in overlaps() expect all parameters either in block-based
or sector-based quantities. However, its single caller passes two
rdev->data_offset arguments as well as two rdev->size arguments, the
former being sector counts while the latter are measured in 1K blocks.

This could cause rdev_size_store() to accept an invalid size from user
space. Fix it by passing only sector-based quantities to overlaps().

Signed-off-by: Andre Noll <>
Signed-off-by: NeilBrown <>
13 years agomd: Tidy up rdev_size_store a bit:
Neil Brown [Sat, 12 Jul 2008 00:37:50 +0000 (10:37 +1000)]
md: Tidy up rdev_size_store a bit:

 - used strict_strtoull in place of simple_strtoull
 - use my_mddev in place of rdev->mddev (they have the same value)
and more significantly,
 - don't adjust mddev->size to fit, rather reject changes which make
   rdev->size smaller than mddev->size

Adjusting mddev->size is a hangover from bind_rdev_to_array which
does a similar thing.  But it really is a better design to insist that
mddev->size is set as required, then the rdev->sizes are set to allow
for that.  The previous way invites confusion.

Signed-off-by: NeilBrown <>
13 years agomd: Remove some unused macros.
Andre Noll [Fri, 11 Jul 2008 12:02:23 +0000 (22:02 +1000)]
md: Remove some unused macros.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: Turn rdev->sb_offset into a sector-based quantity.
Andre Noll [Fri, 11 Jul 2008 12:02:23 +0000 (22:02 +1000)]
md: Turn rdev->sb_offset into a sector-based quantity.

Rename it to sb_start to make sure all users have been converted.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: Make calc_dev_sboffset() return a sector count.
Andre Noll [Fri, 11 Jul 2008 12:02:23 +0000 (22:02 +1000)]
md: Make calc_dev_sboffset() return a sector count.

As BLOCK_SIZE_BITS is 10 and


the return value of calc_dev_sboffset() doubles. Fix up all three
callers accordingly.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: Replace calc_dev_size() by calc_num_sectors().
Andre Noll [Fri, 11 Jul 2008 12:02:23 +0000 (22:02 +1000)]
md: Replace calc_dev_size() by calc_num_sectors().

Number of sectors is the preferred unit for sizes of raid devices,
so change calc_dev_size() so that it returns this unit instead of
the number of 1K blocks.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: Make update_size() take the number of sectors.
Andre Noll [Fri, 11 Jul 2008 12:02:22 +0000 (22:02 +1000)]
md: Make update_size() take the number of sectors.

Changing the internal representations of sizes of raid devices
from 1K blocks to sector counts (512B units) is desirable because
it allows to get rid of many divisions/multiplications and unnecessary
casts that are present in the current code.

This patch is a first step in this direction. It replaces the old
1K-based "size" argument of update_size() by "num_sectors" and
fixes up its two callers.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: Better control of when do_md_stop is allowed to stop the array.
Neil Brown [Fri, 11 Jul 2008 12:02:22 +0000 (22:02 +1000)]
md: Better control of when do_md_stop is allowed to stop the array.

do_md_stop check the number of active users before allowing the array
to be stopped.
Two problems:
  1/ it assumes the request is coming through an open file descriptor
     (via ioctl) so it allows for that.  This is not always the case.
  2/ it doesn't do the check it the array hasn't been activated.
     This is not good for cases when we use an inactive array to hold
     some devices in a container.

Signed-off-by: Neil Brown <>
13 years agomd: get_disk_info(): Don't convert between signed and unsigned and back.
Andre Noll [Fri, 11 Jul 2008 12:02:21 +0000 (22:02 +1000)]
md: get_disk_info(): Don't convert between signed and unsigned and back.

The current code copies a signed int from user space, converts it to
unsigned and passes the unsigned value to find_rdev_nr() which expects
a signed value. Simply pass the signed value from user space directly.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: Simplify restart_array().
Andre Noll [Fri, 11 Jul 2008 12:02:21 +0000 (22:02 +1000)]
md: Simplify restart_array().

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: alloc_disk_sb(): Return proper error value.
Andre Noll [Fri, 11 Jul 2008 12:02:20 +0000 (22:02 +1000)]
md: alloc_disk_sb(): Return proper error value.

If alloc_page() fails, ENOMEM is a more suitable error value
than EINVAL.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: Simplify sb_equal().
Andre Noll [Fri, 11 Jul 2008 12:02:20 +0000 (22:02 +1000)]
md: Simplify sb_equal().

The only caller of sb_equal() tests the return value against
zero, so it's OK to return the negated return value of memcmp().

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: Simplify uuid_equal().
Andre Noll [Fri, 11 Jul 2008 12:02:20 +0000 (22:02 +1000)]
md: Simplify uuid_equal().

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agoMerge branch 'master' into for-next
Neil Brown [Fri, 11 Jul 2008 11:57:40 +0000 (21:57 +1000)]
Merge branch 'master' into for-next

13 years agoMerge git://
Linus Torvalds [Fri, 11 Jul 2008 00:58:47 +0000 (17:58 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git:// (27 commits)
  tun: Persistent devices can get stuck in xoff state
  xfrm: Add a XFRM_STATE_AF_UNSPEC flag to xfrm_usersa_info
  ipv6: missed namespace context in ipv6_rthdr_rcv
  netlabel: netlink_unicast calls kfree_skb on error path by itself
  ipv4: fib_trie: Fix lookup error return
  tcp: correct kcalloc usage
  ip: sysctl documentation cleanup
  Documentation: clarify tcp_{r,w}mem sysctl docs
  netfilter: nf_nat_snmp_basic: fix a range check in NAT for SNMP
  netfilter: nf_conntrack_tcp: fix endless loop
  libertas: fix memory alignment problems on the blackfin
  zd1211rw: stop beacons on remove_interface
  rt2x00: Disable synchronization during initialization
  rc80211_pid: Fix fast_start parameter handling
  sctp: Add documentation for sctp sysctl variable
  ipv6: fix race between ipv6_del_addr and DAD timer
  irda: Fix netlink error path return value
  irda: New device ID for nsc-ircc
  irda: via-ircc proper dma freeing
  sctp: Mark the tsn as received after all allocations finish

13 years agotun: Persistent devices can get stuck in xoff state
Max Krasnyansky [Thu, 10 Jul 2008 23:59:11 +0000 (16:59 -0700)]
tun: Persistent devices can get stuck in xoff state

The scenario goes like this. App stops reading from tun/tap.
TX queue gets full and driver does netif_stop_queue().
App closes fd and TX queue gets flushed as part of the cleanup.
Next time the app opens tun/tap and starts reading from it but
the xoff state is not cleared. We're stuck.
Normally xoff state is cleared when netdev is brought up. But
in the case of persistent devices this happens only during
initial setup.

The fix is trivial. If device is already up when an app opens
it we clear xoff state and that gets things moving again.

Signed-off-by: Max Krasnyansky <>
Tested-by: Christian Borntraeger <>
Signed-off-by: David S. Miller <>
13 years agoxfrm: Add a XFRM_STATE_AF_UNSPEC flag to xfrm_usersa_info
Steffen Klassert [Thu, 10 Jul 2008 23:55:37 +0000 (16:55 -0700)]
xfrm: Add a XFRM_STATE_AF_UNSPEC flag to xfrm_usersa_info

Add a XFRM_STATE_AF_UNSPEC flag to handle the AF_UNSPEC behavior for
the selector family. Userspace applications can set this flag to leave
the selector family of the xfrm_state unspecified.  This can be used
to to handle inter family tunnels if the selector is not set from

Signed-off-by: Steffen Klassert <>
Acked-by: Herbert Xu <>
Signed-off-by: David S. Miller <>
13 years agoipv6: missed namespace context in ipv6_rthdr_rcv
Denis V. Lunev [Thu, 10 Jul 2008 23:54:50 +0000 (16:54 -0700)]
ipv6: missed namespace context in ipv6_rthdr_rcv

Signed-off-by: Denis V. Lunev <>
Signed-off-by: David S. Miller <>
13 years agonetlabel: netlink_unicast calls kfree_skb on error path by itself
Denis V. Lunev [Thu, 10 Jul 2008 23:53:39 +0000 (16:53 -0700)]
netlabel: netlink_unicast calls kfree_skb on error path by itself

So, no need to kfree_skb here on the error path. In this case we can
simply return.

Signed-off-by: Denis V. Lunev <>
Acked-by: Paul Moore <>
Signed-off-by: David S. Miller <>
13 years agoipv4: fib_trie: Fix lookup error return
Ben Hutchings [Thu, 10 Jul 2008 23:52:52 +0000 (16:52 -0700)]
ipv4: fib_trie: Fix lookup error return

In commit a07f5f508a4d9728c8e57d7f66294bf5b254ff7f "[IPV4] fib_trie: style
cleanup", the changes to check_leaf() and fn_trie_lookup() were wrong - where
fn_trie_lookup() would previously return a negative error value from
check_leaf(), it now returns 0.

Now fn_trie_lookup() doesn't appear to care about plen, so we can revert
check_leaf() to returning the error value.

Signed-off-by: Ben Hutchings <>
Tested-by: William Boughton <>
Acked-by: Stephen Heminger <>
Signed-off-by: David S. Miller <>
13 years agotcp: correct kcalloc usage
Milton Miller [Thu, 10 Jul 2008 23:51:32 +0000 (16:51 -0700)]
tcp: correct kcalloc usage

kcalloc is supposed to be called with the count as its first argument and
the element size as the second.

Signed-off-by: Milton Miller <>
Signed-off-by: David S. Miller <>
13 years agoip: sysctl documentation cleanup
Stephen Hemminger [Thu, 10 Jul 2008 23:50:26 +0000 (16:50 -0700)]
ip: sysctl documentation cleanup

Reduced version of the spelling cleanup patch.

Take out the confusing language in tcp_frto, and organize the
undocumented values.

Signed-off-by: Stephen Hemminger <>
Acked-by: Randy Dunlap <>
Signed-off-by: David S. Miller <>
13 years agoDocumentation: clarify tcp_{r,w}mem sysctl docs
J. Bruce Fields [Thu, 10 Jul 2008 23:47:41 +0000 (16:47 -0700)]
Documentation: clarify tcp_{r,w}mem sysctl docs

Fix some of the defaults and attempt to clarify some language.

Signed-off-by: J. Bruce Fields <>
Signed-off-by: David S. Miller <>
13 years agoslub: Fix use-after-preempt of per-CPU data structure
Dmitry Adamushko [Thu, 10 Jul 2008 20:21:58 +0000 (22:21 +0200)]
slub: Fix use-after-preempt of per-CPU data structure

Vegard Nossum reported a crash in kmem_cache_alloc():

BUG: unable to handle kernel paging request at da87d000
IP: [<c01991c7>] kmem_cache_alloc+0xc7/0xe0
*pde = 28180163 *pte = 1a87d160
Pid: 3850, comm: grep Not tainted (2.6.26-rc9-00059-gb190333 #5)
EIP: 0060:[<c01991c7>] EFLAGS: 00210203 CPU: 0
EIP is at kmem_cache_alloc+0xc7/0xe0
EAX: 00000000 EBX: da87c100 ECX: 1adad71a EDX: 6b6b6b6b
ESI: 00200282 EDI: da87d000 EBP: f60bfe74 ESP: f60bfe54
DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068

and analyzed it:

  "The register %ecx looks innocent but is very important here. The disassembly:

       mov    %edx,%ecx
       shr    $0x2,%ecx
       rep stos %eax,%es:(%edi) <-- the fault

   So %ecx has been loaded from %edx... which is 0x6b6b6b6b/POISON_FREE.
   (0x6b6b6b6b >> 2 == 0x1adadada.)

   %ecx is the counter for the memset, from here:

       memset(object, 0, c->objsize);

  i.e. %ecx was loaded from c->objsize, so "c" must have been freed.
  Where did "c" come from? Uh-oh...

       c = get_cpu_slab(s, smp_processor_id());

  This looks like it has very much to do with CPU hotplug/unplug. Is
  there a race between SLUB/hotplug since the CPU slab is used after it
  has been freed?"

Good analysis.

Yeah, it's possible that a caller of kmem_cache_alloc() -> slab_alloc()
can be migrated on another CPU right after local_irq_restore() and
before memset().  The inital cpu can become offline in the mean time (or
a migration is a consequence of the CPU going offline) so its
'kmem_cache_cpu' structure gets freed ( slab_cpuup_callback).

At some point of time the caller continues on another CPU having an
obsolete pointer...

Signed-off-by: Dmitry Adamushko <>
Reported-by: Vegard Nossum <>
Acked-by: Ingo Molnar <>
Signed-off-by: Linus Torvalds <>
13 years agoexec: fix stack excutability without PT_GNU_STACK
Hugh Dickins [Thu, 10 Jul 2008 20:19:20 +0000 (21:19 +0100)]
exec: fix stack excutability without PT_GNU_STACK

Kernel Bugzilla #11063 points out that on some architectures (e.g. x86_32)
exec'ing an ELF without a PT_GNU_STACK program header should default to an
executable stack; but this got broken by the unlimited argv feature because
stack vma is now created before the right personality has been established:
so breaking old binaries using nested function trampolines.

Therefore re-evaluate VM_STACK_FLAGS in setup_arg_pages, where stack
vm_flags used to be set, before the mprotect_fixup.  Checking through
our existing VM_flags, none would have changed since insert_vm_struct:
so this seems safer than finding a way through the personality labyrinth.

Signed-off-by: Hugh Dickins <>
Signed-off-by: Linus Torvalds <>
13 years agoMerge branch 'upstream-linus' of git://
Linus Torvalds [Thu, 10 Jul 2008 20:11:01 +0000 (13:11 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://
  ocfs2: Fix flags in ocfs2_file_lock

13 years agoMerge branch 'sched-fixes-for-linus' of git://
Linus Torvalds [Thu, 10 Jul 2008 19:34:55 +0000 (12:34 -0700)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://
  sched: fix cpu hotplug, cleanup
  sched: fix cpu hotplug

13 years agosched: fix cpu hotplug, cleanup
Linus Torvalds [Thu, 10 Jul 2008 18:25:03 +0000 (11:25 -0700)]
sched: fix cpu hotplug, cleanup

Clean up __migrate_task(): to just have separate "done" and "fail"
cases, instead of that "out" case with random error behavior.

Signed-off-by: Ingo Molnar <>
13 years agoMerge branch 'x86-fixes-for-linus' of git://
Linus Torvalds [Thu, 10 Jul 2008 18:19:53 +0000 (11:19 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://
  x86: fix /dev/mem compatibility under PAT

13 years agoFix PREEMPT_RCU without HOTPLUG_CPU
Nick Piggin [Thu, 10 Jul 2008 07:25:35 +0000 (17:25 +1000)]

PREEMPT_RCU without HOTPLUG_CPU is broken.  The rcu_online_cpu is called
to initially populate rcu_cpu_online_map with all online CPUs when the
hotplug event handler is installed, and also to populate the map with
CPUs as they come online.  The former case is meant to happen with and
without HOTPLUG_CPU, but without HOTPLUG_CPU, the rcu_offline_cpu
function is no-oped -- while it still gets called, it does not set the
rcu CPU map.

With a blank RCU CPU map, grace periods get to tick by completely
oblivious to active RCU read side critical sections.  This results in
free-before-grace bugs.

Fix is obvious once the problem is known. (Also, change __devinit to
__cpuinit so the function gets thrown away on !HOTPLUG_CPU kernels).

Signed-off-by: Nick Piggin <>
Reported-and-tested-by: Alexey Dobriyan <>
Acked-by: Ingo Molnar <>
Cc: Paul E. McKenney <>
[ Nick is my personal hero of the day - Linus ]
Signed-off-by: Linus Torvalds <>
13 years agoftrace: Documentation
Steven Rostedt [Thu, 10 Jul 2008 16:46:01 +0000 (12:46 -0400)]
ftrace: Documentation

This is the long awaited ftrace.txt. It explains in quite detail how to
use ftrace and the various tracers.

Signed-off-by: Steven Rostedt <>
Signed-off-by: Linus Torvalds <>
13 years agoarch/x86/kernel/.gitignore: Added to .gitignore file because it shouldn...
Daniel Guilak [Thu, 10 Jul 2008 16:39:32 +0000 (09:39 -0700)]
arch/x86/kernel/.gitignore: Added to .gitignore file because it shouldn't be tracked.

Signed-off-by: Daniel Guilak <>
Signed-off-by: Linus Torvalds <>
13 years agokernel/kprobes.c: Made kprobe_blacklist static.
Daniel Guilak [Thu, 10 Jul 2008 16:38:19 +0000 (09:38 -0700)]
kernel/kprobes.c: Made kprobe_blacklist static.

Signed-off-by: Daniel Guilak <>
Signed-off-by: Linus Torvalds <>
13 years agoMerge git://
Linus Torvalds [Thu, 10 Jul 2008 17:10:02 +0000 (10:10 -0700)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://
  crypto: chainiv - Invoke completion function

13 years agoMerge branch 'for-2.6.26' of git://
Linus Torvalds [Thu, 10 Jul 2008 16:49:46 +0000 (09:49 -0700)]
Merge branch 'for-2.6.26' of git://

* 'for-2.6.26' of git://
  md: ensure all blocks are uptodate or locked when syncing

13 years agoocfs2: Fix flags in ocfs2_file_lock
Mark Fasheh [Thu, 10 Jul 2008 16:25:39 +0000 (09:25 -0700)]
ocfs2: Fix flags in ocfs2_file_lock

The stack-glue merge changed the way we use flags in dlmglue in that we now
use the fs/dlm equivalents. Unfortunately, a merge error left the new flock
code only partially updated. This took a while to show up though, because
the lock level constants are actually identical between o2dlm and fs/dlm.
The *_CONVERT and *_NOQUEUE flags have different values though, which is
eventually causing a crash in flags_to_o2dlm().

Signed-off-by: Mark Fasheh <>
13 years agocrypto: chainiv - Invoke completion function
Herbert Xu [Thu, 10 Jul 2008 09:42:36 +0000 (17:42 +0800)]
crypto: chainiv - Invoke completion function

When chainiv postpones requests it never calls their completion functions.
This causes symptoms such as memory leaks when IPsec is in use.

Signed-off-by: Herbert Xu <>
13 years agox86: fix /dev/mem compatibility under PAT
Venkatesh Pallipadi [Thu, 10 Jul 2008 08:09:59 +0000 (10:09 +0200)]
x86: fix /dev/mem compatibility under PAT

Add ioremap_default(), which gives a sane mapping without worrying about
type conflicts.

Use it in /dev/mem read in place of ioremap(), as with ioremap(),
any mapping of the region (other than UC_MINUS) will cause a conflict
and failure of /dev/mem read.

Should address the vbetest failure reported at:

Signed-off-by: Venkatesh Pallipadi <>
Signed-off-by: Ingo Molnar <>
13 years agosched: fix cpu hotplug
Dmitry Adamushko [Wed, 9 Jul 2008 22:32:40 +0000 (00:32 +0200)]
sched: fix cpu hotplug

I think we may have a race between try_to_wake_up() and
migrate_live_tasks() -> move_task_off_dead_cpu() when the later one
may end up looping endlessly.

Interrupts are enabled on other CPUs when migration_call(CPU_DEAD, ...) is
called so we may get a race between try_to_wake_up() and
migrate_live_tasks() -> move_task_off_dead_cpu(). The former one may push
a task out of a dead CPU causing the later one to loop endlessly.

Heiko Carstens observed:

| That's exactly what explains a dump I got yesterday. Thanks for fixing! :)

Signed-off-by: Dmitry Adamushko <>
Cc: Lai Jiangshan <>
Cc: Heiko Carstens <>
Cc: Peter Zijlstra <>
Cc: Avi Kivity <>
Cc: Andrew Morton <>
Signed-off-by: Ingo Molnar <>
13 years agoMerge branch 'for-2.6.26' into for-next
Neil Brown [Thu, 10 Jul 2008 06:51:26 +0000 (16:51 +1000)]
Merge branch 'for-2.6.26' into for-next



13 years agomd: ensure all blocks are uptodate or locked when syncing
Dan Williams [Thu, 10 Jul 2008 11:54:57 +0000 (04:54 -0700)]
md: ensure all blocks are uptodate or locked when syncing

Remove the dubious attempt to prefer 'compute' over 'read'.  Not only is it
wrong given commit c337869d (md: do not compute parity unless it is on a failed
drive), but it can trigger a BUG_ON in handle_parity_checks5().

Cc: <>
Signed-off-by: Dan Williams <>
Signed-off-by: Neil Brown <>
13 years agoMerge branch 'master' of git://
David S. Miller [Wed, 9 Jul 2008 22:10:09 +0000 (15:10 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

13 years agonetfilter: nf_nat_snmp_basic: fix a range check in NAT for SNMP
David Howells [Wed, 9 Jul 2008 22:06:45 +0000 (15:06 -0700)]
netfilter: nf_nat_snmp_basic: fix a range check in NAT for SNMP

Fix a range check in netfilter IP NAT for SNMP to always use a big enough size
variable that the compiler won't moan about comparing it to ULONG_MAX/8 on a
64-bit platform.

Signed-off-by: David Howells <>
Signed-off-by: Patrick McHardy <>
Signed-off-by: David S. Miller <>
13 years agonetfilter: nf_conntrack_tcp: fix endless loop
Patrick McHardy [Wed, 9 Jul 2008 22:06:12 +0000 (15:06 -0700)]
netfilter: nf_conntrack_tcp: fix endless loop

When a conntrack entry is destroyed in process context and destruction
is interrupted by packet processing and the packet is an attempt to
reopen a closed connection, TCP conntrack tries to kill the old entry
itself and returns NF_REPEAT to pass the packet through the hook
again. This may lead to an endless loop: TCP conntrack repeatedly
finds the old entry, but can not kill it itself since destruction
is already in progress, but destruction in process context can not
complete since TCP conntrack is keeping the CPU busy.

Drop the packet in TCP conntrack if we can't kill the connection
ourselves to avoid this.

Reported by: [ Kernel bugzilla #11058 ]
Signed-off-by: Patrick McHardy <>
Signed-off-by: David S. Miller <>
13 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Wed, 9 Jul 2008 21:16:23 +0000 (14:16 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://
  RDMA/cxgb3: Fix regression caused by class_device -> device conversion

13 years agolibertas: fix memory alignment problems on the blackfin
Ihar Hrachyshka [Wed, 9 Jul 2008 06:29:58 +0000 (09:29 +0300)]
libertas: fix memory alignment problems on the blackfin

Fixing unaligned memory access on the blackfin architecture.

Signed-off-by: Ihar Hrachyshka <>
Signed-off-by: John W. Linville <>
13 years agozd1211rw: stop beacons on remove_interface
Luis Carlos Cobo [Tue, 8 Jul 2008 14:19:21 +0000 (16:19 +0200)]
zd1211rw: stop beacons on remove_interface

If a mesh or ad-hoc interface is brought up and later it is replaced
by managed interface, the managed interface will keep transmitting
the beacons that were configured for the former interface. This patch
fixes that behaviour.

Signed-off-by: John W. Linville <>
13 years agort2x00: Disable synchronization during initialization
Ivo van Doorn [Tue, 8 Jul 2008 11:45:20 +0000 (13:45 +0200)]
rt2x00: Disable synchronization during initialization

As soon as init_registers() was called, the rt2400/rt2500
would start raising beacondone interrupts. Since this is highly
premature since no beacons were provided yet, we should
initialize the synchronization register to 0.

This will make all drivers initialize it to 0 regardless
if they are raising beacondone interrupts or not, since it only
makes sense to have it completely disabled.

Signed-off-by: Ivo van Doorn <>
Signed-off-by: John W. Linville <>
13 years agorc80211_pid: Fix fast_start parameter handling
Mattias Nissler [Mon, 7 Jul 2008 21:08:19 +0000 (23:08 +0200)]
rc80211_pid: Fix fast_start parameter handling

This removes the fast_start parameter from the rc_pid parameters
information and instead uses the parameter macro when initializing
the rc_pid state. Since the parameter is only used on initialization,
there is no point of making exporting it via debugfs. This also fixes
uninitialized memory references to the fast_start and norm_offset
parameters detected by the kmemcheck utility.  Thanks to Vegard Nossum
for reporting the bug.

Signed-off-by: Mattias Nissler <>
Signed-off-by: John W. Linville <>
13 years agoMerge branch 'upstream-linus' of git://
Linus Torvalds [Wed, 9 Jul 2008 04:48:26 +0000 (21:48 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://
  [PATCH] ocfs2/dlm: Fixes oops in dlm_new_lockres()

13 years agopowerpc: Add missing reference to coherent_dma_mask
Vitaly Bordug [Wed, 9 Jul 2008 03:13:38 +0000 (13:13 +1000)]
powerpc: Add missing reference to coherent_dma_mask

There is dma_mask in of_device upon of_platform_device_create()
but we don't actually set coherent_dma_mask. This may cause weird
behavior of USB subsystem using of_device USB host drivers.

Signed-off-by: Vitaly Bordug <>
Signed-off-by: Benjamin Herrenschmidt <>
Signed-off-by: Linus Torvalds <>
13 years agoMerge git://
Linus Torvalds [Wed, 9 Jul 2008 01:10:51 +0000 (18:10 -0700)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://
  crypto: tcrypt - Fix memory leak in test_cipher

13 years agokernel/printk.c: Made printk_recursion_bug_msg static.
Daniel Guilak [Tue, 8 Jul 2008 22:02:06 +0000 (15:02 -0700)]
kernel/printk.c: Made printk_recursion_bug_msg static.

Signed-off-by: Daniel Guilak <>
Acked-by: Josh Triplett <>
Signed-off-by: Linus Torvalds <>
13 years agosctp: Add documentation for sctp sysctl variable
Vlad Yasevich [Tue, 8 Jul 2008 23:43:29 +0000 (16:43 -0700)]
sctp: Add documentation for sctp sysctl variable

Signed-off-by: Vlad Yasevich <>
Acked-by: Randy Dunlap <>
Signed-off-by: David S. Miller <>
13 years agoipv6: fix race between ipv6_del_addr and DAD timer
Andrey Vagin [Tue, 8 Jul 2008 22:13:31 +0000 (15:13 -0700)]
ipv6: fix race between ipv6_del_addr and DAD timer

Consider the following scenario:

  ipv6_ifa_notify(RTM_DELADDR, ifp)

after returning from the ipv6_ifa_notify and enabling BH-s
back, but *before* calling the addrconf_del_timer the
ifp->timer fires and:

    ipv6_ifa_notify(RTM_NEWADDR, ifp)

then return back to the ipv6_del_addr and:


After this we have an ifp->rt inserted into fib6 lists, but
queued for gc, which in turn can result in oopses in the
fib6_run_gc. Maybe some other nasty things, but we caught
only the oops in gc so far.

The solution is to disarm the ifp->timer before flushing the
rt from it.

Signed-off-by: Andrey Vagin <>
Signed-off-by: Pavel Emelyanov <>
Signed-off-by: David S. Miller <>
13 years agoRDMA/cxgb3: Fix regression caused by class_device -> device conversion
Steve Wise [Tue, 8 Jul 2008 21:40:05 +0000 (14:40 -0700)]
RDMA/cxgb3: Fix regression caused by class_device -> device conversion

The change to iwch_provider.c in commit f4e91eb4 ("IB: convert struct
class_device to struct device") undid the fix done in commit 7f049f2f
("RDMA/cxgb3: Hold rtnl_lock() around ethtool get_drvinfo call").  It
removed the calls to rtnl_lock() that serialized the iw_cxgb3 ethtool
ops calls into the cxgb3 driver.  This locking is needed to avoid
messing up the internal state of the cxgb3 driver.

Signed-off-by: Steve Wise <>
Signed-off-by: Roland Dreier <>
13 years agoFix broken fix for fsl-diu-db
Takashi Iwai [Tue, 8 Jul 2008 16:41:17 +0000 (18:41 +0200)]
Fix broken fix for fsl-diu-db

On 2.6.26-rc9, the commit 05946bce839b4fed5442dbfab77060fb75e051f3
("fsl_diu_fb: fix build with CONFIG_PM=y, plus fix some warnings")
breaks its previous fix f969c5672b16b857e5231ad3c78f08d8ef3305aa
("fsl-diu-db: compile fix")

This patch reverts the broken part.

Signed-off-by: Takashi Iwai <>
Acked-by: Anton Vorontsov <>
Signed-off-by: Linus Torvalds <>
13 years agoMerge branch 'hotfixes' of git://
Linus Torvalds [Tue, 8 Jul 2008 19:40:57 +0000 (12:40 -0700)]
Merge branch 'hotfixes' of git://

* 'hotfixes' of git://
  SUNRPC: Fix an rpcbind breakage for the case of IPv6 lookups
  SUNRPC: Fix a double-free in rpcbind
  NFS: Fix readdir cache invalidation

13 years agoMerge branch 'upstream' of git://
Linus Torvalds [Tue, 8 Jul 2008 19:40:19 +0000 (12:40 -0700)]
Merge branch 'upstream' of git://

* 'upstream' of git://
  [MIPS] Fix 32bit kernels on R4k with 128 byte cache line size
  [MIPS] Atlas, decstation: Fix section mismatches triggered by defconfigs

13 years agoreiserfs: discard prealloc in reiserfs_delete_inode
Jeff Mahoney [Tue, 8 Jul 2008 18:37:06 +0000 (14:37 -0400)]
reiserfs: discard prealloc in reiserfs_delete_inode

With the removal of struct file from the xattr code,
reiserfs_file_release() isn't used anymore, so the prealloc isn't
discarded.  This causes hangs later down the line.

This patch adds it to reiserfs_delete_inode.  In most cases it will be a
no-op due to it already having been called, but will avoid hangs with

Signed-off-by: Jeff Mahoney <>
Signed-off-by: Linus Torvalds <>
13 years agoSUNRPC: Fix an rpcbind breakage for the case of IPv6 lookups
Trond Myklebust [Tue, 1 Jul 2008 19:20:55 +0000 (15:20 -0400)]
SUNRPC: Fix an rpcbind breakage for the case of IPv6 lookups

Now that rpcb_next_version has been split into an IPv4 version and an IPv6
version, we Oops when rpcb_call_async attempts to look up the IPv6-specific
RPC procedure in rpcb_next_version.

Fix the Oops simply by having rpcb_getport_async pass the correct RPC
procedure as an argument.

Signed-off-by: Trond Myklebust <>
13 years agoSUNRPC: Fix a double-free in rpcbind
Trond Myklebust [Mon, 7 Jul 2008 16:18:52 +0000 (12:18 -0400)]
SUNRPC: Fix a double-free in rpcbind

It is wrong to be freeing up the rpcbind arguments if the call to
rpcb_call_async() fails, since they should already have been freed up by

Signed-off-by: Trond Myklebust <>
13 years agoNFS: Fix readdir cache invalidation
Trond Myklebust [Mon, 7 Jul 2008 17:26:10 +0000 (13:26 -0400)]
NFS: Fix readdir cache invalidation

invalidate_inode_pages2_range() takes page offset arguments, not byte

Another thought is that individual pages might perhaps get evicted by VM
pressure, in which case we might perhaps want to re-read not only the
evicted page, but all subsequent pages too (in case the server returns
more/less data per page so that the alignment of the next entry
changes). We should therefore remove the condition that we only do this on

Signed-off-by: Trond Myklebust <>
13 years ago[MIPS] Fix 32bit kernels on R4k with 128 byte cache line size
Thomas Bogendoerfer [Tue, 8 Jul 2008 12:46:34 +0000 (14:46 +0200)]
[MIPS] Fix 32bit kernels on R4k with 128 byte cache line size

The generated copy_page for R4k CPU with a 128 byte cache line size used
Create Dirty Exclusive cache line operations even if only part of the
cache line was filled.  This change avoids generating cache operations,
if only part of the cache line size is copied in one loop. It also
increases the maxmimum loop size, because the generated code even fits
into the available space for r4k CPUs with 128 byte cache line size.

Signed-off-by: Thomas Bogendoerfer <>
Signed-off-by: Ralf Baechle <>
13 years ago[MIPS] Atlas, decstation: Fix section mismatches triggered by defconfigs
Shane McDonald [Sat, 5 Jul 2008 23:19:42 +0000 (17:19 -0600)]
[MIPS] Atlas, decstation: Fix section mismatches triggered by defconfigs

Resolve these mismatches by defining affected functions with the __cpuinit
attribute, rather than __init.

Signed-off-by: Shane McDonald <>
Signed-off-by: Ralf Baechle <>
13 years agoMerge git://
Linus Torvalds [Tue, 8 Jul 2008 18:19:11 +0000 (11:19 -0700)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://
  it8213: fix return value in it8213_init_one()
  palm_bk3710: fix IDECLK period calculation
  ide: add __ide_default_irq() inline helper

13 years agoit8213: fix return value in it8213_init_one()
Bartlomiej Zolnierkiewicz [Tue, 8 Jul 2008 17:27:23 +0000 (19:27 +0200)]
it8213: fix return value in it8213_init_one()

Signed-off-by: Bartlomiej Zolnierkiewicz <>
13 years agopalm_bk3710: fix IDECLK period calculation
Sergei Shtylyov [Tue, 8 Jul 2008 17:27:22 +0000 (19:27 +0200)]
palm_bk3710: fix IDECLK period calculation

The driver uses completely bogus rounding formula for calculating period from
the IDECLK frequency which gives one-off period values (e.g. 11 ns with 100 MHz
IDECLK) which in turn can lead to overclocked IDE transfer timings.  Actually,
rounding is just wrong in this case, so use a mere division for a safe result.

While at it, also:

- give 'ide_palm_clk' variable a more suitable name;

- get rid of the useless 'ideclkp' variable;

- drop the LISP stype 'p' postfix from the 'clkp' variable's name. :-)

Signed-off-by: Sergei Shtylyov <>
Signed-off-by: Bartlomiej Zolnierkiewicz <>
13 years agoide: add __ide_default_irq() inline helper
Bartlomiej Zolnierkiewicz [Tue, 8 Jul 2008 17:27:22 +0000 (19:27 +0200)]
ide: add __ide_default_irq() inline helper

Add __ide_default_irq() inline helper and use it instead of
ide_default_irq() in ide-probe.c and ns87415.c (all host drivers
except IDE PCI ones always setup hwif->irq so it is enough to
check only for I/O bases 0x1f0 and 0x170).

This fixes post-2.6.25 regression since ide_default_irq()
define could shadow ide_default_irq() inline.

Signed-off-by: Bartlomiej Zolnierkiewicz <>
13 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Tue, 8 Jul 2008 16:29:34 +0000 (09:29 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  [S390] protect _PAGE_SPECIAL bit against mprotect

13 years agoCorrect hash flushing from huge_ptep_set_wrprotect()
David Gibson [Tue, 8 Jul 2008 05:58:16 +0000 (15:58 +1000)]
Correct hash flushing from huge_ptep_set_wrprotect()

As Andy Whitcroft recently pointed out, the current powerpc version of
huge_ptep_set_wrprotect() has a bug.  It just calls ptep_set_wrprotect()
which in turn calls pte_update() then hpte_need_flush() with the 'huge'
argument set to 0.  This will cause hpte_need_flush() to flush the wrong
hash entries (of any).  Andy's fix for this is already in the powerpc
tree as commit 016b33c4958681c24056abed8ec95844a0da80a3.

I have confirmed this is a real bug, not masked by some other
synchronization, with a new testcase for libhugetlbfs.  A process write
a (MAP_PRIVATE) hugepage mapping, fork(), then alter the mapping and
have the child incorrectly see the second write.

Therefore, this should be fixed for 2.6.26, and for the stable tree.
Here is a suitable patch for 2.6.26, which I think will also be suitable
for the stable tree (neither of the headers in question has been changed
much recently).

It is cut down slighlty from Andy's original version, in that it does
not include a 32-bit version of huge_ptep_set_wrprotect().  Currently,
hugepages are not supported on any 32-bit powerpc platform.  When they
are, a suitable 32-bit version can be added - the only 32-bit hardware
which supports hugepages does not use the conventional hashtable MMU and
so will have different needs anyway.

Signed-off-by: Andy Whitcroft <>
Signed-off-by: David Gibson <>
Signed-off-by: Benjamin Herrenschmidt <>
Signed-off-by: Linus Torvalds <>
13 years agoirda: Fix netlink error path return value
Julius Volz [Tue, 8 Jul 2008 10:07:43 +0000 (03:07 -0700)]
irda: Fix netlink error path return value

Fix an incorrect return value check of genlmsg_put() in irda_nl_get_mode().
genlmsg_put() does not use ERR_PTR() to encode return values, it just
returns NULL on error.

Signed-off-by: Julius Volz <>
Signed-off-by: Samuel Ortiz <>
Signed-off-by: David S. Miller <>
13 years agoirda: New device ID for nsc-ircc
Ville Syrjala [Tue, 8 Jul 2008 10:07:16 +0000 (03:07 -0700)]
irda: New device ID for nsc-ircc

HP OmniBook 500's DSDT code changes the HID of the FIR device from
NSC6001 to HWPC224 when run under an "NT" operating system. Add the
new ID to the pnp device id table.

Signed-off-by: Ville Syrjala <>
Signed-off-by: Samuel Ortiz <>
Signed-off-by: David S. Miller <>
13 years agoirda: via-ircc proper dma freeing
Wang Chen [Tue, 8 Jul 2008 10:06:46 +0000 (03:06 -0700)]
irda: via-ircc proper dma freeing

1. dma should be freed when dma2 request fail.
2. dma2 should be freed too when device close.

Signed-off-by: Wang Chen <>
Signed-off-by: Samuel Ortiz <>
Signed-off-by: David S. Miller <>
13 years ago[S390] protect _PAGE_SPECIAL bit against mprotect
Nick Piggin [Tue, 8 Jul 2008 09:31:06 +0000 (11:31 +0200)]
[S390] protect _PAGE_SPECIAL bit against mprotect

Stop mprotect's pte_modify from wiping out the s390 pte_special bit, which
caused oops thereafter when vm_normal_page thought X's abnormal was normal.

Debugged-by: Ryan Hope <>
Debugged-by: Zan Lynx <>
Acked-by: Hugh Dickins <>
Signed-off-by: Nick Piggin <>
Signed-off-by: Martin Schwidefsky <>
13 years agosctp: Mark the tsn as received after all allocations finish
Vlad Yasevich [Tue, 8 Jul 2008 09:28:39 +0000 (02:28 -0700)]
sctp: Mark the tsn as received after all allocations finish

If we don't have the buffer space or memory allocations fail,
the data chunk is dropped, but TSN is still reported as received.
This introduced a data loss that can't be recovered.  We should
only mark TSNs are received after memory allocations finish.
The one exception is the invalid stream identifier, but that's
due to user error and is reported back to the user.

This was noticed by Michael Tuexen.

Signed-off-by: Vlad Yasevich <>
Signed-off-by: David S. Miller <>
13 years agocrypto: tcrypt - Fix memory leak in test_cipher
Darren Jenkins [Tue, 8 Jul 2008 07:51:44 +0000 (15:51 +0800)]
crypto: tcrypt - Fix memory leak in test_cipher

Coverity CID: 2306 & 2307 RESOURCE_LEAK

In the second for loop in test_cipher(), data is allocated space with
kzalloc() and is only ever freed in an error case.
Looking at this loop, data is written to this memory but nothing seems
to read from it.
So here is a patch removing the allocation, I think this is the right

Only compile tested.

Signed-off-by: Darren Jenkins <darrenrjenkins@gmailcom>
Signed-off-by: Herbert Xu <>
13 years agomd: sb_equal(): Fix misleading printk.
Andre Noll [Sun, 23 Mar 2008 14:10:33 +0000 (15:10 +0100)]
md: sb_equal(): Fix misleading printk.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: Fix a typo in the comment to cmd_match().
Andre Noll [Sun, 23 Mar 2008 17:34:54 +0000 (18:34 +0100)]
md: Fix a typo in the comment to cmd_match().

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: Fix typo in array_state comment.
Andre Noll [Tue, 25 Mar 2008 20:00:53 +0000 (21:00 +0100)]
md: Fix typo in array_state comment.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: sync_speed_show(): Trivial cleanups.
Andre Noll [Tue, 25 Mar 2008 21:24:09 +0000 (22:24 +0100)]
md: sync_speed_show(): Trivial cleanups.

- Remove superfluous parentheses.
- Make format string match the type of the variable that is printed.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: do_md_run(): Fix misleading error message.
Andre Noll [Tue, 25 Mar 2008 23:07:03 +0000 (00:07 +0100)]
md: do_md_run(): Fix misleading error message.

In case pers->run() succeeds but creating the bitmap fails, we
print an error message stating that pers->run() has failed.

Print this message only if pers->run() really failed.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: md_getgeo(): Move comment to proper position.
Andre Noll [Fri, 25 Apr 2008 16:57:58 +0000 (18:57 +0200)]
md: md_getgeo(): Move comment to proper position.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agomd: md_ioctl(): Fix misleading indentation.
Andre Noll [Fri, 25 Apr 2008 17:06:35 +0000 (19:06 +0200)]
md: md_ioctl(): Fix misleading indentation.

Signed-off-by: Andre Noll <>
Signed-off-by: Neil Brown <>
13 years agoMerge branch 'for-neil' of git://
Neil Brown [Tue, 8 Jul 2008 00:13:28 +0000 (10:13 +1000)]
Merge branch 'for-neil' of git://git./linux/kernel/git/djbw/md into for-next

13 years agoMerge branch 'master' into for-next
Neil Brown [Tue, 8 Jul 2008 00:11:50 +0000 (10:11 +1000)]
Merge branch 'master' into for-next

13 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Mon, 7 Jul 2008 23:59:43 +0000 (16:59 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://
  Revert "PCI: Correct last two HP entries in the bfsort whitelist"

13 years agomac80211: don't report selected IBSS when not found
Vladimir Koutny [Mon, 7 Jul 2008 12:23:01 +0000 (14:23 +0200)]
mac80211: don't report selected IBSS when not found

Don't report a 'selected' IBSS in sta_find_ibss when none was found.

Signed-off-by: Vladimir Koutny <>
Signed-off-by: John W. Linville <>
13 years agossb-pcicore: Fix IRQ-vector init on embedded devices
Michael Buesch [Fri, 4 Jul 2008 21:44:37 +0000 (23:44 +0200)]
ssb-pcicore: Fix IRQ-vector init on embedded devices

On embedded devices we must not route the interrupts through
the PCI core, if our host-bus is not PCI.

Reported-by: Steve Brown <>
Signed-off-by: Michael Buesch <>
Signed-off-by: John W. Linville <>
13 years agozd1211rw: add ID for AirTies WUS-201
Firat Birlik [Fri, 4 Jul 2008 03:31:50 +0000 (04:31 +0100)]
zd1211rw: add ID for AirTies WUS-201

I would like to inform you of our zd1211 based usb wifi adapter (AirTies
WUS-201), which works with the zd1211rw driver with the following device
id definition.

Signed-off-by: Daniel Drake <>
Signed-off-by: John W. Linville <>
13 years agomac80211: Only flush workqueue when last interface was removed
Ivo van Doorn [Thu, 3 Jul 2008 17:02:44 +0000 (19:02 +0200)]
mac80211: Only flush workqueue when last interface was removed

Currently the ieee80211_hw->workqueue is flushed each time
an interface is being removed. However most scheduled work
is not interface specific but device specific, for example things like
periodic work for link tuners.

This patch will move the flush_workqueue() call to directly behind
the call to ops->stop() to make sure the workqueue is only flushed
when all interfaces are gone and there really shouldn't be any scheduled
work in the drivers left.

Signed-off-by: Ivo van Doorn <>
Acked-by: Johannes Berg <>
Signed-off-by: John W. Linville <>
13 years agomac80211: move netif_carrier_on to after ieee80211_bss_info_change_notify
Guy Cohen [Thu, 3 Jul 2008 16:56:13 +0000 (19:56 +0300)]
mac80211: move netif_carrier_on to after ieee80211_bss_info_change_notify

Putting netif_carrier_on before configuring the driver/device with the
new association state may cause a race (tx frames may be sent before
configuration is done)

Signed-off-by: Guy Cohen <>
Signed-off-by: Tomas Winkler <>
Signed-off-by: John W. Linville <>
13 years agodrivers/net/wireless/iwlwifi/iwl-3945.c Fix type issue on 64bit
Darren Jenkins [Wed, 2 Jul 2008 23:41:38 +0000 (09:41 +1000)]
drivers/net/wireless/iwlwifi/iwl-3945.c Fix type issue on 64bit


"rate" is of an unsigned type, and the code requires a signed type.
The following patch makes it so.

Signed-off-by: Darren Jenkins <darrenrjenkins@gmailcom>
Signed-off-by: John W. Linville <>
13 years agohostap_cs: correct poor NULL checks in suspend/resume routines
John W. Linville [Wed, 2 Jul 2008 15:04:24 +0000 (11:04 -0400)]
hostap_cs: correct poor NULL checks in suspend/resume routines

This corrects this bug:

Signed-off-by: John W. Linville <>
13 years agoRevert "PCI: Correct last two HP entries in the bfsort whitelist"
Jesse Barnes [Mon, 7 Jul 2008 16:55:26 +0000 (09:55 -0700)]
Revert "PCI: Correct last two HP entries in the bfsort whitelist"

This reverts commit a1676072558854b95336c8f7db76b0504e909a0a.  It duplicates
the change from 8d64c781f0c5fbfdf8016bd1634506ff2ad1376a and only one should be
applied, otherwise some of the Dell quirks are lost.

Thanks to Tony Camuso for catching this.

Acked-by: Tony Camuso <>
Signed-off-by: Jesse Barnes <>