commit ada9c93312f7ec49514c68c211595ce2601cebae Author: Randy Dunlap Date: Tue Jun 14 15:50:11 2011 -0700 signal.c: fix kernel-doc notation Fix kernel-doc warnings in signal.c: Warning(kernel/signal.c:2374): No description found for parameter 'nset' Warning(kernel/signal.c:2374): Excess function parameter 'set' description in 'sys_rt_sigprocmask' Signed-off-by: Randy Dunlap Signed-off-by: Linus Torvalds commit 60b8b1de0dd2bf246f0e074d287bb3f0bc42a755 Author: Andy Whitcroft Date: Tue Jun 14 12:45:10 2011 -0700 x86 idle: APM requires pm_idle/default_idle unconditionally when a module [ Also from Ben Hutchings and Vitaliy Ivanov ] Commit 06ae40ce073d ("x86 idle: EXPORT_SYMBOL(default_idle, pm_idle) only when APM demands it") removed the export for pm_idle/default_idle unless the apm module was modularised and CONFIG_APM_CPU_IDLE was set. But the apm module uses pm_idle/default_idle unconditionally, CONFIG_APM_CPU_IDLE only affects the bios idle threshold. Adjust the export accordingly. [ Used #ifdef instead of #if defined() as it's shorter, and what both Ben and Vitaliy used.. Andy, you're out-voted ;) - Linus ] Reported-by: Randy Dunlap Acked-by: Jiri Kosina Acked-by: Ingo Molnar Acked-by: Len Brown Signed-off-by: Andy Whitcroft Signed-off-by: Vitaliy Ivanov Signed-off-by: Ben Hutchings Signed-off-by: Linus Torvalds commit 3a2289a4a317e0290a8bc7af28c62c9830cb12e5 Merge: ca54320 734c3ce Author: Linus Torvalds Date: Tue Jun 14 11:28:54 2011 -0700 Merge branch 'for-linus-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu * 'for-linus-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: use kernel processor defines for conditional optimizations m68knommu: create config options for CPU classes m68knommu: fix linker script exported name sections commit ca5432010e45d7f809b441b0c1e85e84b039cd85 Merge: 4068b00 4e78c72 Author: Linus Torvalds Date: Tue Jun 14 11:28:38 2011 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: TOMOYO: Fix oops in tomoyo_mount_acl(). commit 4068b00e9d0542653b26c04dcf05ab0c80bbbbb2 Merge: f39e8409 ff71db2f Author: Linus Torvalds Date: Tue Jun 14 11:25:56 2011 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/avr32-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/avr32-2.6: avr32, exec: remove redundant set_fs(USER_DS) avr32: make intc_resume() return void to conform to syscore_ops avr32: add some more at91 to cpu.h definition avr32: set CONFIG_CC_OPTIMIZE_FOR_SIZE=y for all defconfigs avr32/at32ap: fix mapping of platform device id for USART avr32: fix use of non-existing portnr variable in at32_map_usart() commit f39e8409955fad210a9a7169cc53c4c18daaef3a Merge: 6211b3e 66aa696 Author: Linus Torvalds Date: Tue Jun 14 11:25:32 2011 -0700 Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm: Compare only lower 32 bits of framebuffer map offsets drm/i915: Don't leak in i915_gem_shmem_pread_slow() drm/radeon/kms: do bounds checking for 3D_LOAD_VBPNTR and bump array limit drm/radeon/kms: fix mac g5 quirk x86/uv/x2apic: update for change in pci bridge handling. alpha, drm: Remove obsolete Alpha support in MGA DRM code alpha/drm: Cleanup Alpha support in DRM generic code savage: remove unnecessary if statement drm/radeon: fix GUI idle IH debug statements drm/radeon/kms: check modes against max pixel clock drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl commit 6211b3e1bba952fcd16d477b5dafb1904bac0e48 Merge: 81eb3dd 1252b30 Author: Linus Torvalds Date: Tue Jun 14 11:24:40 2011 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: [CIFS] update cifs version to 1.73 [CIFS] trivial cleanup fscache cFYI and cERROR messages cifs: correctly handle NULL tcon pointer in CIFSTCon cifs: show sec= option in /proc/mounts cifs: don't allow cifs_reconnect to exit with NULL socket pointer CIFS: Fix sparse error commit 81eb3dd8438802138ac9ce12428632f35562c060 Merge: 3e483f4 fcde907 Author: Linus Torvalds Date: Tue Jun 14 11:21:21 2011 -0700 Merge branch 'for-linus' of git://neil.brown.name/md * 'for-linus' of git://neil.brown.name/md: md/raid5: remove unusual use of bio_iovec_idx() md/raid5: fix FUA request handling in ops_run_io() md/raid5: fix raid5_set_bi_hw_segments md:Documentation/md.txt - fix typo md/bitmap: remove unused fields from struct bitmap md/bitmap: use proper accessor macro md: check ->hot_remove_disk when removing disk md: Using poll /proc/mdstat can monitor the events of adding a spare disks MD: use is_power_of_2 macro MD: raid5 do not set fullsync MD: support initial bitmap creation in-kernel MD: add sync_super to mddev_t struct MD: raid1 changes to allow use by device mapper MD: move thread wakeups into resume MD: possible typo MD: no sync IO while suspended MD: no integrity register if no gendisk commit 3e483f46756d9318fb0c59b01d5c8a26c2191d15 Merge: 2c53b43 13f0675 Author: Linus Torvalds Date: Tue Jun 14 11:19:27 2011 -0700 Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq: [CPUFREQ] Remove cpufreq_stats sysfs entries on module unload. MAINTAINERS: Update CPU FREQUENCY patterns commit 1252b3013b790c77e1c4f077a40542f86df37fb4 Author: Steve French Date: Tue Jun 14 16:19:54 2011 +0000 [CIFS] update cifs version to 1.73 Signed-off-by: Steve French commit 040d15c86747cf44fcf6b8ee19d805d4ef20caf3 Author: Steve French Date: Tue Jun 14 15:51:18 2011 +0000 [CIFS] trivial cleanup fscache cFYI and cERROR messages ... for uniformity and cleaner debug logs. Signed-off-by: Suresh Jayaraman Signed-off-by: Steve French commit ff71db2f0784cfff38fa7b55908867a24ccc3216 Author: Mathias Krause Date: Fri Jun 10 15:09:05 2011 +0200 avr32, exec: remove redundant set_fs(USER_DS) The address limit is already set in flush_old_exec() so this set_fs(USER_DS) is redundant. Signed-off-by: Mathias Krause Signed-off-by: Hans-Christian Egtvedt commit c162755491f7ca9853cb9f2aaa3ff3677c1bda78 Author: Hans-Christian Egtvedt Date: Mon Jun 6 18:19:20 2011 +0200 avr32: make intc_resume() return void to conform to syscore_ops This patch removes the unneeded, and now wrong, return 0 from intc_resume() and lets the function return void instead. This matches the resume callback in struct syscore_ops. Signed-off-by: Hans-Christian Egtvedt commit 3000f0077a5745918830f40826c23fe5bf934b8b Author: Nicolas Ferre Date: Sun May 15 00:23:32 2011 +0200 avr32: add some more at91 to cpu.h definition Somme common drivers will need those at91 cpu_is_xxx() definitions. Those definitions are already in Linus' tree so if we want to use them in common drivers, we will need them in AVR32 cpu.h file. Signed-off-by: Nicolas Ferre Acked-by: Hans-Christian Egtvedt commit a527a1453dd6dd89f07f1e5b2d24fc6559922461 Author: Hans-Christian Egtvedt Date: Wed Jun 1 15:10:49 2011 +0200 avr32: set CONFIG_CC_OPTIMIZE_FOR_SIZE=y for all defconfigs This patch makes sure the kconfig option CC_OPTIMIZE_FOR_SIZE is set to yes for all default configuration files. This ensures the kernel is optimized for size, and avoids potential relocation truncated to fit problems. Signed-off-by: Hans-Christian Egtvedt commit 4137b31566fd112c8e2d9d4701de5e7a000bcc2d Author: Hans-Christian Egtvedt Date: Wed Jun 8 10:47:25 2011 +0200 avr32/at32ap: fix mapping of platform device id for USART This patch will fix the mapping of the platform device id when mapping USART peripheral ID to UART platform device id. Not setting the platform device id will in most cases (when you map USART > 0 to UART 0) make the console not available. Signed-off-by: Hans-Christian Egtvedt commit 7bbf1d46b28455aed6aa6df772b91d51408c6c81 Author: Hans-Christian Egtvedt Date: Wed Jun 1 11:08:01 2011 +0200 avr32: fix use of non-existing portnr variable in at32_map_usart() This patch fixes the use of the non-existing portnr variable in at32_map_usart() to use the provided line number instead. Typo was introduced in commit 2b348e2f82f532e3aff8e0ce9293033b3294c1e0. Signed-off-by: Hans-Christian Egtvedt commit 4e78c724d47e2342aa8fde61f6b8536f662f795f Author: Tetsuo Handa Date: Mon Jun 13 13:49:11 2011 +0900 TOMOYO: Fix oops in tomoyo_mount_acl(). In tomoyo_mount_acl() since 2.6.36, kern_path() was called without checking dev_name != NULL. As a result, an unprivileged user can trigger oops by issuing mount(NULL, "/", "ext3", 0, NULL) request. Fix this by checking dev_name != NULL before calling kern_path(dev_name). Signed-off-by: Tetsuo Handa Cc: stable@kernel.org Signed-off-by: James Morris commit fcde90759a985d8bfa4391346a821cc12fc16207 Author: Namhyung Kim Date: Tue Jun 14 14:23:57 2011 +1000 md/raid5: remove unusual use of bio_iovec_idx() In the bio_for_each_segment loop, bvl always points current bio_vec, so the same as bio_iovec_idx(, i). Let's get rid of it. Cc: Dan Williams Signed-off-by: Namhyung Kim Signed-off-by: NeilBrown commit b062962edb086011e94ec4d9eb3f6a6d814f2a8f Author: Namhyung Kim Date: Tue Jun 14 14:20:19 2011 +1000 md/raid5: fix FUA request handling in ops_run_io() Commit e9c7469bb4f5 ("md: implment REQ_FLUSH/FUA support") introduced R5_WantFUA flag and set rw to WRITE_FUA in that case. However remaining code still checks whether rw is exactly same as WRITE or not, so FUAed-write ends up with being treated as READ. Fix it. This bug has been present since 2.6.37 and the fix is suitable for any -stable kernel since then. It is not clear why this has not caused more problems. Cc: Tejun Heo Cc: stable@kernel.org Signed-off-by: Namhyung Kim Signed-off-by: NeilBrown commit 9b2dc8b665932a8e681a7ab3237f60475e75e161 Author: Namhyung Kim Date: Mon Jun 13 14:48:22 2011 +0900 md/raid5: fix raid5_set_bi_hw_segments The @bio->bi_phys_segments consists of active stripes count in the lower 16 bits and processed stripes count in the upper 16 bits. So logical-OR operator should be bitwise one. This bug has been present since 2.6.27 and the fix is suitable for any -stable kernel since then. Fortunately the bad code is only used on error paths and is relatively unlikely to be hit. Cc: stable@kernel.org Signed-off-by: Namhyung Kim Signed-off-by: NeilBrown commit 734c3ce3bd4d51c932893b9f6d32b9ded31acdff Author: Greg Ungerer Date: Thu Jun 2 16:07:33 2011 +1000 m68k: use kernel processor defines for conditional optimizations Older m68k-linux compilers will include pre-defined symbols that confuse what processor it is being targeted for. For example gcc-4.1.2 will pre-define __mc68020__ even if you specify the target processor as -m68000 on the gcc command line. Newer versions of gcc have this corrected. In a few places the m68k code uses defined(__mc68020__) for optimizations that include instructions that are specific to the CPU 68020 and above. When compiling with older compilers this will be true even when we have selected to compile for the older 68000 processors. Switch to using the kernel processor defines, CONFIG_M68020 and friends. Signed-off-by: Greg Ungerer commit 62356725987fa44bbebeb656b2a0d8c803e32ef2 Author: Greg Ungerer Date: Thu Jun 2 15:50:48 2011 +1000 m68knommu: create config options for CPU classes There are 3 families of CPU core types that we support in the m68knommu architecture branch. They are . traditional 68000 . CPU32 (a 68020 core derivative without MMU or bitfield instructions) . ColdFire It will be useful going forward to have a CONFIG_ option defined for each type. We already have one for ColdFire (CONFIG_COLDFIRE), so add for the other 2 families, CONFIG_M68000 and CONFIG_MCPU32. Signed-off-by: Greg Ungerer commit dab104a73694b06fe4a162cb39d678716da62a67 Author: Greg Ungerer Date: Thu Jun 2 14:09:32 2011 +1000 m68knommu: fix linker script exported name sections The recent commit titled "module: Sort exported symbols" (f02e8a65) changed the exported symbol name sections. Bring the m68knommu linker script into line with those changes - including the sorting of the symbol names. Signed-off-by: Greg Ungerer commit 66aa6962ff520804f9874e57ea97995153f499d8 Author: Tormod Volden Date: Mon May 30 19:45:43 2011 +0000 drm: Compare only lower 32 bits of framebuffer map offsets Drivers using multiple framebuffers got broken by commit 41c2e75e60200a860a74b7c84a6375c105e7437f which ignored the framebuffer (or register) map offset when looking for existing maps. The rationale was that the kernel-userspace ABI is fixed at a 32-bit offset, so the real offsets could not always be handed over for comparison. Instead of ignoring the offset we will compare the lower 32 bit. Drivers using multiple framebuffers should just make sure that the lower 32 bit are different. The existing drivers in question are practically limited to 32-bit systems so that should be fine for them. It is assumed that current drivers always specify a correct framebuffer map offset, even if this offset was ignored since above commit. So this patch should not change anything for drivers using only one framebuffer. Drivers needing multiple framebuffers with 64-bit map offsets will need to cook up something, for instance keeping an ID in the lower bit which is to be aligned away when it comes to using the offset. All of above applies to _DRM_REGISTERS as well. Signed-off-by: Tormod Volden Signed-off-by: Dave Airlie commit b65552f06ca866f587a0a50d1f4dbdd3a00ec532 Author: Jesper Juhl Date: Sun Jun 12 20:53:44 2011 +0000 drm/i915: Don't leak in i915_gem_shmem_pread_slow() It seems to me that we are leaking 'user_pages' in drivers/gpu/drm/i915/i915_gem.c::i915_gem_shmem_pread_slow() if read_cache_page_gfp() fails. Signed-off-by: Jesper Juhl Signed-off-by: Chris Wilson Signed-off-by: Dave Airlie commit a27bb4b209dd6c327fa4e7185f2487f9508a58db Author: Marek Olšák Date: Fri Jun 10 14:41:26 2011 +0000 drm/radeon/kms: do bounds checking for 3D_LOAD_VBPNTR and bump array limit To my knowledge, the limit is 16 on r300. (the docs don't say what the limit is) The lack of bounds checking can be abused to do all sorts of things (from bypassing parts of the CS checker to crashing the kernel). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36745 Cc: stable@kernel.org Signed-off-by: Marek Olšák Signed-off-by: Dave Airlie commit ab21e60beaa96f2c55604f633dfe74076c531df7 Author: Alex Deucher Date: Mon Jun 6 12:53:30 2011 -0400 drm/radeon/kms: fix mac g5 quirk Apple uses the same subsystem pci ids for lots of hardware much of which is wired up differently. In this case, the G5 imac and the G5 tower. Only apply the quirk configuration to G5 towers. Reported-by: Joachim Henke Signed-off-by: Alex Deucher Cc: Joachim Henke Cc: Michel Dänzer Signed-off-by: Dave Airlie commit 7ad35cf288fd63a19bf50e490440a992de808b2b Author: Dave Airlie Date: Wed May 25 14:00:49 2011 +1000 x86/uv/x2apic: update for change in pci bridge handling. When I added 3448a19da479b6bd1e28e2a2be9fa16c6a6feb39 I forgot about the special uv handling code for this, so this patch fixes it up. Acked-by: Jesse Barnes Acked-by: Ingo Molnar Signed-off-by: Dave Airlie commit 83533c132a55aac735028f6fb9b956e8c078db1f Author: Jay Estabrook Date: Thu Jun 9 18:19:12 2011 -0400 alpha, drm: Remove obsolete Alpha support in MGA DRM code Remove an obsolete Alpha adjustment in the drm for MGA on Alpha. Signed-off-by: Jay Estabrook Tested-by: Matt Turner Signed-off-by: Dave Airlie commit 82ba3fef67829813d0ed4c45231235084a07f081 Author: Jay Estabrook Date: Thu Jun 9 18:18:39 2011 -0400 alpha/drm: Cleanup Alpha support in DRM generic code Remove an obsolete Alpha adjustment, and modify another, to go with the current Alpha architecture support. Signed-off-by: Jay Estabrook Tested-by: Matt Turner Signed-off-by: Dave Airlie commit 96bf8bd1c953c3b9d89eac9f13dfdbf5e580060f Author: Greg Dietsche Date: Mon Jun 13 09:40:38 2011 -0500 savage: remove unnecessary if statement the code always returns ret regardless, so if(ret) check is unnecessary. v2: fixed up the spelling. Signed-off-by: Greg Dietsche Reviewed-by: Nicolas Kaiser Signed-off-by: Dave Airlie commit 8d1bca328b7c17af33bcf966d799c556ecbf370f Author: Jeff Layton Date: Sat Jun 11 21:17:10 2011 -0400 cifs: correctly handle NULL tcon pointer in CIFSTCon Long ago (in commit 00e485b0), I added some code to handle share-level passwords in CIFSTCon. That code ignored the fact that it's legit to pass in a NULL tcon pointer when connecting to the IPC$ share on the server. This wasn't really a problem until recently as we only called CIFSTCon this way when the server returned -EREMOTE. With the introduction of commit c1508ca2 however, it gets called this way on every mount, causing an oops when share-level security is in effect. Fix this by simply treating a NULL tcon pointer as if user-level security were in effect. I'm not aware of any servers that protect the IPC$ share with a specific password anyway. Also, add a comment to the top of CIFSTCon to ensure that we don't make the same mistake again. Cc: Reported-by: Martijn Uffing Signed-off-by: Jeff Layton Signed-off-by: Steve French commit 3e715513643f0207c8f3c22010b54954cd697474 Author: Jeff Layton Date: Mon Jun 13 11:50:41 2011 -0400 cifs: show sec= option in /proc/mounts Signed-off-by: Jeff Layton Signed-off-by: Steve French commit 7fdbaa1b8daa1009b705985b903e3d2ebccad456 Author: Jeff Layton Date: Fri Jun 10 16:14:57 2011 -0400 cifs: don't allow cifs_reconnect to exit with NULL socket pointer It's possible for the following set of events to happen: cifsd calls cifs_reconnect which reconnects the socket. A userspace process then calls cifs_negotiate_protocol to handle the NEGOTIATE and gets a reply. But, while processing the reply, cifsd calls cifs_reconnect again. Eventually the GlobalMid_Lock is dropped and the reply from the earlier NEGOTIATE completes and the tcpStatus is set to CifsGood. cifs_reconnect then goes through and closes the socket and sets the pointer to zero, but because the status is now CifsGood, the new socket is not created and cifs_reconnect exits with the socket pointer set to NULL. Fix this by only setting the tcpStatus to CifsGood if the tcpStatus is CifsNeedNegotiate, and by making sure that generic_ip_connect is always called at least once in cifs_reconnect. Note that this is not a perfect fix for this issue. It's still possible that the NEGOTIATE reply is handled after the socket has been closed and reconnected. In that case, the socket state will look correct but it no NEGOTIATE was performed on it be for the wrong socket. In that situation though the server should just shut down the socket on the next attempted send, rather than causing the oops that occurs today. Cc: # .38.x: fd88ce9: [CIFS] cifs: clarify the meaning of tcpStatus == CifsGood Reported-and-Tested-by: Ben Greear Signed-off-by: Jeff Layton Signed-off-by: Steve French commit cd51875d53ae1459a2b09b4338166a218c0635a7 Author: Pavel Shilovsky Date: Thu Jun 9 12:58:53 2011 +0400 CIFS: Fix sparse error cifs_sb_master_tlink was declared as inline, but without a definition. Remove the declaration and move the definition up. Signed-off-by: Pavel Shilovsky Reviewed-by: Jeff Layton Signed-off-by: Steve French commit 13f067537f34456443f61c950cd6dc37d1d5f3ee Author: Dave Jones Date: Sun Jun 12 16:35:28 2011 -0400 [CPUFREQ] Remove cpufreq_stats sysfs entries on module unload. cpufreq_stats leaves behind its sysfs entries, which causes a panic when something stumbled across them. (Discovered by unloading cpufreq_stats while powertop was loaded). Signed-off-by: Dave Jones Cc: stable@kernel.org commit 89b882a25e703b72c3e84c582357e3e864d8ccca Author: Joe Perches Date: Wed Jun 1 10:59:10 2011 -0700 MAINTAINERS: Update CPU FREQUENCY patterns Commit bb0a56ecc4ba ("[CPUFREQ] Move x86 drivers to drivers/cpufreq/") moved the files, remove the old pattern. Signed-off-by: Joe Perches Signed-off-by: Dave Jones commit 303c805cb4dc1f5bc1d21f1c3757da0eae1e4f84 Author: Ilija Hadzic Date: Tue Jun 7 14:54:48 2011 -0400 drm/radeon: fix GUI idle IH debug statements debug statement for GUI idle interrupt is wrong and incorrectly reports CP EOP interrupt; trivial issue, but confusing for someone trying to distinguish interrupt sources while debugging ... fixed Signed-off-by: Ilija Hadzic Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie commit b20f9bef8d9ff54be266062eae365ebf4b12ca64 Author: Alex Deucher Date: Wed Jun 8 13:01:11 2011 -0400 drm/radeon/kms: check modes against max pixel clock Filter out modes that are higher than the max pixel clock. Signed-off-by: Alex Deucher Signed-off-by: Dave Airlie commit 618c75e491a5a50cd3819eaf5f853fd87df3ae42 Author: Sascha Hauer Date: Fri Jun 3 12:54:14 2011 +0200 drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl The DRM_IOCTL_MODE_GETRESOURCES ioctl just returns bogus framebuffers. That is because the framebuffers for each file are in the filp_head member of struct drm_framebuffer, not in the head member. Signed-off-by: Sascha Hauer Signed-off-by: Dave Airlie commit f699bf2328521cc3e20c412fcdb9ffe1255c360f Author: NeilBrown Date: Thu Jun 9 11:43:04 2011 +1000 md:Documentation/md.txt - fix typo Reported-by: CoolCold Signed-off-by: NeilBrown commit 97b3d4aacfbd7186faf34597fcf1f55b8579be17 Author: Namhyung Kim Date: Thu Jun 9 11:43:01 2011 +1000 md/bitmap: remove unused fields from struct bitmap Get rid of ->syncchunk and ->counter_bits since they're never used. Also discard COUNTER_BYTE_RATIO which is unused. Signed-off-by: Namhyung Kim Signed-off-by: NeilBrown commit 27d5ea04d08bea37bf651090e5f3c573d2390df8 Author: Namhyung Kim Date: Thu Jun 9 11:42:57 2011 +1000 md/bitmap: use proper accessor macro Use COUNTER()/NEEDED() macro instead of open-coding them. Signed-off-by: Namhyung Kim Signed-off-by: NeilBrown commit 01393f3d5836b7d62e925e6f4658a7eb22b83a11 Author: Namhyung Kim Date: Thu Jun 9 11:42:54 2011 +1000 md: check ->hot_remove_disk when removing disk Check pers->hot_remove_disk instead of pers->hot_add_disk in slot_store() during disk removal. The linear personality only has ->hot_add_disk and no ->hot_remove_disk, so that removing disk in the array resulted to following kernel bug: $ sudo mdadm --create /dev/md0 --level=linear --raid-devices=4 /dev/loop[0-3] $ echo none | sudo tee /sys/block/md0/md/dev-loop2/slot BUG: unable to handle kernel NULL pointer dereference at (null) IP: [< (null)>] (null) PGD c9f5d067 PUD 8575a067 PMD 0 Oops: 0010 [#1] SMP CPU 2 Modules linked in: linear loop bridge stp llc kvm_intel kvm asus_atk0110 sr_mod cdrom sg Pid: 10450, comm: tee Not tainted 3.0.0-rc1-leonard+ #173 System manufacturer System Product Name/P5G41TD-M PRO RIP: 0010:[<0000000000000000>] [< (null)>] (null) RSP: 0018:ffff880085757df0 EFLAGS: 00010282 RAX: ffffffffa00168e0 RBX: ffff8800d1431800 RCX: 000000000000006e RDX: 0000000000000001 RSI: 0000000000000002 RDI: ffff88008543c000 RBP: ffff880085757e48 R08: 0000000000000002 R09: 000000000000000a R10: 0000000000000000 R11: ffff88008543c2e0 R12: 00000000ffffffff R13: ffff8800b4641000 R14: 0000000000000005 R15: 0000000000000000 FS: 00007fe8c9e05700(0000) GS:ffff88011fa00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 00000000b4502000 CR4: 00000000000406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process tee (pid: 10450, threadinfo ffff880085756000, task ffff8800c9f08000) Stack: ffffffff8138496a ffff8800b4641000 ffff88008543c268 0000000000000000 ffff8800b4641000 ffff88008543c000 ffff8800d1431868 ffffffff81a78a90 ffff8800b4641000 ffff88008543c000 ffff8800d1431800 ffff880085757e98 Call Trace: [] ? slot_store+0xaa/0x265 [] rdev_attr_store+0x89/0xa8 [] sysfs_write_file+0x108/0x144 [] vfs_write+0xb1/0x10d [] ? trace_hardirqs_on_caller+0x111/0x135 [] sys_write+0x4d/0x77 [] system_call_fastpath+0x16/0x1b Code: Bad RIP value. RIP [< (null)>] (null) RSP CR2: 0000000000000000 ---[ end trace ba5fc64319a826fb ]--- Signed-off-by: Namhyung Kim Cc: stable@kernel.org Signed-off-by: NeilBrown commit 9864c0053d3da4c5731ac8a6c4835179310bd40a Author: 马建朋 Date: Thu Jun 9 11:42:48 2011 +1000 md: Using poll /proc/mdstat can monitor the events of adding a spare disks Signed-off-by: majianpeng Signed-off-by: NeilBrown commit d744540cd39e93976c4c8401e140232444ef3b0b Author: Jonathan Brassow Date: Wed Jun 8 18:01:10 2011 -0500 MD: use is_power_of_2 macro Make use of is_power_of_2 macro. Signed-off-by: Jonathan Brassow Signed-off-by: NeilBrown commit d6b212f4b19da5301e6b6eca562e5c7a2a6e8c8d Author: Jonathan Brassow Date: Wed Jun 8 18:00:28 2011 -0500 MD: raid5 do not set fullsync Add check to determine if a device needs full resync or if partial resync will do RAID 5 was assuming that if a device was not In_sync, it must undergo a full resync. We add a check to see if 'saved_raid_disk' is the same as 'raid_disk'. If it is, we can safely skip the full resync and rely on the bitmap for partial recovery instead. This is the legitimate purpose of 'saved_raid_disk', from md.h: int saved_raid_disk; /* role that device used to have in the * array and could again if we did a partial * resync from the bitmap */ Signed-off-by: Jonathan Brassow Signed-off-by: NeilBrown commit 9c81075f436f867f580c2edf2350c0898cffc9d0 Author: Jonathan Brassow Date: Wed Jun 8 17:59:30 2011 -0500 MD: support initial bitmap creation in-kernel Add bitmap support to the device-mapper specific metadata area. This patch allows the creation of the bitmap metadata area upon initial array creation via device-mapper. Signed-off-by: Jonathan Brassow Signed-off-by: NeilBrown commit 076f968b37f0232d883749da8f5031df5dea7ade Author: Jonathan Brassow Date: Tue Jun 7 17:51:30 2011 -0500 MD: add sync_super to mddev_t struct Add the 'sync_super' function pointer to MD array structure (struct mddev_s) If device-mapper (dm-raid.c) is to define its own on-disk superblock and be able to load it, there must still be a way for MD to initiate superblock updates. The simplest way to make this happen is to provide a pointer in the MD array structure that can be set by device-mapper (or other module) with a function to do this. If the function has been set, it will be used; otherwise, the method with be looked up via 'super_types' as usual. Signed-off-by: Jonathan Brassow Signed-off-by: NeilBrown commit 1ed7242e591af7e233234d483f12d33818b189d9 Author: Jonathan Brassow Date: Tue Jun 7 17:50:35 2011 -0500 MD: raid1 changes to allow use by device mapper MD RAID1: Changes to allow RAID1 to be used by device-mapper (dm-raid.c) Added the necessary congestion function and conditionalize calls requiring an array 'queue' or 'gendisk'. Signed-off-by: Jonathan Brassow Signed-off-by: NeilBrown commit 0fd018af37dadbb7826850883ad8abfecdb1a00b Author: Jonathan Brassow Date: Tue Jun 7 17:49:36 2011 -0500 MD: move thread wakeups into resume Move personality and sync/recovery thread starting outside md_run. Moving the wakeup's of the personality and sync/recovery threads out of md_run and into do_md_run and mddev_resume solves two issues: 1) It allows bitmap_load to be called before the sync_thread is run and 2) when MD personalities are used by device-mapper (dm-raid.c), the start-up of the array is better alligned with device-mapper primatives (CTR/resume/suspend/DTR). I/O - in this case, recovery operations - should not happen until after a resume has taken place. Signed-off-by: Jonathan Brassow Signed-off-by: NeilBrown commit ac42450c7c814769bee963ae4b897c149bb0ab53 Author: Jonathan Brassow Date: Tue Jun 7 17:48:35 2011 -0500 MD: possible typo Make message a bit clearer by s/blocks/k/ I chose 'k' vs 'kiB' or 'kB' because it is what is used earlier in the message. 'k' may be a bit ambigous, but I think it's better than "blocks" which normally means 512, but means 1024 in MD. Signed-off-by: Jonathan Brassow Signed-off-by: NeilBrown commit 68866e425be2ef2664aa5c691bb3ab789736acf5 Author: Jonathan Brassow Date: Wed Jun 8 15:10:08 2011 +1000 MD: no sync IO while suspended Disallow resync I/O while the RAID array is suspended. Recovery, resync, and metadata I/O should not be allowed while a device is suspended. Signed-off-by: Jonathan Brassow Signed-off-by: NeilBrown commit 629acb6abac0ef217ee579e14084af2ce7381dbc Author: Jonathan Brassow Date: Wed Jun 8 15:10:08 2011 +1000 MD: no integrity register if no gendisk Don't attempt md_integrity_register if there is no gendisk struct available. When MD arrays are built via device-mapper, the gendisk structure is not available via mddev. Signed-off-by: Jonathan Brassow Signed-off-by: NeilBrown