aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2009-04-24Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-blockLinus Torvalds16-120/+166
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: cfq-iosched: cache prio_tree root in cfqq->p_root cfq-iosched: fix bug with aliased request and cooperation detection cfq-iosched: clear ->prio_trees[] on cfqd alloc block: fix intermittent dm timeout based oops umem: fix request_queue lock warning block: simplify I/O stat accounting pktcdvd.h should include mempool.h cfq-iosched: use the default seek distance when there aren't enough seek samples cfq-iosched: make seek_mean converge more quickly block: make blk_abort_queue() ignore non-request based devices block: include empty disks in /proc/diskstats bio: use bio_kmalloc() in copy/map functions bio: fix bio_kmalloc() block: fix queue bounce limit setting block: fix SG_IO vector request data length handling scatterlist: make sure sg_miter_next() doesn't return 0 sized mappings
2009-04-24MN10300: Update the ASB2303 defconfigDavid Howells1-66/+94
Update the defconfig for the ASB2303 evaluation board. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-24Delete slow-work timers properlyJonathan Corbet1-2/+2
Slow-work appears to delete its timer as soon as the first user unregisters, even though other users could be active. At the same time, it never seems to delete slow_work_oom_timer. Arrange for both to happen in the shutdown path. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-24Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds83-485/+849
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (94 commits) netfilter: ctnetlink: fix gcc warning during compilation net/netrom: Fix socket locking netlabel: Always remove the correct address selector ucc_geth.c: Fix upsmr setting in RMII mode 8139too: fix HW initial flow af_iucv: Fix race when queuing incoming iucv messages af_iucv: Test additional sk states in iucv_sock_shutdown af_iucv: Reject incoming msgs if RECV_SHUTDOWN is set af_iucv: fix oops in iucv_sock_recvmsg() for MSG_PEEK flag af_iucv: consider state IUCV_CLOSING when closing a socket iwlwifi: DMA fixes iwlwifi: add debugging for TX path mwl8: fix build warning. mac80211: fix alignment calculation bug mac80211: do not print WARN if config interface iwl3945: use cancel_delayed_work_sync to cancel rfkill_poll iwlwifi: fix EEPROM validation mask to include OTP only devices atmel: fix netdev ops conversion pcnet_cs: add cis(firmware) of the Allied Telesis LA-PCM mlx4_en: Fix cleanup if workqueue create in mlx4_en_add() fails ...
2009-04-24Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6Linus Torvalds4-97/+225
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: sparc: Fix bus type probing for ESP and LE devices. sparc32: Update defconfig. sparc64: Update defconfig.
2009-04-24Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpcLinus Torvalds25-5441/+896
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: powerpc: Fix modular build of ide-pmac when mediabay is built in powerpc/pasemi: Fix build error on UP powerpc: Make macintosh/mediabay driver depend on CONFIG_BLOCK maintainers: Fix PS3 patterns powerpc/ps3: Fix CONFIG_PS3_FLASH=n build warning powerpc/32: Don't clobber personality flags on exec powerpc: Fix crash on CPU hotplug powerpc/85xx: Remove defconfigs that mpc85xx_{smp_}defconfig cover powerpc/85xx: Added SMP defconfig powerpc/85xx: Enabled a bunch of FSL specific drivers/options powerpc/85xx: Updated generic mpc85xx_defconfig powerpc: don't disable SATA interrupts on Freescale MPC8610 HPCD fsl_rio: Pass the proper device to dma mapping routines powerpc: Fix of_node_put() exit path in of_irq_map_one() powerpc/5200: defconfig updates powerpc/5200: Add FLASH nodes to lite5200 device tree powerpc/device-tree: Document MTD nodes with multiple "reg" tuples powerpc/of-device-tree: Factor MTD physmap bindings out of booting-without-of powerpc/5200: Bring the legacy fsl_spi_platform_data hooks back
2009-04-24check_unsafe_exec: s/lock_task_sighand/rcu_read_lock/Oleg Nesterov1-4/+2
write_lock(&current->fs->lock) guarantees we can't wrongly miss LSM_UNSAFE_SHARE, this is what we care about. Use rcu_read_lock() instead of ->siglock to iterate over the sub-threads. We must see all CLONE_THREAD|CLONE_FS threads which didn't pass exit_fs(), it takes fs->lock too. With or without this patch we can miss the freshly cloned thread and set LSM_UNSAFE_SHARE, we don't care. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Roland McGrath <roland@redhat.com> [ Fixed lock/unlock typo - Hugh ] Acked-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-24do_execve() must not clear fs->in_exec if it was set by another threadOleg Nesterov2-15/+15
If do_execve() fails after check_unsafe_exec(), it clears fs->in_exec unconditionally. This is wrong if we race with our sub-thread which also does do_execve: Two threads T1 and T2 and another process P, all share the same ->fs. T1 starts do_execve(BAD_FILE). It calls check_unsafe_exec(), since ->fs is shared, we set LSM_UNSAFE but not ->in_exec. P exits and decrements fs->users. T2 starts do_execve(), calls check_unsafe_exec(), now ->fs is not shared, we set fs->in_exec. T1 continues, open_exec(BAD_FILE) fails, we clear ->in_exec and return to the user-space. T1 does clone(CLONE_FS /* without CLONE_THREAD */). T2 continues without LSM_UNSAFE_SHARE while ->fs is shared with another process. Change check_unsafe_exec() to return res = 1 if we set ->in_exec, and change do_execve() to clear ->in_exec depending on res. When do_execve() suceeds, it is safe to clear ->in_exec unconditionally. It can be set only if we don't share ->fs with another process, and since we already killed all sub-threads either ->in_exec == 0 or we are the only user of this ->fs. Also, we do not need fs->lock to clear fs->in_exec. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Roland McGrath <roland@redhat.com> Acked-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-24cfq-iosched: cache prio_tree root in cfqq->p_rootJens Axboe1-14/+20
Currently we look it up from ->ioprio, but ->ioprio can change if either the process gets its IO priority changed explicitly, or if cfq decides to temporarily boost it. So if we are unlucky, we can end up attempting to remove a node from a different rbtree root than where it was added. Fix this by using ->org_ioprio as the prio_tree index, since that will only change for explicit IO priority settings (not for a boost). Additionally cache the rbtree root inside the cfqq, then we don't have to add code to reinsert the cfqq in the prio_tree if IO priority changes. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-24cfq-iosched: fix bug with aliased request and cooperation detectionJens Axboe1-5/+6
cfq_prio_tree_lookup() should return the direct match, yet it always returns zero. Fix that. cfq_prio_tree_add() assumes that we don't get a direct match, while it is very possible that we do. Using O_DIRECT, you can have different cfqq with matching requests, since you don't have the page cache to serialize things for you. Fix this bug by only adding the cfqq if there isn't an existing match. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-24cfq-iosched: clear ->prio_trees[] on cfqd allocJens Axboe1-0/+10
Not strictly needed, but we should make it clear that we init the rbtree roots here. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-24block: fix intermittent dm timeout based oopsHannes Reinecke1-0/+7
Very rarely under stress testing of dm, oopses are occuring as something tampers with an old stack frame. This has been traced back to blk_abort_queue() leaving a timeout_list pointing to the stack. The reason is that sometimes blk_abort_request() won't delete the timer (if the request is marked as complete but before the timer has been removed, a small race window). Fix this by splicing back from the ususally empty list to the q->timeout_list. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-24umem: fix request_queue lock warningSage Weil1-0/+1
The umem driver issues two warnings on boot, due to blk_plug_device() and blk_remove_plug() being called without q->queue_lock held. Starting with e48ec690 (block: extend queue_flag bitops), the queue_flag_* functions warn if q->queue_lock doesn't appear to be locked. In fact, q->queue_lock is NULL (though that apparently isn't otherwise a problem as the driver is using card->lock for everything). Although blk_init_queue() with take a request_fn_proc and spinlock_t*, there isn't a corresponding init helper that takes a make_request_fn. Setting queue_lock to &card->lock explicitly seems to work fine for me. The warning goes away and the device appears to behave. [ 1.531881] v2.3 : Micro Memory(tm) PCI memory board block driver [ 1.538136] umem 0000:02:01.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20 [ 1.545018] umem 0000:02:01.0: Micro Memory(tm) controller found (PCI Mem Module (Battery Backup)) [ 1.554176] umem 0000:02:01.0: CSR 0xfc9ffc00 -> 0xffffc200013d0c00 (0x100) [ 1.561279] umem 0000:02:01.0: Size 1048576 KB, Battery 1 Disabled (FAILURE), Battery 2 Disabled (FAILURE) [ 1.571114] umem 0000:02:01.0: Window size 16777216 bytes, IRQ 20 [ 1.577304] umem 0000:02:01.0: memory NOT initialized. Consider over-writing whole device. [ 1.585989] umema:<4>------------[ cut here ]------------ [ 1.591775] WARNING: at include/linux/blkdev.h:492 blk_plug_device+0x6d/0x106() [ 1.592025] Hardware name: H8SSL [ 1.592025] Modules linked in: [ 1.592025] Pid: 1, comm: swapper Not tainted 2.6.29 #8 [ 1.592025] Call Trace: [ 1.592025] [<ffffffff8023c994>] warn_slowpath+0xd3/0xf2 [ 1.592025] [<ffffffff8025a5b5>] ? save_trace+0x3f/0x9b [ 1.592025] [<ffffffff8025a68b>] ? add_lock_to_list+0x7a/0xba [ 1.592025] [<ffffffff8025e609>] ? validate_chain+0xb3b/0xce8 [ 1.592025] [<ffffffff80441556>] ? mm_make_request+0x27/0x59 [ 1.592025] [<ffffffff80441556>] ? mm_make_request+0x27/0x59 [ 1.592025] [<ffffffff8025ef04>] ? __lock_acquire+0x74e/0x7b9 [ 1.592025] [<ffffffff8025a70e>] ? get_lock_stats+0x34/0x5e [ 1.592025] [<ffffffff8025a746>] ? put_lock_stats+0xe/0x27 [ 1.592025] [<ffffffff80441556>] ? mm_make_request+0x27/0x59 [ 1.592025] [<ffffffff803ad165>] blk_plug_device+0x6d/0x106 [ 1.592025] [<ffffffff80441575>] mm_make_request+0x46/0x59 [ 1.592025] [<ffffffff803ac2d9>] generic_make_request+0x335/0x3cf [ 1.592025] [<ffffffff8027fcc7>] ? mempool_alloc_slab+0x11/0x13 [ 1.592025] [<ffffffff8027fdce>] ? mempool_alloc+0x45/0x101 [ 1.592025] [<ffffffff8025a746>] ? put_lock_stats+0xe/0x27 [ 1.592025] [<ffffffff803adda5>] submit_bio+0x10a/0x119 [ 1.592025] [<ffffffff802c8d00>] submit_bh+0xe5/0x109 [ 1.592025] [<ffffffff802cbf43>] block_read_full_page+0x2aa/0x2cb [ 1.592025] [<ffffffff802cf4c4>] ? blkdev_get_block+0x0/0x4c [ 1.592025] [<ffffffff805c90a8>] ? _spin_unlock_irq+0x36/0x51 [ 1.592025] [<ffffffff80286836>] ? __lru_cache_add+0x92/0xb2 [ 1.592025] [<ffffffff802cf008>] blkdev_readpage+0x13/0x15 [ 1.592025] [<ffffffff8027de06>] read_cache_page_async+0x90/0x134 [ 1.592025] [<ffffffff802ceff5>] ? blkdev_readpage+0x0/0x15 [ 1.592025] [<ffffffff802f5f1c>] ? adfspart_check_ICS+0x0/0x16c [ 1.592025] [<ffffffff8027deb8>] read_cache_page+0xe/0x45 [ 1.592025] [<ffffffff802f5170>] read_dev_sector+0x2e/0x93 [ 1.592025] [<ffffffff802f5f44>] adfspart_check_ICS+0x28/0x16c [ 1.592025] [<ffffffff8025d427>] ? trace_hardirqs_on+0xd/0xf [ 1.592025] [<ffffffff802f5f1c>] ? adfspart_check_ICS+0x0/0x16c [ 1.592025] [<ffffffff802f59c5>] rescan_partitions+0x168/0x2fb [ 1.592025] [<ffffffff802ceae9>] __blkdev_get+0x259/0x336 [ 1.592025] [<ffffffff803ca1e2>] ? kobject_put+0x47/0x4b [ 1.592025] [<ffffffff802cebd1>] blkdev_get+0xb/0xd [ 1.592025] [<ffffffff802f5773>] register_disk+0xc4/0x12b [ 1.592025] [<ffffffff803b2a7b>] add_disk+0xc3/0x12d [ 1.592025] [<ffffffff808a1d4a>] ? mm_init+0x0/0x1a5 [ 1.592025] [<ffffffff808a1e73>] mm_init+0x129/0x1a5 [ 1.592025] [<ffffffff808a1d4a>] ? mm_init+0x0/0x1a5 [ 1.592025] [<ffffffff80209056>] _stext+0x56/0x130 [ 1.592025] [<ffffffff80274932>] ? register_irq_proc+0xae/0xca [ 1.592025] [<ffffffff802f0000>] ? proc_pid_lookup+0xb4/0x18b [ 1.592025] [<ffffffff8087f975>] kernel_init+0x132/0x18b [ 1.592025] [<ffffffff8020d17a>] child_rip+0xa/0x20 [ 1.592025] [<ffffffff8020cb40>] ? restore_args+0x0/0x30 [ 1.592025] [<ffffffff8087f843>] ? kernel_init+0x0/0x18b [ 1.592025] [<ffffffff8020d170>] ? child_rip+0x0/0x20 [ 1.592025] ---[ end trace 7150b3b86da74e1e ]--- [ 1.889858] ------------[ cut here ]------------[ve_plug+0x5f/0x91() [ 1.893848] Hardware name: H8SSL [ 1.893848] Modules linked in: [ 1.893848] Pid: 1, comm: swapper Tainted: G W 2.6.29 #8 [ 1.893848] Call Trace: [ 1.893848] [<ffffffff8023c994>] warn_slowpath+0xd3/0xf2 [ 1.893848] [<ffffffff805c8411>] ? trace_hardirqs_on_thunk+0x3a/0x3f [ 1.893848] [<ffffffff8020cb40>] ? restore_args+0x0/0x30 [ 1.893848] [<ffffffff80254245>] ? __atomic_notifier_call_chain+0x0/0xb2 [ 1.893848] [<ffffffff805c90a3>] ? _spin_unlock_irq+0x31/0x51 [ 1.893848] [<ffffffff805c90bf>] ? _spin_unlock_irq+0x4d/0x51 [ 1.893848] [<ffffffff8044157d>] ? mm_make_request+0x4e/0x59 [ 1.893848] [<ffffffff8025a70e>] ? get_lock_stats+0x34/0x5e [ 1.893848] [<ffffffff8025a75d>] ? put_lock_stats+0x25/0x27 [ 1.893848] [<ffffffff80441504>] ? mm_unplug_device+0x25/0x50 [ 1.893848] [<ffffffff803acf23>] blk_remove_plug+0x5f/0x91 [ 1.893848] [<ffffffff8044150f>] mm_unplug_device+0x30/0x50 [ 1.893848] [<ffffffff803ab74a>] blk_unplug+0x78/0x7d [ 1.893848] [<ffffffff803ab75c>] blk_backing_dev_unplug+0xd/0xf [ 1.893848] [<ffffffff802c853c>] block_sync_page+0x4a/0x4c [ 1.893848] [<ffffffff8027da1c>] sync_page+0x44/0x4d [ 1.893848] [<ffffffff805c66fd>] __wait_on_bit_lock+0x42/0x8a [ 1.893848] [<ffffffff8027d9d8>] ? sync_page+0x0/0x4d [ 1.893848] [<ffffffff8027d9c4>] __lock_page+0x64/0x6b [ 1.893848] [<ffffffff802508db>] ? wake_bit_function+0x0/0x2a [ 1.893848] [<ffffffff8027de4a>] read_cache_page_async+0xd4/0x134 [ 1.893848] [<ffffffff802ceff5>] ? blkdev_readpage+0x0/0x15 [ 1.893848] [<ffffffff802f5f1c>] ? adfspart_check_ICS+0x0/0x16c [ 1.893848] [<ffffffff8027deb8>] read_cache_page+0xe/0x45 [ 1.893848] [<ffffffff802f5170>] read_dev_sector+0x2e/0x93 [ 1.893848] [<ffffffff802f5f44>] adfspart_check_ICS+0x28/0x16c [ 1.893848] [<ffffffff8025d427>] ? trace_hardirqs_on+0xd/0xf [ 1.893848] [<ffffffff802f5f1c>] ? adfspart_check_ICS+0x0/0x16c [ 1.893848] [<ffffffff802f59c5>] rescan_partitions+0x168/0x2fb [ 1.893848] [<ffffffff802ceae9>] __blkdev_get+0x259/0x336 [ 1.893848] [<ffffffff803ca1e2>] ? kobject_put+0x47/0x4b [ 1.893848] [<ffffffff802cebd1>] blkdev_get+0xb/0xd [ 1.893848] [<ffffffff802f5773>] register_disk+0xc4/0x12b [ 1.893848] [<ffffffff803b2a7b>] add_disk+0xc3/0x12d [ 1.893848] [<ffffffff808a1d4a>] ? mm_init+0x0/0x1a5 [ 1.893848] [<ffffffff808a1e73>] mm_init+0x129/0x1a5 [ 1.893848] [<ffffffff808a1d4a>] ? mm_init+0x0/0x1a5 [ 1.893848] [<ffffffff80209056>] _stext+0x56/0x130 [ 1.893848] [<ffffffff80274932>] ? register_irq_proc+0xae/0xca [ 1.893848] [<ffffffff802f0000>] ? proc_pid_lookup+0xb4/0x18b [ 1.893848] [<ffffffff8087f975>] kernel_init+0x132/0x18b [ 1.893848] [<ffffffff8020d17a>] child_rip+0xa/0x20 [ 1.893848] [<ffffffff8020cb40>] ? restore_args+0x0/0x30 [ 1.893848] [<ffffffff8087f843>] ? kernel_init+0x0/0x18b [ 1.893848] [<ffffffff8020d170>] ? child_rip+0x0/0x20 [ 1.893848] ---[ end trace 7150b3b86da74e1f ]--- Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-24block: simplify I/O stat accountingJerome Marchand5-13/+12
This simplifies I/O stat accounting switching code and separates it completely from I/O scheduler switch code. Requests are accounted according to the state of their request queue at the time of the request allocation. There is no need anymore to flush the request queue when switching I/O accounting state. Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-24pktcdvd.h should include mempool.hAlexander Beregalov1-0/+1
Fix this build error: In file included from fs/compat_ioctl.c:104: include/linux/pktcdvd.h:285: error: expected specifier-qualifier-list before 'mempool_t' Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-22sparc: Fix bus type probing for ESP and LE devices.David S. Miller2-4/+38
If there is a dummy "espdma" or "ledma" parent device above ESP scsi or LE ethernet device nodes, we have to match the bus as SBUS. Otherwise the address and size cell counts are wrong and we don't calculate the final physical device resource values correctly at all. Commit 5280267c1dddb8d413595b87dc406624bb497946 ("sparc: Fix handling of LANCE and ESP parent nodes in of_device.c") was meant to fix this problem, but that only influences the inner loop of build_device_resources(). We need this logic to also kick in at the beginning of build_device_resources() as well, when we make the first attempt to determine the device's immediate parent bus type for 'reg' property element extraction. Based almost entirely upon a patch by Friedrich Oslage. Tested-by: Meelis Roos <mroos@linux.ee> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-22netfilter: ctnetlink: fix gcc warning during compilationPablo Neira Ayuso1-2/+2
This patch fixes a (bogus?) gcc warning during compilation: net/netfilter/nf_conntrack_netlink.c:1234: warning: 'helpname' may be used uninitialized in this function net/netfilter/nf_conntrack_netlink.c:991: warning: 'helpname' may be used uninitialized in this function In fact, helpname is initialized by ctnetlink_parse_help() so I cannot see a way to use it without being initialized. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-22net/netrom: Fix socket lockingJean Delvare1-2/+4
Patch "af_rose/x25: Sanity check the maximum user frame size" (commit 83e0bbcbe2145f160fbaa109b0439dae7f4a38a9) from Alan Cox got locking wrong. If we bail out due to user frame size being too large, we must unlock the socket beforehand. Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-22netlabel: Always remove the correct address selectorPaul Moore1-16/+10
The NetLabel address selector mechanism has a problem where it can get mistakenly remove the wrong selector when similar addresses are used. The problem is caused when multiple addresses are configured that have different netmasks but the same address, e.g. 127.0.0.0/8 and 127.0.0.0/24. This patch fixes the problem. Reported-by: Etienne Basset <etienne.basset@numericable.fr> Signed-off-by: Paul Moore <paul.moore@hp.com> Acked-by: James Morris <jmorris@namei.org> Tested-by: Etienne Basset <etienne.basset@numericable.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-22ucc_geth.c: Fix upsmr setting in RMII modeHeiko Schocher1-1/+2
If using the UCC on a MPC8360 in RMII mode, don;t set UCC_GETH_UPSMR_RPM bit in the upsmr register. Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Li Yang <leoli@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-228139too: fix HW initial flowJianjun kong1-5/+5
While ifconfig eth0 up kernel calls open() of 8139 driver(8139too.c). In rtl8139_hw_start() of rtl8139_open(), 8139 driver enable RX before setting up the DMA buffer address. In this interval where RX was enabled and DMA buffer address is not yet set up, any incoming broadcast packet would be send to a strange physical address: 0x003e8800 which is the default value of DMA buffer address. Unfortunately, this address is used by Linux kernel. So kernel panics. This patch fix it by setting up DMA buffer address before RX enabled and everything is fine even under broadcast packets attack. Signed-off-by: Jonathan Lin <jon.lin@vatics.com> Signed-off-by: Amos Kong <jianjun@zeuux.org> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-21af_iucv: Fix race when queuing incoming iucv messagesHendrik Brueckner1-3/+5
AF_IUCV runs into a race when queuing incoming iucv messages and receiving the resulting backlog. If the Linux system is under pressure (high load or steal time), the message queue grows up, but messages are not received and queued onto the backlog queue. In that case, applications do not receive any data with recvmsg() even if AF_IUCV puts incoming messages onto the message queue. The race can be avoided if the message queue spinlock in the message_pending callback is spreaded across the entire callback function. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-21af_iucv: Test additional sk states in iucv_sock_shutdownHendrik Brueckner1-0/+3
Add few more sk states in iucv_sock_shutdown(). Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-21af_iucv: Reject incoming msgs if RECV_SHUTDOWN is setHendrik Brueckner1-1/+3
Reject incoming iucv messages if the receive direction has been shut down. It avoids that the queue of outstanding messages increases and exceeds the message limit of the iucv communication path. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-21af_iucv: fix oops in iucv_sock_recvmsg() for MSG_PEEK flagHendrik Brueckner1-3/+3
If iucv_sock_recvmsg() is called with MSG_PEEK flag set, the skb is enqueued twice. If the socket is then closed, the pointer to the skb is freed twice. Remove the skb_queue_head() call for MSG_PEEK, because the skb_recv_datagram() function already handles MSG_PEEK (does not dequeue the skb). Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-21af_iucv: consider state IUCV_CLOSING when closing a socketUrsula Braun1-0/+3
Make sure a second invocation of iucv_sock_close() guarantees proper freeing of an iucv path. Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-22cfq-iosched: use the default seek distance when there aren't enough seek samplesJeff Moyer1-5/+6
If the cfq io context doesn't have enough samples yet to provide a mean seek distance, then use the default threshold we have for seeky IO instead of defaulting to 0. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-22cfq-iosched: make seek_mean converge more quicklyJeff Moyer1-1/+3
Right now, depending on the first sector to which a process issues I/O, the seek time may start out way out of whack. So make sure we start with 0 sectors in seek, instead of the offset of the first request issued. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-22block: make blk_abort_queue() ignore non-request based devicesJens Axboe1-0/+6
There's nothing to do for those devices, since the timeout handling is based on requests. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-22block: include empty disks in /proc/diskstatsTejun Heo2-4/+9
/proc/diskstats used to show stats for all disks whether they're zero-sized or not and their non-zero partitions. Commit 074a7aca7afa6f230104e8e65eba3420263714a5 accidentally changed the behavior such that it doesn't print out zero sized disks. This patch implements DISK_PITER_INCL_EMPTY_PART0 flag to partition iterator and uses it in diskstats_show() such that empty part0 is shown in /proc/diskstats. Reported and bisectd by Dianel Collins. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Daniel Collins <solemnwarning@solemnwarning.no-ip.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-22bio: use bio_kmalloc() in copy/map functionsTejun Heo1-3/+3
Impact: remove possible deadlock condition There is no reason to use mempool backed allocation for map functions. Also, because kern mapping is used inside LLDs (e.g. for EH), using mempool backed allocation can lead to deadlock under extreme conditions (mempool already consumed by the time a request reached EH and requests are blocked on EH). Switch copy/map functions to bio_kmalloc(). Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-22bio: fix bio_kmalloc()Tejun Heo2-64/+55
Impact: fix bio_kmalloc() and its destruction path bio_kmalloc() was broken in two ways. * bvec_alloc_bs() first allocates bvec using kmalloc() and then ignores it and allocates again like non-kmalloc bvecs. * bio_kmalloc_destructor() didn't check for and free bio integrity data. This patch fixes the above problems. kmalloc patch is separated out from bio_alloc_bioset() and allocates the requested number of bvecs as inline bvecs. * bio_alloc_bioset() no longer takes NULL @bs. None other than bio_kmalloc() used it and outside users can't know how it was allocated anyway. * Define and use BIO_POOL_NONE so that pool index check in bvec_free_bs() triggers if inline or kmalloc allocated bvec gets there. * Relocate destructors on top of each allocation function so that how they're used is more clear. Jens Axboe suggested allocating bvecs inline. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-22block: fix queue bounce limit settingTejun Heo1-9/+11
Impact: don't set GFP_DMA in q->bounce_gfp unnecessarily All DMA address limits are expressed in terms of the last addressable unit (byte or page) instead of one plus that. However, when determining bounce_gfp for 64bit machines in blk_queue_bounce_limit(), it compares the specified limit against 0x100000000UL to determine whether it's below 4G ending up falsely setting GFP_DMA in q->bounce_gfp. As DMA zone is very small on x86_64, this makes larger SG_IO transfers very eager to trigger OOM killer. Fix it. While at it, rename the parameter to @dma_mask for clarity and convert comment to proper winged style. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-22block: fix SG_IO vector request data length handlingTejun Heo1-1/+12
Impact: fix SG_IO behavior such that it matches the documentation SG_IO howto says that if ->dxfer_len and sum of iovec disagress, the shorter one wins. However, the current implementation returns -EINVAL for such cases. Trim iovc if it's longer than ->dxfer_len. This patch uses iov_*() helpers which take struct iovec * by casting struct sg_iovec * to it. sg_iovec is always identical to iovec and this will be further cleaned up with later patches. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-22scatterlist: make sure sg_miter_next() doesn't return 0 sized mappingsTejun Heo1-3/+6
Impact: fix not-so-critical but annoying bug sg_miter_next() returns 0 sized mapping if there is an zero sized sg entry in the list or at the end of each iteration. As the users always check the ->length field, this bug shouldn't be critical other than causing unnecessary iteration. Fix it. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-22powerpc: Fix modular build of ide-pmac when mediabay is built inBartlomiej Zolnierkiewicz1-0/+2
Now that the powermac IDE host driver can be modular, we need to export check_media_bay_by_base() and media_bay_set_ide_infos() from drivers/macintosh/mediabay.c for it. This fixes the following build error: > CC [M] drivers/ide/pmac.o > drivers/ide/pmac.c: In function ‘pmac_ide_init_dev’: > drivers/ide/pmac.c:955: error: implicit declaration of function > ‘check_media_bay_by_base’ > drivers/ide/pmac.c: In function ‘pmac_ide_setup_device’: > drivers/ide/pmac.c:1090: error: implicit declaration of function > ‘media_bay_set_ide_infos’ > make[2]: *** [drivers/ide/pmac.o] Error 1 > make[1]: *** [drivers/ide] Error 2 > make: *** [drivers] Error 2 Reported-by: Subrata Modak <subrata@linux.vnet.ibm.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-04-22powerpc/pasemi: Fix build error on UPGeoff Levand1-4/+0
A non-SMP version of smp_send_stop() is now included in smp.h. Remove the unneeded definition in the pasemi setup.c. Fixes build errors like these when CONFIG_SMP=n: arch/powerpc/platforms/pasemi/setup.c:48: error: redefinition of ‘smp_send_stop’ include/linux/smp.h:125: error: previous definition of 'smp_send_stop' was here Reported-by: subrata@linux.vnet.ibm.com Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-04-22powerpc: Make macintosh/mediabay driver depend on CONFIG_BLOCKAlexander Beregalov1-1/+1
Fixes this build error: In file included from drivers/macintosh/mediabay.c:21: include/linux/ide.h:605: error: field 'request_sense_rq' has incomplete type Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-04-22maintainers: Fix PS3 patternsGeoff Levand1-3/+2
Correct the MAINTAINERS file patterns for PS3. Removes some PS3 patterns that were under 'CELL BROADBAND ENGINE ARCHITECTURE', and adds missing PS3 sound and RTC driver patterns. CC: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-04-22powerpc/ps3: Fix CONFIG_PS3_FLASH=n build warningGeoff Levand1-1/+1
Fix build warnings like these when CONFIG_PS3_FLASH=n: arch/powerpc/platforms/ps3/os-area.c: warning: 'update_flash_db' defined but not used Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-04-22powerpc/32: Don't clobber personality flags on execAndreas Schwab1-1/+2
Now that ppc32 implements address randomization it also wants to inherit personality flags like ADDR_NO_RANDOMIZE across exec, for things like `setarch ppc -R' to work. But the ppc32 version of SET_PERSONALITY forcefully sets PER_LINUX, clearing all personality flags. So be careful about preserving the flags. Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-04-22powerpc: Fix crash on CPU hotplugMichael Ellerman1-1/+1
early_init_mmu_secondary() is called at CPU hotplug time, so it must be marked as __cpuinit, not __init. Caused by 757c74d2 ("powerpc/mm: Introduce early_init_mmu() on 64-bit"). Tested-by: Sachin Sant <sachinp@in.ibm.com> Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-04-21Linux 2.6.30-rc3Linus Torvalds1-1/+1
2009-04-22Merge branch 'merge' of git://git.secretlab.ca/git/linux-2.6 into mergePaul Mackerras1794-67800/+127643
2009-04-21driver synchronization: make scsi_wait_scan more advancedArjan van de Ven4-2/+13
There is currently only one way for userspace to say "wait for my storage device to get ready for the modules I just loaded": to load the scsi_wait_scan module. Expectations of userspace are that once this module is loaded, all the (storage) devices for which the drivers were loaded before the module load are present. Now, there are some issues with the implementation, and the async stuff got caught in the middle of this: The existing code only waits for the scsy async probing to finish, but it did not take into account at all that probing might not have begun yet. (Russell ran into this problem on his computer and the fix works for him) This patch fixes this more thoroughly than the previous "fix", which had some bad side effects (namely, for kernel code that wanted to wait for the scsi scan it would also do an async sync, which would deadlock if you did it from async context already.. there's a report about that on lkml): The patch makes the module first wait for all device driver probes, and then it will wait for the scsi parallel scan to finish. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-21Trivial: fix a typo in slow-work.hJonathan Corbet1-1/+1
Fix a comment typo in slow-work.h ...a trivial mistake, but it will mess up kerneldoc if nothing else. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-21PERCPU: Collect the DECLARE/DEFINE declarations togetherDavid Howells3-44/+86
Collect the DECLARE/DEFINE declarations together in linux/percpu-defs.h so that they're in one place, and give them descriptive comments, particularly the SHARED_ALIGNED variant. It would be nice to collect these in linux/percpu.h, but that's not possible without sorting out the severe #include recursion between the x86 arch headers and the general headers (and possibly other arches too). Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-21FRV: Fix the section attribute on UP DECLARE_PER_CPU()David Howells9-35/+50
In non-SMP mode, the variable section attribute specified by DECLARE_PER_CPU() does not agree with that specified by DEFINE_PER_CPU(). This means that architectures that have a small data section references relative to a base register may throw up linkage errors due to too great a displacement between where the base register points and the per-CPU variable. On FRV, the .h declaration says that the variable is in the .sdata section, but the .c definition says it's actually in the .data section. The linker throws up the following errors: kernel/built-in.o: In function `release_task': kernel/exit.c:78: relocation truncated to fit: R_FRV_GPREL12 against symbol `per_cpu__process_counts' defined in .data section in kernel/built-in.o kernel/exit.c:78: relocation truncated to fit: R_FRV_GPREL12 against symbol `per_cpu__process_counts' defined in .data section in kernel/built-in.o To fix this, DECLARE_PER_CPU() should simply apply the same section attribute as does DEFINE_PER_CPU(). However, this is made slightly more complex by virtue of the fact that there are several variants on DEFINE, so these need to be matched by variants on DECLARE. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-21Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstableLinus Torvalds10-83/+272
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: Btrfs: fix btrfs fallocate oops and deadlock Btrfs: use the right node in reada_for_balance Btrfs: fix oops on page->mapping->host during writepage Btrfs: add a priority queue to the async thread helpers Btrfs: use WRITE_SYNC for synchronous writes
2009-04-21Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6Linus Torvalds13-418/+176
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: go7007: Convert to the new i2c device binding model