AgeCommit message (Collapse)AuthorFilesLines
2009-09-09Linux 2.6.31v2.6.31Linus Torvalds1-1/+1
2009-09-09aoe: allocate unused request_queue for sysfsEd Cashin3-4/+11
Andy Whitcroft reported an oops in aoe triggered by use of an incorrectly initialised request_queue object: [ 2645.959090] kobject '<NULL>' (ffff880059ca22c0): tried to add an uninitialized object, something is seriously wrong. [ 2645.959104] Pid: 6, comm: events/0 Not tainted 2.6.31-5-generic #24-Ubuntu [ 2645.959107] Call Trace: [ 2645.959139] [<ffffffff8126ca2f>] kobject_add+0x5f/0x70 [ 2645.959151] [<ffffffff8125b4ab>] blk_register_queue+0x8b/0xf0 [ 2645.959155] [<ffffffff8126043f>] add_disk+0x8f/0x160 [ 2645.959161] [<ffffffffa01673c4>] aoeblk_gdalloc+0x164/0x1c0 [aoe] The request queue of an aoe device is not used but can be allocated in code that does not sleep. Bruno bisected this regression down to cd43e26f071524647e660706b784ebcbefbd2e44 block: Expose stacked device queues in sysfs "This seems to generate /sys/block/$device/queue and its contents for everyone who is using queues, not just for those queues that have a non-NULL queue->request_fn." Addresses Addresses Note that embedding a queue inside another object has always been an illegal construct, since the queues are reference counted and must persist until the last reference is dropped. So aoe was always buggy in this respect (Jens). Signed-off-by: Ed Cashin <> Cc: Andy Whitcroft <> Cc: "Rafael J. Wysocki" <> Cc: Bruno Premont <> Cc: Martin K. Petersen <> Cc: Andrew Morton <> Signed-off-by: Jens Axboe <>
2009-09-08i915: disable interrupts before tearing down GEM stateLinus Torvalds1-5/+1
Reinette Chatre reports a frozen system (with blinking keyboard LEDs) when switching from graphics mode to the text console, or when suspending (which does the same thing). With netconsole, the oops turned out to be BUG: unable to handle kernel NULL pointer dereference at 0000000000000084 IP: [<ffffffffa03ecaab>] i915_driver_irq_handler+0x26b/0xd20 [i915] and it's due to the i915_gem.c code doing drm_irq_uninstall() after having done i915_gem_idle(). And the i915_gem_idle() path will do i915_gem_idle() -> i915_gem_cleanup_ringbuffer() -> i915_gem_cleanup_hws() -> dev_priv->hw_status_page = NULL; but if an i915 interrupt comes in after this stage, it may want to access that hw_status_page, and gets the above NULL pointer dereference. And since the NULL pointer dereference happens from within an interrupt, and with the screen still in graphics mode, the common end result is simply a silently hung machine. Fix it by simply uninstalling the irq handler before idling rather than after. Fixes Reported-and-tested-by: Reinette Chatre <> Acked-by: Jesse Barnes <> Signed-off-by: Linus Torvalds <>
2009-09-08drm/i915: fix mask bits settingZhenyu Wang3-1/+3
eDP is exclusive connector too, and add missing crtc_mask setting for TV. This fixes Signed-off-by: Zhenyu Wang <> Reported-and-tested-by: Carlos R. Mafra <> Signed-off-by: Linus Torvalds <>
2009-09-07Merge branch 'drm-fixes' of ↵Linus Torvalds5-69/+70
git:// * 'drm-fixes' of git:// drm/radeon/kms: add LTE/GTE discard + rv515 two sided stencil register.
2009-09-07Merge branch 'for-linus' of ↵Linus Torvalds2-8/+20
git:// * 'for-linus' of git:// IMA: update ima_counts_put
2009-09-07Merge git:// Torvalds1-1/+1
* git:// gianfar: Fix build.
2009-09-07Merge git:// Torvalds1-0/+1
* git:// pcmcia: add CNF-CDROM-ID for ide
2009-09-07Merge branch 'for-linus' of ↵Linus Torvalds3-6/+31
git:// * 'for-linus' of git:// agp/intel: support for new chip variant of IGDNG mobile drm/i915: Unref old_obj on get_fence_reg() error path drm/i915: increase default latency constant (v2 w/comment)
2009-09-07drm/radeon/kms: add LTE/GTE discard + rv515 two sided stencil register.Dave Airlie5-69/+70
This adds some rv350+ register for LTE/GTE discard, and enables the rv515 two sided stencil register. It also disables the DEPTHXY_OFFSET register which can be used to workaround the CS checker. Moves rs690 to proper place in rs600 and uses correct table on rs600. Signed-off-by: Dave Airlie <>
2009-09-07IMA: update ima_counts_putMimi Zohar2-8/+20
- As ima_counts_put() may be called after the inode has been freed, verify that the inode is not NULL, before dereferencing it. - Maintain the IMA file counters in may_open() properly, decrementing any counter increments on subsequent errors. Reported-by: Ciprian Docan <> Reported-by: J.R. Okajima <> Signed-off-by: Mimi Zohar <> Acked-by: Eric Paris < Signed-off-by: James Morris <>
2009-09-06gianfar: Fix build.David S. Miller1-1/+1
Reported by Michael Guntsche <> -------------------- Commit 38bddf04bcfe661fbdab94888c3b72c32f6873b3 gianfar: gfar_remove needs to call unregister_netdev() breaks the build of the gianfar driver because "dev" is undefined in this function. To quickly test rc9 I changed this to priv->ndev but I do not know if this is the correct one. -------------------- Signed-off-by: David S. Miller <>
2009-09-05Linux 2.6.31-rc9v2.6.31-rc9Linus Torvalds1-1/+1
2009-09-05Merge branch 'for-linus' of ↵Linus Torvalds3-6/+20
git:// * 'for-linus' of git:// firewire: sbp2: fix freeing of unallocated memory firewire: ohci: fix Ricoh R5C832, video reception firewire: ohci: fix Agere FW643 and multiple cameras firewire: core: fix crash in iso resource management
2009-09-05powerpc: Fix i8259 interrupt driver kernel crash on ML510Roderick Colenbrander1-1/+0
This patch fixes a null pointer exception caused by removal of 'ack()' for level interrupts in the Xilinx interrupt driver. A recent change to the xilinx interrupt controller removed the ack hook for level irqs. Signed-off-by: Roderick Colenbrander <> Signed-off-by: Grant Likely <> Acked-by: Benjamin Herrenschmidt <> Signed-off-by: Linus Torvalds <>
2009-09-05Merge git:// Torvalds3-7/+20
* git:// JFFS2: add missing verify buffer allocation/deallocation mtd: nftl: fix offset alignments mtd: nftl: write support is broken mtd: m25p80: fix null pointer dereference bug
2009-09-05Merge branch 'for-linus' of git:// Torvalds1-1/+1
* 'for-linus' of git:// block: Allow changing max_sectors_kb above the default 512
2009-09-05Merge branch 'fix/oxygen' of ↵Linus Torvalds2-0/+5
git:// * 'fix/oxygen' of git:// sound: oxygen: handle cards with missing EEPROM sound: oxygen: fix MCLK rate for 192 kHz playback
2009-09-05Merge git:// Torvalds6-75/+89
* git:// tc: Fix unitialized kernel memory leak pkt_sched: Revert tasklet_hrtimer changes. net: sk_free() should be allowed right after sk_alloc() gianfar: gfar_remove needs to call unregister_netdev() ipw2200: firmware DMA loading rework
2009-09-05Merge git:// Torvalds3-4/+12
* git:// crypto: skcipher - Fix skcipher_dequeue_givcrypt NULL test
2009-09-05Merge branch 'fixes' of ↵Linus Torvalds1-88/+7
git:// * 'fixes' of git:// [CPUFREQ] Re-enable cpufreq suspend and resume code
2009-09-05Merge branch 'release' of ↵Linus Torvalds2-4/+8
git:// * 'release' of git:// [IA64] fix csum_ipv6_magic() [IA64] Fix warning in dma-mapping.c
2009-09-05Merge branch 'for-linus' of git:// Torvalds1-1/+1
* 'for-linus' of git:// xfs: actually enable the swapext compat handler
2009-09-05Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
git:// * 'for-linus' of git:// nilfs2: fix preempt count underflow in nilfs_btnode_prepare_change_key
2009-09-05Merge branch 'for-linus' of ↵Linus Torvalds1-1/+14
git:// * 'for-linus' of git:// percpu: don't assume existence of cpu0
2009-09-05Merge branch 'slab/urgent' of ↵Linus Torvalds1-2/+2
git:// * 'slab/urgent' of git:// slub: Fix kmem_cache_destroy() with SLAB_DESTROY_BY_RCU
2009-09-05Merge git:// Torvalds13-81/+198
* git:// dm snapshot: fix on disk chunk size validation dm exception store: split set_chunk_size dm snapshot: fix header corruption race on invalidation dm snapshot: refactor zero_disk_area to use chunk_io dm log: userspace add luid to distinguish between concurrent log instances dm raid1: do not allow log_failure variable to unset after being set dm log: remove incorrect field from userspace table output dm log: fix userspace status output dm stripe: expose correct io hints dm table: add more context to terse warning messages dm table: fix queue_limit checking device iterator dm snapshot: implement iterate devices dm multipath: fix oops when request based io fails when no paths
2009-09-05Merge branch 'for-linus' of ↵Linus Torvalds4-6/+42
git:// * 'for-linus' of git:// PCI SR-IOV: correct broken resource alignment calculations
2009-09-05Merge git:// Torvalds4-7/+6
* git:// sparc64: Fix bootup with mcount in some configs. sparc64: Kill spurious NMI watchdog triggers by increasing limit to 30 seconds.
2009-09-05Merge branch 'perfcounters-fixes-for-linus' of ↵Linus Torvalds2-4/+5
git:// * 'perfcounters-fixes-for-linus' of git:// perf_counter/powerpc: Fix cache event codes for POWER7 perf_counter: Fix /0 bug in swcounters perf_counters: Increase paranoia level
2009-09-05Merge branch 'for-linus' of ↵Linus Torvalds2-0/+43
git:// * 'for-linus' of git:// Input: atkbd - add Compaq Presario R4000-series repeat quirk Input: i8042 - add Acer Aspire 5536 to the nomux list
2009-09-05ext2: fix unbalanced kmap()/kunmap()Nicolas Pitre1-0/+4
In ext2_rename(), dir_page is acquired through ext2_dotdot(). It is then released through ext2_set_link() but only if old_dir != new_dir. Failing that, the pkmap reference count is never decremented and the page remains pinned forever. Repeat that a couple times with highmem pages and all pkmap slots get exhausted, and every further kmap() calls end up stalling on the pkmap_map_wait queue at which point the whole system comes to a halt. Signed-off-by: Nicolas Pitre <> Acked-by: Theodore Ts'o <> Cc: Signed-off-by: Linus Torvalds <>
2009-09-05Merge branch 'upstream-linus' of ↵Linus Torvalds2-2/+13
git:// * 'upstream-linus' of git:// ocfs2: ocfs2_write_begin_nolock() should handle len=0 ocfs2: invalidate dentry if its dentry_lock isn't initialized.
2009-09-05pty: don't limit the writes to 'pty_space()' inside 'pty_write()'Linus Torvalds1-9/+1
The whole write-room thing is something that is up to the _caller_ to worry about, not the pty layer itself. The total buffer space will still be limited by the buffering routines themselves, so there is no advantage or need in having pty_write() artificially limit the size somehow. And what happened was that the caller (the n_tty line discipline, in this case) may have verified that there is room for 2 bytes to be written (for NL -> CRNL expansion), and it used to then do those writes as two single-byte writes. And if the first byte written (CR) then caused a new tty buffer to be allocated, pty_space() may have returned zero when trying to write the second byte (LF), and then incorrectly failed the write - leading to a lost newline character. This should finally fix Reported-by: Mikael Pettersson <> Acked-by: Alan Cox <> Signed-off-by: Linus Torvalds <>
2009-09-05n_tty: do O_ONLCR translation as a single writeLinus Torvalds1-2/+1
When translating CR to CRNL in the n_tty line discipline, we did it as two tty_put_char() calls. Which works, but is stupid, and has caused problems before too with bad interactions with the write_room() logic. The generic USB serial driver had that problem, for example. Now the pty layer had similar issues after being moved to the generic tty buffering code (in commit d945cb9cce20ac7143c2de8d88b187f62db99bdc: "pty: Rework the pty layer to use the normal buffering logic"). So stop doing the silly separate two writes, and do it as a single write instead. That's what the n_tty layer already does for the space expansion of tabs (XTABS), and it means that we'll now always have just a single write for the CRNL to match the single 'tty_write_room()' test, which hopefully means that the next time somebody screws up buffering, it won't cause weeks of debugging. Signed-off-by: Linus Torvalds <>
2009-09-05exec: do not sleep in TASK_TRACED under ->cred_guard_mutexOleg Nesterov3-38/+43
Tom Horsley reports that his debugger hangs when it tries to read /proc/pid_of_tracee/maps, this happens since "mm_for_maps: take ->cred_guard_mutex to fix the race with exec" 04b836cbf19e885f8366bccb2e4b0474346c02d commit in 2.6.31. But the root of the problem lies in the fact that do_execve() path calls tracehook_report_exec() which can stop if the tracer sets PT_TRACE_EXEC. The tracee must not sleep in TASK_TRACED holding this mutex. Even if we remove ->cred_guard_mutex from mm_for_maps() and proc_pid_attr_write(), another task doing PTRACE_ATTACH should not hang until it is killed or the tracee resumes. With this patch do_execve() does not use ->cred_guard_mutex directly and we do not hold it throughout, instead: - introduce prepare_bprm_creds() helper, it locks the mutex and calls prepare_exec_creds() to initialize bprm->cred. - install_exec_creds() drops the mutex after commit_creds(), and thus before tracehook_report_exec()->ptrace_stop(). or, if exec fails, free_bprm() drops this mutex when bprm->cred != NULL which indicates install_exec_creds() was not called. Reported-by: Tom Horsley <> Signed-off-by: Oleg Nesterov <> Acked-by: David Howells <> Cc: Roland McGrath <> Cc: James Morris <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2009-09-05page-allocator: always change pageblock ownership when anti-fragmentation is ↵Mel Gorman1-2/+4
disabled On low-memory systems, anti-fragmentation gets disabled as fragmentation cannot be avoided on a sufficiently large boundary to be worthwhile. Once disabled, there is a period of time when all the pageblocks are marked MOVABLE and the expectation is that they get marked UNMOVABLE at each call to __rmqueue_fallback(). However, when MAX_ORDER is large the pageblocks do not change ownership because the normal criteria are not met. This has the effect of prematurely breaking up too many large contiguous blocks. This is most serious on NOMMU systems which depend on high-order allocations to boot. This patch causes pageblocks to change ownership on every fallback when anti-fragmentation is disabled. This prevents the large blocks being prematurely broken up. This is a fix to commit 49255c619fbd482d704289b5eb2795f8e3b7ff2e [page allocator: move check for disabled anti-fragmentation out of fastpath] and the problem affects 2.6.31-rc8. Signed-off-by: Mel Gorman <> Tested-by: Paul Mundt <> Cc: David Howells <> Cc: Pekka Enberg <> Acked-by: Greg Ungerer <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2009-09-05nommu: fix error handling in do_mmap_pgoff()David Howells1-2/+1
Fix the error handling in do_mmap_pgoff(). If do_mmap_shared_file() or do_mmap_private() fail, we jump to the error_put_region label at which point we cann __put_nommu_region() on the region - but we haven't yet added the region to the tree, and so __put_nommu_region() may BUG because the region tree is empty or it may corrupt the region tree. To get around this, we can afford to add the region to the region tree before calling do_mmap_shared_file() or do_mmap_private() as we keep nommu_region_sem write-locked, so no-one can race with us by seeing a transient region. Signed-off-by: David Howells <> Acked-by: Pekka Enberg <> Acked-by: Paul Mundt <> Cc: Mel Gorman <> Acked-by: Greg Ungerer <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2009-09-05workqueues: introduce __cancel_delayed_work()Oleg Nesterov1-0/+15
cancel_delayed_work() has to use del_timer_sync() to guarantee the timer function is not running after return. But most users doesn't actually need this, and del_timer_sync() has problems: it is not useable from interrupt, and it depends on every lock which could be taken from irq. Introduce __cancel_delayed_work() which calls del_timer() instead. The immediate reason for this patch is but hopefully this helper makes sense anyway. As for 13757 bug, actually we need requeue_delayed_work(), but its semantics are not yet clear. Merge this patch early to resolves cross-tree interdependencies between input and infiniband. Signed-off-by: Oleg Nesterov <> Cc: Dmitry Torokhov <> Cc: Roland Dreier <> Cc: Stefan Richter <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2009-09-05firewire: sbp2: fix freeing of unallocated memoryStefan Richter1-4/+4
If a target writes invalid status (typically status of a command that already timed out), firewire-sbp2 attempts to put away an ORB that doesn't exist. Signed-off-by: Stefan Richter <>
2009-09-05firewire: ohci: fix Ricoh R5C832, video receptionStefan Richter1-0/+5
In dual-buffer DMA mode, no video frames are ever received from R5C832 by libdc1394. Fallback to packet-per-buffer DMA works reliably. Reported-by: Jonathan Cameron <> Signed-off-by: Stefan Richter <>
2009-09-05firewire: ohci: fix Agere FW643 and multiple camerasStefan Richter1-0/+9
An Agere FW643 OHCI 1.1 card works fine for video reception from one camera but fails early if receiving from two cameras. After a short while, no IR IRQ events occur and the context control register does not react anymore. This happens regardless whether both IR DMA contexts are dual-buffer or one is dual-buffer and the other packet-per-buffer. This can be worked around by disabling dual buffer DMA mode entirely. (Reported by Samuel Audet.) In another report (by Jonathan Cameron), an FW643 works OK with two cameras in dual buffer mode. Whether this is due to different chip revisions or different usage patterns (different video formats) is not yet clear. However, as far as the current capabilities of firewire-core's isochronous I/O interface are concerned, simply switching off dual-buffer on non-working and working FW643s alike is not a problem in practice. We only need to revisit this issue if we are going to enhance the interface, e.g. so that applications can explicitly choose modes. Reported-by: Samuel Audet <> Reported-by: Jonathan Cameron <> Signed-off-by: Stefan Richter <>
2009-09-05firewire: core: fix crash in iso resource managementStefan Richter1-2/+2
This fixes a regression due to post 2.6.30 commit "firewire: core: do not DMA-map stack addresses" 6fdc03709433ccc2005f0f593ae9d9dd04f7b485. As David Moore noted, a previously correct sizeof() expression became wrong since the commit changed its argument from an array to a pointer. This resulted in an oops in ohci_cancel_packet in the shared workqueue thread's context when an isochronous resource was to be freed. Reported-by: Jonathan Cameron <> Signed-off-by: Stefan Richter <>
2009-09-04ocfs2: ocfs2_write_begin_nolock() should handle len=0Sunil Mushran1-2/+2
Bug introduced by mainline commit e7432675f8ca868a4af365759a8d4c3779a3d922 The bug causes ocfs2_write_begin_nolock() to oops when len=0. Signed-off-by: Sunil Mushran <> Cc: Signed-off-by: Joel Becker <>
2009-09-04dm snapshot: fix on disk chunk size validationMikulas Patocka2-8/+19
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 . Cc: Signed-off-by: Mikulas Patocka <> Signed-off-by: Alasdair G Kergon <>
2009-09-04dm exception store: split set_chunk_sizeMikulas Patocka2-0/+12
Break the function set_chunk_size to two functions in preparation for the fix in the following patch. Cc: Signed-off-by: Mikulas Patocka <> Signed-off-by: Alasdair G Kergon <>
2009-09-04dm snapshot: fix header corruption race on invalidationMikulas Patocka1-10/+34
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: Cc: Signed-off-by: Mikulas Patocka <> Signed-off-by: Alasdair G Kergon <>
2009-09-04dm snapshot: refactor zero_disk_area to use chunk_ioMikulas Patocka1-19/+7
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. Cc: Signed-off-by: Mikulas Patocka <> Signed-off-by: Alasdair G Kergon <>
2009-09-04dm log: userspace add luid to distinguish between concurrent log instancesJonathan Brassow4-13/+31
Device-mapper userspace logs (like the clustered log) are identified by a universally unique identifier (UUID). This identifier is used to associate requests from the kernel to a specific log in userspace. The UUID must be unique everywhere, since multiple machines may use this identifier when communicating about a particular log, as is the case for cluster logs. Sometimes, device-mapper/LVM may re-use a UUID. This is the case during pvmoves, when moving from one segment of an LV to another, or when resizing a mirror, etc. In these cases, a new log is created with the same UUID and loaded in the "inactive" slot. When a device-mapper "resume" is issued, the "live" table is deactivated and the new "inactive" table becomes "live". (The "inactive" table can also be removed via a device-mapper 'clear' command.) The above two issues were colliding. More than one log was being created with the same UUID, and there was no way to distinguish between them. So, sometimes the wrong log would be swapped out during the exchange. The solution is to create a locally unique identifier, 'luid', to go along with the UUID. This new identifier is used to determine exactly which log is being referenced by the kernel when the log exchange is made. The identifier is not universally safe, but it does not need to be, since create/destroy/suspend/resume operations are bound to a specific machine; and these are the operations that make up the exchange. Signed-off-by: Jonathan Brassow <> Signed-off-by: Alasdair G Kergon <>
2009-09-04dm raid1: do not allow log_failure variable to unset after being setJonathan Brassow1-1/+7
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. Cc: Signed-off-by: Jonathan Brassow <> Signed-off-by: Alasdair G Kergon <>