aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-04-19hwmon: Add submitting-patches checklist to documentationGuenter Roeck1-0/+109
When writing hardware monitoring drivers, there are some common pitfalls which keep coming up in code reviews. This patch provides a document describing all those pitfalls and how to avoid them. Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Jean Delvare <[email protected]>
2011-04-19netfilter: ipset: Fix the order of listing of setsJozsef Kadlecsik1-8/+10
A restoreable saving of sets requires that list:set type of sets come last and the code part which should have taken into account the ordering was broken. The patch fixes the listing order. Signed-off-by: Jozsef Kadlecsik <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2011-04-19block: Remove the extra check in queue_requests_storeTao Ma1-2/+2
In queue_requests_store, the code looks like if (rl->count[BLK_RW_SYNC] >= q->nr_requests) { blk_set_queue_full(q, BLK_RW_SYNC); } else if (rl->count[BLK_RW_SYNC]+1 <= q->nr_requests) { blk_clear_queue_full(q, BLK_RW_SYNC); wake_up(&rl->wait[BLK_RW_SYNC]); } If we don't satify the situation of "if", we can get that rl->count[BLK_RW_SYNC} < q->nr_quests. It is the same as rl->count[BLK_RW_SYNC]+1 <= q->nr_requests. All the "else" should satisfy the "else if" check so it isn't needed actually. Signed-off-by: Tao Ma <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2011-04-19block, blk-sysfs: Fix an err return path in blk_register_queue()Liu Yuan1-1/+3
We do not call blk_trace_remove_sysfs() in err return path if kobject_add() fails. This path fixes it. Cc: [email protected] Signed-off-by: Liu Yuan <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2011-04-19block: remove stale kerneldoc member from __blk_run_queue()Jens Axboe1-1/+0
We don't pass in a 'force_kblockd' anymore, get rid of the stsale comment. Reported-by: Mike Snitzer <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2011-04-19block: get rid of QUEUE_FLAG_REENTERJens Axboe5-54/+20
We are currently using this flag to check whether it's safe to call into ->request_fn(). If it is set, we punt to kblockd. But we get a lot of false positives and excessive punts to kblockd, which hurts performance. The only real abuser of this infrastructure is SCSI. So export the async queue run and convert SCSI over to use that. There's room for improvement in that SCSI need not always use the async call, but this fixes our performance issue and they can fix that up in due time. Signed-off-by: Jens Axboe <[email protected]>
2011-04-19perf, x86: Fix AMD family 15h FPU event constraintsRobert Richter1-3/+17
Depending on the unit mask settings some FPU events may be scheduled only on cpu counter #3. This patch fixes this. Signed-off-by: Robert Richter <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2011-04-19perf, x86: Fix pre-defined cache-misses event for AMD family 15h cpusAndre Przywara1-1/+1
With AMD cpu family 15h a unit mask was introduced for the Data Cache Miss event (0x041/L1-dcache-load-misses). We need to enable bit 0 (first data cache miss or streaming store to a 64 B cache line) of this mask to proper count data cache misses. Now we set this bit for all families and models. In case a PMU does not implement a unit mask for event 0x041 the bit is ignored. Signed-off-by: Andre Przywara <[email protected]> Signed-off-by: Robert Richter <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2011-04-19cfq-iosched: read_lock() does not always imply rcu_read_lock()Jens Axboe1-14/+6
For some configurations of CONFIG_PREEMPT that is not true. So get rid of __call_for_each_cic() and always uses the explicitly rcu_read_lock() protected call_for_each_cic() instead. This fixes a potential bug related to IO scheduler removal or online switching. Thanks to Paul McKenney for clarifying this. Signed-off-by: Jens Axboe <[email protected]>
2011-04-18Linux 2.6.39-rc4Linus Torvalds1-1/+1
2011-04-18Merge branch 'for-39-rc4' of git://codeaurora.org/quic/kernel/davidb/linux-msmLinus Torvalds2-5/+2
* 'for-39-rc4' of git://codeaurora.org/quic/kernel/davidb/linux-msm: msm: timer: fix missing return value msm: Remove extraneous ffa device check
2011-04-18Merge branch 'for-linus' of ↵Linus Torvalds8-26/+361
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: xen-kbdfront - fix mouse getting stuck after save/restore Input: estimate number of events per packet Input: evdev - indicate buffer overrun with SYN_DROPPED Input: document event types and codes and their intended use Input: add KEY_IMAGES specifically for AL Image Browser Input: twl4030_keypad - fix potential NULL dereference in twl4030_kp_probe() Input: h3600_ts - fix error handling at connect Input: twl4030_keypad - avoid potential NULL-pointer dereference
2011-04-18Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-blockLinus Torvalds18-187/+186
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: block: add blk_run_queue_async block: blk_delay_queue() should use kblockd workqueue md: fix up raid1/raid10 unplugging. md: incorporate new plugging into raid5. md: provide generic support for handling unplug callbacks. md - remove old plugging code. md/dm - remove remains of plug_fn callback. md: use new plugging interface for RAID IO. block: drop queue lock before calling __blk_run_queue() for kblockd punt Revert "block: add callback function for unplug notification" block: Enhance new plugging support to support general callbacks
2011-04-18block: kill blk_flush_plug_list() exportJens Axboe1-1/+0
With all drivers and file systems converted, we only have in-core use of this function. So remove the export. Reporteed-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2011-04-18Merge branch 'merge' of ↵Linus Torvalds11-26/+81
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc/powermac: Build fix with SMP and CPU hotplug powerpc/perf_event: Skip updating kernel counters if register value shrinks powerpc: Don't write protect kernel text with CONFIG_DYNAMIC_FTRACE enabled powerpc: Fix oops if scan_dispatch_log is called too early powerpc/pseries: Use a kmem cache for DTL buffers powerpc/kexec: Fix regression causing compile failure on UP powerpc/85xx: disable Suspend support if SMP enabled powerpc/e500mc: Remove CPU_FTR_MAYBE_CAN_NAP/CPU_FTR_MAYBE_CAN_DOZE powerpc/book3e: Fix CPU feature handling on 64-bit e5500 powerpc: Check device status before adding serial device powerpc/85xx: Don't add disabled PCIe devices
2011-04-18Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstableLinus Torvalds14-233/+430
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (24 commits) Btrfs: fix free space cache leak Btrfs: avoid taking the chunk_mutex in do_chunk_alloc Btrfs end_bio_extent_readpage should look for locked bits Btrfs: don't force chunk allocation in find_free_extent Btrfs: Check validity before setting an acl Btrfs: Fix incorrect inode nlink in btrfs_link() Btrfs: Check if btrfs_next_leaf() returns error in btrfs_real_readdir() Btrfs: Check if btrfs_next_leaf() returns error in btrfs_listxattr() Btrfs: make uncache_state unconditional btrfs: using cached extent_state in set/unlock combinations Btrfs: avoid taking the trans_mutex in btrfs_end_transaction Btrfs: fix subvolume mount by name problem when default mount subvolume is set fix user annotation in ioctl.c Btrfs: check for duplicate iov_base's when doing dio reads btrfs: properly handle overlapping areas in memmove_extent_buffer Btrfs: fix memory leaks in btrfs_new_inode() Btrfs: check for duplicate iov_base's when doing dio reads Btrfs: reuse the extent_map we found when calling btrfs_get_extent Btrfs: do not use async submit for small DIO io's Btrfs: don't split dio bios if we don't have to ...
2011-04-18proc: do proper range check on readdir offsetLinus Torvalds1-2/+7
Rather than pass in some random truncated offset to the pid-related functions, check that the offset is in range up-front. This is just cleanup, the previous commit fixed the real problem. Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]>
2011-04-18next_pidmap: fix overflow conditionLinus Torvalds2-2/+5
next_pidmap() just quietly accepted whatever 'last' pid that was passed in, which is not all that safe when one of the users is /proc. Admittedly the proc code should do some sanity checking on the range (and that will be the next commit), but that doesn't mean that the helper functions should just do that pidmap pointer arithmetic without checking the range of its arguments. So clamp 'last' to PID_MAX_LIMIT. The fact that we then do "last+1" doesn't really matter, the for-loop does check against the end of the pidmap array properly (it's only the actual pointer arithmetic overflow case we need to worry about, and going one bit beyond isn't going to overflow). [ Use PID_MAX_LIMIT rather than pid_max as per Eric Biederman ] Reported-by: Tavis Ormandy <[email protected]> Analyzed-by: Robert Święcki <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Pavel Emelyanov <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-04-18nfsd4: fix struct file leak on delegationJ. Bruce Fields1-0/+1
Introduced by acfdf5c383b38f7f4dddae41b97c97f1ae058f49. Cc: [email protected] Reported-by: Gerhard Heift <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2011-04-18Input: xen-kbdfront - fix mouse getting stuck after save/restoreIgor Mammedov1-1/+12
Mouse gets "stuck" after restore of PV guest but buttons are in working condition. If driver has been configured for ABS coordinates at start it will get XENKBD_TYPE_POS events and then suddenly after restore it'll start getting XENKBD_TYPE_MOTION events, that will be dropped later and they won't get into user-space. Regression was introduced by hunk 5 and 6 of 5ea5254aa0ad269cfbd2875c973ef25ab5b5e9db ("Input: xen-kbdfront - advertise either absolute or relative coordinates"). Driver on restore should ask xen for request-abs-pointer again if it is available. So restore parts that did it before 5ea5254. Acked-by: Olaf Hering <[email protected]> Signed-off-by: Igor Mammedov <[email protected]> [v1: Expanded the commit description] Signed-off-by: Konrad Rzeszutek Wilk <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2011-04-18Input: estimate number of events per packetJeff Brown2-0/+46
Calculate a default based on the number of ABS axes, REL axes, and MT slots for the device during input device registration. Signed-off-by: Jeff Brown <[email protected]> Reviewed-by: Henrik Rydberg <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2011-04-18x86, gart: Make sure GART does not map physmem above 1TBJoerg Roedel1-1/+8
The GART can only map physical memory below 1TB. Make sure the gart driver in the kernel does not try to map memory above 1TB. Cc: <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: H. Peter Anvin <[email protected]>
2011-04-18x86, gart: Set DISTLBWALKPRB bit alwaysJoerg Roedel2-3/+3
The DISTLBWALKPRB bit must be set for the GART because the gatt table is mapped UC. But the current code does not set the bit at boot when the BIOS setup the aperture correctly. Fix that by setting this bit when enabling the GART instead of the other places. Cc: <[email protected]> Cc: Borislav Petkov <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: H. Peter Anvin <[email protected]>
2011-04-18x86, gart: Convert spaces to tabs in enable_gart_translationJoerg Roedel1-11/+11
Probably by copy&paste this function was indented by spaces. Convert this to tabs. Signed-off-by: Joerg Roedel <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: H. Peter Anvin <[email protected]>
2011-04-18GFS2: filesystem hang caused by incorrect lock orderBob Peterson6-21/+55
This patch fixes a deadlock in GFS2 where two processes are trying to reclaim an unlinked dinode: One holds the inode glock and calls gfs2_lookup_by_inum trying to look up the inode, which it can't, due to I_FREEING. The other has set I_FREEING from vfs and is at the beginning of gfs2_delete_inode waiting for the glock, which is held by the first. The solution is to add a new non_block parameter to the gfs2_iget function that causes it to return -ENOENT if the inode is being freed. Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2011-04-18GFS2: Don't try to deallocate unlinked inodes when mounted roSteven Whitehouse2-2/+7
This adds a couple of missing tests to avoid read-only nodes from attempting to deallocate unlinked inodes. Signed-off-by: Steven Whitehouse <[email protected]> Reported-by: Michel Andre de la Porte <[email protected]>
2011-04-18GFS2: directly write blocks past i_sizeBenjamin Marzinski1-10/+48
GFS2 was relying on the writepage code to write out the zeroed data for fallocate. However, with FALLOC_FL_KEEP_SIZE set, this may be past i_size. If it is, it will be ignored. To work around this, gfs2 now calls write_dirty_buffer directly on the buffer_heads when FALLOC_FL_KEEP_SIZE is set, and it's writing past i_size. This version is just a cleanup of my last version Signed-off-by: Benjamin Marzinski <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2011-04-18GFS2: write_end error path fails to unlock transaction lockBob Peterson1-1/+1
I did an audit of gfs2's transaction glock for bugzilla bug 658619 and ran across this: In function gfs2_write_end, in the unlikely event that gfs2_meta_inode_buffer returns an error, the code may forget to unlock the transaction lock because the "failed" label appears after the call to function gfs2_trans_end. Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2011-04-18Btrfs: fix free space cache leakChris Mason1-1/+1
The free space caching code was recently reworked to cache all the pages it needed instead of using find_get_page everywhere. One loop was missed though, so it ended up leaking pages. This fixes it to use our page array instead of find_get_page. Signed-off-by: Chris Mason <[email protected]>
2011-04-18block: add blk_run_queue_asyncChristoph Hellwig9-23/+36
Instead of overloading __blk_run_queue to force an offload to kblockd add a new blk_run_queue_async helper to do it explicitly. I've kept the blk_queue_stopped check for now, but I suspect it's not needed as the check we do when the workqueue items runs should be enough. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2011-04-18block: blk_delay_queue() should use kblockd workqueueJens Axboe1-1/+2
Reported-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2011-04-18RTC: rtc-omap: Fix a leak of the IRQ during init failureAxel Lin1-1/+1
In omap_rtc_probe error path, free_irq() was using NULL rather than the driver data as the data pointer so free_irq() wouldn't have matched. Signed-off-by: Axel Lin <[email protected]> Cc: "George G. Davis" <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/%3C1303005778.2889.2.camel%40phoenix%3E Signed-off-by: Thomas Gleixner <[email protected]>
2011-04-18posix clocks: Replace mutex with reader/writer semaphoreRichard Cochran2-17/+12
A dynamic posix clock is protected from asynchronous removal by a mutex. However, using a mutex has the unwanted effect that a long running clock operation in one process will unnecessarily block other processes. For example, one process might call read() to get an external time stamp coming in at one pulse per second. A second process calling clock_gettime would have to wait for almost a whole second. This patch fixes the issue by using a reader/writer semaphore instead of a mutex. Signed-off-by: Richard Cochran <[email protected]> Cc: John Stultz <[email protected]> Link: http://lkml.kernel.org/r/%3C20110330132421.GA31771%40riccoc20.at.omicron.at%3E Signed-off-by: Thomas Gleixner <[email protected]>
2011-04-18md: fix up raid1/raid10 unplugging.NeilBrown2-28/+20
We just need to make sure that an unplug event wakes up the md thread, which is exactly what mddev_check_plugged does. Also remove some plug-related code that is no longer needed. Signed-off-by: NeilBrown <[email protected]>
2011-04-18md: incorporate new plugging into raid5.NeilBrown1-7/+16
In raid5 plugging is used for 2 things: 1/ collecting writes that require a bitmap update 2/ collecting writes in the hope that we can create full stripes - or at least more-full. We now release these different sets of stripes when plug_cnt is zero. Also in make_request, we call mddev_check_plug to hopefully increase plug_cnt, and wake up the thread at the end if plugging wasn't achieved for some reason. Signed-off-by: NeilBrown <[email protected]>
2011-04-18md: provide generic support for handling unplug callbacks.NeilBrown2-0/+60
When an md device adds a request to a queue, it can call mddev_check_plugged. If this succeeds then we know that the md thread will be woken up shortly, and ->plug_cnt will be non-zero until then, so some processing can be delayed. If it fails, then no unplug callback is expected and the make_request function needs to do whatever is required to make the request happen. Signed-off-by: NeilBrown <[email protected]>
2011-04-18md - remove old plugging code.NeilBrown4-104/+8
md has some plugging infrastructure for RAID5 to use because the normal plugging infrastructure required a 'request_queue', and when called from dm, RAID5 doesn't have one of those available. This relied on the ->unplug_fn callback which doesn't exist any more. So remove all of that code, both in md and raid5. Subsequent patches with restore the plugging functionality. Signed-off-by: NeilBrown <[email protected]>
2011-04-18md/dm - remove remains of plug_fn callback.NeilBrown2-9/+0
Now that unplugging is done differently, the unplug_fn callback is never called, so it can be completely discarded. Signed-off-by: NeilBrown <[email protected]>
2011-04-18md: use new plugging interface for RAID IO.NeilBrown3-1/+10
md/raid submits a lot of IO from the various raid threads. So adding start/finish plug calls to those so that some plugging happens. Signed-off-by: NeilBrown <[email protected]>
2011-04-18block: drop queue lock before calling __blk_run_queue() for kblockd puntJens Axboe1-8/+25
If we know we are going to punt to kblockd, we can drop the queue lock before calling into __blk_run_queue() since it only does a safe bit test and a workqueue call. Since kblockd needs to grab this very lock as one of the first things it does, it's a good optimization to drop the lock before waking kblockd. Signed-off-by: Jens Axboe <[email protected]>
2011-04-18Revert "block: add callback function for unplug notification"Jens Axboe3-22/+0
MD can't use this since it really requires us to be able to keep more than a single piece of state for the unplug. Commit 048c9374 added the required support for MD, so get rid of this now unused code. This reverts commit f75664570d8b75469cc468f23c2b27220984983b. Conflicts: block/blk-core.c Signed-off-by: Jens Axboe <[email protected]>
2011-04-18block: Enhance new plugging support to support general callbacksNeilBrown2-1/+26
md/raid requires an unplug callback, but as it does not uses requests the current code cannot provide one. So allow arbitrary callbacks to be attached to the blk_plug. Signed-off-by: NeilBrown <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2011-04-17ip6_pol_route panic: Do not allow VLAN on loopbackKrishna Kumar1-1/+2
Several tests in the ipv6 routing code check IFF_LOOPBACK, and allowing stacking such as VLAN'ing on top of loopback results in a netdevice which reports IFF_LOOPBACK but really isn't the loopback device. Instead of spamming the ipv6 routing code with even more special tests, simply disallow VLAN over loopback. The result of this patch is: # modprobe 8021q # vconfig add lo 43 ERROR: trying to add VLAN #43 to IF -:lo:- error: Operation not supported Signed-off-by: Krishna Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-04-18powerpc/powermac: Build fix with SMP and CPU hotplugBenjamin Herrenschmidt1-3/+5
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-04-18powerpc/perf_event: Skip updating kernel counters if register value shrinksEric B Munson1-7/+30
Because of speculative event roll back, it is possible for some event coutners to decrease between reads on POWER7. This causes a problem with the way that counters are updated. Delta calues are calculated in a 64 bit value and the top 32 bits are masked. If the register value has decreased, this leaves us with a very large positive value added to the kernel counters. This patch protects against this by skipping the update if the delta would be negative. This can lead to a lack of precision in the coutner values, but from my testing the value is typcially fewer than 10 samples at a time. Signed-off-by: Eric B Munson <[email protected]> Cc: [email protected] Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-04-18powerpc: Don't write protect kernel text with CONFIG_DYNAMIC_FTRACE enabledStefan Roese1-1/+1
This problem was noticed on an MPC855T platform. Ftrace did oops when trying to write to the kernel text segment. Many thanks to Joakim for finding the root cause of this problem. Signed-off-by: Stefan Roese <[email protected]> Cc: Joakim Tjernlund <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Steven Rostedt <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-04-18powerpc: Fix oops if scan_dispatch_log is called too earlyAnton Blanchard1-0/+3
We currently enable interrupts before the dispatch log for the boot cpu is setup. If a timer interrupt comes in early enough we oops in scan_dispatch_log: Unable to handle kernel paging request for data at address 0x00000010 ... .scan_dispatch_log+0xb0/0x170 .account_system_vtime+0xa0/0x220 .irq_enter+0x88/0xc0 .do_IRQ+0x48/0x230 The patch below adds a check to scan_dispatch_log to ensure the dispatch log has been allocated. Signed-off-by: Anton Blanchard <[email protected]> Cc: <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-04-18powerpc/pseries: Use a kmem cache for DTL buffersNishanth Aravamudan1-2/+10
PAPR specifies that DTL buffers can not cross AMS environments (aka CMO in the PAPR) and can not cross a memory entitlement granule boundary (4k). This is found in section 14.11.3.2 H_REGISTER_VPA of the PAPR. kmalloc does not guarantee an alignment of the allocation, though, beyond 8 bytes (at least in my understanding). Create a special kmem cache for DTL buffers with the alignment requirement. Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-04-18powerpc/kexec: Fix regression causing compile failure on UPPaul Gortmaker1-6/+6
Recent commit b987812b3fcaf70fdf0037589e5d2f5f2453e6ce caused a compile failure on UP because a considerably large block of the file was included within CONFIG_SMP, hence making a stub function not exposed on UP builds when it needed to be. Relocate the stub to the #else /* ! CONFIG_SMP */ section and also annotate the relevant else/endif so that nobody else falls into the same trap I did. Reported-by: Michael Guntsche <[email protected]> Signed-off-by: Paul Gortmaker <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-04-18Merge remote branch 'kumar/merge' into mergeBenjamin Herrenschmidt5-7/+26