diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-29 19:28:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-29 19:28:29 -0400 |
commit | 10f3291a1d7a7dc3ded403cb3caa31916364be60 (patch) | |
tree | dc642b00558988f3e6a98d33a8f8299fc88444c3 | |
parent | 878e580e211c519c1b32a2c65786d308a759ec24 (diff) | |
parent | b0108f9e93d0d39050eaa11358852f349bdccb71 (diff) |
Merge branch 'akpm' (fixes from Andrew Morton)
Merge patches from Andrew Morton:
"22 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (22 commits)
kexec: purgatory: add clean-up for purgatory directory
Documentation/kdump/kdump.txt: add ARM description
flush_icache_range: export symbol to fix build errors
tools: selftests: fix build issue with make kselftests target
ocfs2: quorum: add a log for node not fenced
ocfs2: o2net: set tcp user timeout to max value
ocfs2: o2net: don't shutdown connection when idle timeout
ocfs2: do not write error flag to user structure we cannot copy from/to
x86/purgatory: use approprate -m64/-32 build flag for arch/x86/purgatory
drivers/rtc/rtc-s5m.c: re-add support for devices without irq specified
xattr: fix check for simultaneous glibc header inclusion
kexec: remove CONFIG_KEXEC dependency on crypto
kexec: create a new config option CONFIG_KEXEC_FILE for new syscall
x86,mm: fix pte_special versus pte_numa
hugetlb_cgroup: use lockdep_assert_held rather than spin_is_locked
mm/zpool: use prefixed module loading
zram: fix incorrect stat with failed_reads
lib: turn CONFIG_STACKTRACE into an actual option.
mm: actually clear pmd_numa before invalidating
memblock, memhotplug: fix wrong type in memblock_find_in_range_node().
...
44 files changed, 238 insertions, 177 deletions
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt index 88d5a863712a..6c0b9f27e465 100644 --- a/Documentation/kdump/kdump.txt +++ b/Documentation/kdump/kdump.txt | |||
@@ -18,7 +18,7 @@ memory image to a dump file on the local disk, or across the network to | |||
18 | a remote system. | 18 | a remote system. |
19 | 19 | ||
20 | Kdump and kexec are currently supported on the x86, x86_64, ppc64, ia64, | 20 | Kdump and kexec are currently supported on the x86, x86_64, ppc64, ia64, |
21 | and s390x architectures. | 21 | s390x and arm architectures. |
22 | 22 | ||
23 | When the system kernel boots, it reserves a small section of memory for | 23 | When the system kernel boots, it reserves a small section of memory for |
24 | the dump-capture kernel. This ensures that ongoing Direct Memory Access | 24 | the dump-capture kernel. This ensures that ongoing Direct Memory Access |
@@ -112,7 +112,7 @@ There are two possible methods of using Kdump. | |||
112 | 2) Or use the system kernel binary itself as dump-capture kernel and there is | 112 | 2) Or use the system kernel binary itself as dump-capture kernel and there is |
113 | no need to build a separate dump-capture kernel. This is possible | 113 | no need to build a separate dump-capture kernel. This is possible |
114 | only with the architectures which support a relocatable kernel. As | 114 | only with the architectures which support a relocatable kernel. As |
115 | of today, i386, x86_64, ppc64 and ia64 architectures support relocatable | 115 | of today, i386, x86_64, ppc64, ia64 and arm architectures support relocatable |
116 | kernel. | 116 | kernel. |
117 | 117 | ||
118 | Building a relocatable kernel is advantageous from the point of view that | 118 | Building a relocatable kernel is advantageous from the point of view that |
@@ -241,6 +241,13 @@ Dump-capture kernel config options (Arch Dependent, ia64) | |||
241 | kernel will be aligned to 64Mb, so if the start address is not then | 241 | kernel will be aligned to 64Mb, so if the start address is not then |
242 | any space below the alignment point will be wasted. | 242 | any space below the alignment point will be wasted. |
243 | 243 | ||
244 | Dump-capture kernel config options (Arch Dependent, arm) | ||
245 | ---------------------------------------------------------- | ||
246 | |||
247 | - To use a relocatable kernel, | ||
248 | Enable "AUTO_ZRELADDR" support under "Boot" options: | ||
249 | |||
250 | AUTO_ZRELADDR=y | ||
244 | 251 | ||
245 | Extended crashkernel syntax | 252 | Extended crashkernel syntax |
246 | =========================== | 253 | =========================== |
@@ -256,6 +263,10 @@ The syntax is: | |||
256 | crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset] | 263 | crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset] |
257 | range=start-[end] | 264 | range=start-[end] |
258 | 265 | ||
266 | Please note, on arm, the offset is required. | ||
267 | crashkernel=<range1>:<size1>[,<range2>:<size2>,...]@offset | ||
268 | range=start-[end] | ||
269 | |||
259 | 'start' is inclusive and 'end' is exclusive. | 270 | 'start' is inclusive and 'end' is exclusive. |
260 | 271 | ||
261 | For example: | 272 | For example: |
@@ -296,6 +307,12 @@ Boot into System Kernel | |||
296 | on the memory consumption of the kdump system. In general this is not | 307 | on the memory consumption of the kdump system. In general this is not |
297 | dependent on the memory size of the production system. | 308 | dependent on the memory size of the production system. |
298 | 309 | ||
310 | On arm, use "crashkernel=Y@X". Note that the start address of the kernel | ||
311 | will be aligned to 128MiB (0x08000000), so if the start address is not then | ||
312 | any space below the alignment point may be overwritten by the dump-capture kernel, | ||
313 | which means it is possible that the vmcore is not that precise as expected. | ||
314 | |||
315 | |||
299 | Load the Dump-capture Kernel | 316 | Load the Dump-capture Kernel |
300 | ============================ | 317 | ============================ |
301 | 318 | ||
@@ -315,7 +332,8 @@ For ia64: | |||
315 | - Use vmlinux or vmlinuz.gz | 332 | - Use vmlinux or vmlinuz.gz |
316 | For s390x: | 333 | For s390x: |
317 | - Use image or bzImage | 334 | - Use image or bzImage |
318 | 335 | For arm: | |
336 | - Use zImage | ||
319 | 337 | ||
320 | If you are using a uncompressed vmlinux image then use following command | 338 | If you are using a uncompressed vmlinux image then use following command |
321 | to load dump-capture kernel. | 339 | to load dump-capture kernel. |
@@ -331,6 +349,15 @@ to load dump-capture kernel. | |||
331 | --initrd=<initrd-for-dump-capture-kernel> \ | 349 | --initrd=<initrd-for-dump-capture-kernel> \ |
332 | --append="root=<root-dev> <arch-specific-options>" | 350 | --append="root=<root-dev> <arch-specific-options>" |
333 | 351 | ||
352 | If you are using a compressed zImage, then use following command | ||
353 | to load dump-capture kernel. | ||
354 | |||
355 | kexec --type zImage -p <dump-capture-kernel-bzImage> \ | ||
356 | --initrd=<initrd-for-dump-capture-kernel> \ | ||
357 | --dtb=<dtb-for-dump-capture-kernel> \ | ||
358 | --append="root=<root-dev> <arch-specific-options>" | ||
359 | |||
360 | |||
334 | Please note, that --args-linux does not need to be specified for ia64. | 361 | Please note, that --args-linux does not need to be specified for ia64. |
335 | It is planned to make this a no-op on that architecture, but for now | 362 | It is planned to make this a no-op on that architecture, but for now |
336 | it should be omitted | 363 | it should be omitted |
@@ -347,6 +374,9 @@ For ppc64: | |||
347 | For s390x: | 374 | For s390x: |
348 | "1 maxcpus=1 cgroup_disable=memory" | 375 | "1 maxcpus=1 cgroup_disable=memory" |
349 | 376 | ||
377 | For arm: | ||
378 | "1 maxcpus=1 reset_devices" | ||
379 | |||
350 | Notes on loading the dump-capture kernel: | 380 | Notes on loading the dump-capture kernel: |
351 | 381 | ||
352 | * By default, the ELF headers are stored in ELF64 format to support | 382 | * By default, the ELF headers are stored in ELF64 format to support |
diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c index 4670afc3b971..e88ddbf990e3 100644 --- a/arch/arc/mm/cache_arc700.c +++ b/arch/arc/mm/cache_arc700.c | |||
@@ -581,6 +581,7 @@ void flush_icache_range(unsigned long kstart, unsigned long kend) | |||
581 | tot_sz -= sz; | 581 | tot_sz -= sz; |
582 | } | 582 | } |
583 | } | 583 | } |
584 | EXPORT_SYMBOL(flush_icache_range); | ||
584 | 585 | ||
585 | /* | 586 | /* |
586 | * General purpose helper to make I and D cache lines consistent. | 587 | * General purpose helper to make I and D cache lines consistent. |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c49a775937db..32cbbd565902 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1983,8 +1983,6 @@ config XIP_PHYS_ADDR | |||
1983 | config KEXEC | 1983 | config KEXEC |
1984 | bool "Kexec system call (EXPERIMENTAL)" | 1984 | bool "Kexec system call (EXPERIMENTAL)" |
1985 | depends on (!SMP || PM_SLEEP_SMP) | 1985 | depends on (!SMP || PM_SLEEP_SMP) |
1986 | select CRYPTO | ||
1987 | select CRYPTO_SHA256 | ||
1988 | help | 1986 | help |
1989 | kexec is a system call that implements the ability to shutdown your | 1987 | kexec is a system call that implements the ability to shutdown your |
1990 | current kernel, and to start another kernel. It is like a reboot | 1988 | current kernel, and to start another kernel. It is like a reboot |
diff --git a/arch/hexagon/mm/cache.c b/arch/hexagon/mm/cache.c index fe14ccf28561..0c76c802e31c 100644 --- a/arch/hexagon/mm/cache.c +++ b/arch/hexagon/mm/cache.c | |||
@@ -68,6 +68,7 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
68 | ); | 68 | ); |
69 | local_irq_restore(flags); | 69 | local_irq_restore(flags); |
70 | } | 70 | } |
71 | EXPORT_SYMBOL(flush_icache_range); | ||
71 | 72 | ||
72 | void hexagon_clean_dcache_range(unsigned long start, unsigned long end) | 73 | void hexagon_clean_dcache_range(unsigned long start, unsigned long end) |
73 | { | 74 | { |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 64aefb76bd69..c84c88bbbbd7 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -549,8 +549,6 @@ source "drivers/sn/Kconfig" | |||
549 | config KEXEC | 549 | config KEXEC |
550 | bool "kexec system call" | 550 | bool "kexec system call" |
551 | depends on !IA64_HP_SIM && (!SMP || HOTPLUG_CPU) | 551 | depends on !IA64_HP_SIM && (!SMP || HOTPLUG_CPU) |
552 | select CRYPTO | ||
553 | select CRYPTO_SHA256 | ||
554 | help | 552 | help |
555 | kexec is a system call that implements the ability to shutdown your | 553 | kexec is a system call that implements the ability to shutdown your |
556 | current kernel, and to start another kernel. It is like a reboot | 554 | current kernel, and to start another kernel. It is like a reboot |
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 3ff8c9a25335..87b7c7581b1d 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig | |||
@@ -91,8 +91,6 @@ config MMU_SUN3 | |||
91 | config KEXEC | 91 | config KEXEC |
92 | bool "kexec system call" | 92 | bool "kexec system call" |
93 | depends on M68KCLASSIC | 93 | depends on M68KCLASSIC |
94 | select CRYPTO | ||
95 | select CRYPTO_SHA256 | ||
96 | help | 94 | help |
97 | kexec is a system call that implements the ability to shutdown your | 95 | kexec is a system call that implements the ability to shutdown your |
98 | current kernel, and to start another kernel. It is like a reboot | 96 | current kernel, and to start another kernel. It is like a reboot |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index df51e78a72cc..900c7e5333b6 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -2396,8 +2396,6 @@ source "kernel/Kconfig.preempt" | |||
2396 | 2396 | ||
2397 | config KEXEC | 2397 | config KEXEC |
2398 | bool "Kexec system call" | 2398 | bool "Kexec system call" |
2399 | select CRYPTO | ||
2400 | select CRYPTO_SHA256 | ||
2401 | help | 2399 | help |
2402 | kexec is a system call that implements the ability to shutdown your | 2400 | kexec is a system call that implements the ability to shutdown your |
2403 | current kernel, and to start another kernel. It is like a reboot | 2401 | current kernel, and to start another kernel. It is like a reboot |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index a577609f8ed6..4bc7b62fb4b6 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -399,8 +399,6 @@ config PPC64_SUPPORTS_MEMORY_FAILURE | |||
399 | config KEXEC | 399 | config KEXEC |
400 | bool "kexec system call" | 400 | bool "kexec system call" |
401 | depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP)) | 401 | depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP)) |
402 | select CRYPTO | ||
403 | select CRYPTO_SHA256 | ||
404 | help | 402 | help |
405 | kexec is a system call that implements the ability to shutdown your | 403 | kexec is a system call that implements the ability to shutdown your |
406 | current kernel, and to start another kernel. It is like a reboot | 404 | current kernel, and to start another kernel. It is like a reboot |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index ab39ceb89ecf..05c78bb5f570 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -48,8 +48,6 @@ config ARCH_SUPPORTS_DEBUG_PAGEALLOC | |||
48 | 48 | ||
49 | config KEXEC | 49 | config KEXEC |
50 | def_bool y | 50 | def_bool y |
51 | select CRYPTO | ||
52 | select CRYPTO_SHA256 | ||
53 | 51 | ||
54 | config AUDIT_ARCH | 52 | config AUDIT_ARCH |
55 | def_bool y | 53 | def_bool y |
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index b319846ad97f..244fb4c81e25 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -598,8 +598,6 @@ source kernel/Kconfig.hz | |||
598 | config KEXEC | 598 | config KEXEC |
599 | bool "kexec system call (EXPERIMENTAL)" | 599 | bool "kexec system call (EXPERIMENTAL)" |
600 | depends on SUPERH32 && MMU | 600 | depends on SUPERH32 && MMU |
601 | select CRYPTO | ||
602 | select CRYPTO_SHA256 | ||
603 | help | 601 | help |
604 | kexec is a system call that implements the ability to shutdown your | 602 | kexec is a system call that implements the ability to shutdown your |
605 | current kernel, and to start another kernel. It is like a reboot | 603 | current kernel, and to start another kernel. It is like a reboot |
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c index 097c2cdd117f..f770e3992620 100644 --- a/arch/sh/mm/cache.c +++ b/arch/sh/mm/cache.c | |||
@@ -229,6 +229,7 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
229 | 229 | ||
230 | cacheop_on_each_cpu(local_flush_icache_range, (void *)&data, 1); | 230 | cacheop_on_each_cpu(local_flush_icache_range, (void *)&data, 1); |
231 | } | 231 | } |
232 | EXPORT_SYMBOL(flush_icache_range); | ||
232 | 233 | ||
233 | void flush_icache_page(struct vm_area_struct *vma, struct page *page) | 234 | void flush_icache_page(struct vm_area_struct *vma, struct page *page) |
234 | { | 235 | { |
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index a3ffe2dd4832..7fcd492adbfc 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig | |||
@@ -191,8 +191,6 @@ source "kernel/Kconfig.hz" | |||
191 | 191 | ||
192 | config KEXEC | 192 | config KEXEC |
193 | bool "kexec system call" | 193 | bool "kexec system call" |
194 | select CRYPTO | ||
195 | select CRYPTO_SHA256 | ||
196 | ---help--- | 194 | ---help--- |
197 | kexec is a system call that implements the ability to shutdown your | 195 | kexec is a system call that implements the ability to shutdown your |
198 | current kernel, and to start another kernel. It is like a reboot | 196 | current kernel, and to start another kernel. It is like a reboot |
diff --git a/arch/tile/kernel/smp.c b/arch/tile/kernel/smp.c index 01e8ab29f43a..19eaa62d456a 100644 --- a/arch/tile/kernel/smp.c +++ b/arch/tile/kernel/smp.c | |||
@@ -183,6 +183,7 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
183 | preempt_enable(); | 183 | preempt_enable(); |
184 | } | 184 | } |
185 | } | 185 | } |
186 | EXPORT_SYMBOL(flush_icache_range); | ||
186 | 187 | ||
187 | 188 | ||
188 | /* Called when smp_send_reschedule() triggers IRQ_RESCHEDULE. */ | 189 | /* Called when smp_send_reschedule() triggers IRQ_RESCHEDULE. */ |
diff --git a/arch/x86/Kbuild b/arch/x86/Kbuild index 61b6d51866f8..3942f74c92d7 100644 --- a/arch/x86/Kbuild +++ b/arch/x86/Kbuild | |||
@@ -17,6 +17,4 @@ obj-$(CONFIG_IA32_EMULATION) += ia32/ | |||
17 | obj-y += platform/ | 17 | obj-y += platform/ |
18 | obj-y += net/ | 18 | obj-y += net/ |
19 | 19 | ||
20 | ifeq ($(CONFIG_X86_64),y) | 20 | obj-$(CONFIG_KEXEC_FILE) += purgatory/ |
21 | obj-$(CONFIG_KEXEC) += purgatory/ | ||
22 | endif | ||
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 5d0bf1aa9dcb..778178f4c7d1 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1585,9 +1585,6 @@ source kernel/Kconfig.hz | |||
1585 | 1585 | ||
1586 | config KEXEC | 1586 | config KEXEC |
1587 | bool "kexec system call" | 1587 | bool "kexec system call" |
1588 | select BUILD_BIN2C | ||
1589 | select CRYPTO | ||
1590 | select CRYPTO_SHA256 | ||
1591 | ---help--- | 1588 | ---help--- |
1592 | kexec is a system call that implements the ability to shutdown your | 1589 | kexec is a system call that implements the ability to shutdown your |
1593 | current kernel, and to start another kernel. It is like a reboot | 1590 | current kernel, and to start another kernel. It is like a reboot |
@@ -1602,9 +1599,22 @@ config KEXEC | |||
1602 | interface is strongly in flux, so no good recommendation can be | 1599 | interface is strongly in flux, so no good recommendation can be |
1603 | made. | 1600 | made. |
1604 | 1601 | ||
1602 | config KEXEC_FILE | ||
1603 | bool "kexec file based system call" | ||
1604 | select BUILD_BIN2C | ||
1605 | depends on KEXEC | ||
1606 | depends on X86_64 | ||
1607 | depends on CRYPTO=y | ||
1608 | depends on CRYPTO_SHA256=y | ||
1609 | ---help--- | ||
1610 | This is new version of kexec system call. This system call is | ||
1611 | file based and takes file descriptors as system call argument | ||
1612 | for kernel and initramfs as opposed to list of segments as | ||
1613 | accepted by previous system call. | ||
1614 | |||
1605 | config KEXEC_VERIFY_SIG | 1615 | config KEXEC_VERIFY_SIG |
1606 | bool "Verify kernel signature during kexec_file_load() syscall" | 1616 | bool "Verify kernel signature during kexec_file_load() syscall" |
1607 | depends on KEXEC | 1617 | depends on KEXEC_FILE |
1608 | ---help--- | 1618 | ---help--- |
1609 | This option makes kernel signature verification mandatory for | 1619 | This option makes kernel signature verification mandatory for |
1610 | kexec_file_load() syscall. If kernel is signature can not be | 1620 | kexec_file_load() syscall. If kernel is signature can not be |
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index c1aa36887843..60087ca37679 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -184,11 +184,8 @@ archheaders: | |||
184 | $(Q)$(MAKE) $(build)=arch/x86/syscalls all | 184 | $(Q)$(MAKE) $(build)=arch/x86/syscalls all |
185 | 185 | ||
186 | archprepare: | 186 | archprepare: |
187 | ifeq ($(CONFIG_KEXEC),y) | 187 | ifeq ($(CONFIG_KEXEC_FILE),y) |
188 | # Build only for 64bit. No loaders for 32bit yet. | ||
189 | ifeq ($(CONFIG_X86_64),y) | ||
190 | $(Q)$(MAKE) $(build)=arch/x86/purgatory arch/x86/purgatory/kexec-purgatory.c | 188 | $(Q)$(MAKE) $(build)=arch/x86/purgatory arch/x86/purgatory/kexec-purgatory.c |
191 | endif | ||
192 | endif | 189 | endif |
193 | 190 | ||
194 | ### | 191 | ### |
@@ -254,6 +251,7 @@ archclean: | |||
254 | $(Q)rm -rf $(objtree)/arch/x86_64 | 251 | $(Q)rm -rf $(objtree)/arch/x86_64 |
255 | $(Q)$(MAKE) $(clean)=$(boot) | 252 | $(Q)$(MAKE) $(clean)=$(boot) |
256 | $(Q)$(MAKE) $(clean)=arch/x86/tools | 253 | $(Q)$(MAKE) $(clean)=arch/x86/tools |
254 | $(Q)$(MAKE) $(clean)=arch/x86/purgatory | ||
257 | 255 | ||
258 | PHONY += kvmconfig | 256 | PHONY += kvmconfig |
259 | kvmconfig: | 257 | kvmconfig: |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 0ec056012618..aa97a070f09f 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -131,8 +131,13 @@ static inline int pte_exec(pte_t pte) | |||
131 | 131 | ||
132 | static inline int pte_special(pte_t pte) | 132 | static inline int pte_special(pte_t pte) |
133 | { | 133 | { |
134 | return (pte_flags(pte) & (_PAGE_PRESENT|_PAGE_SPECIAL)) == | 134 | /* |
135 | (_PAGE_PRESENT|_PAGE_SPECIAL); | 135 | * See CONFIG_NUMA_BALANCING pte_numa in include/asm-generic/pgtable.h. |
136 | * On x86 we have _PAGE_BIT_NUMA == _PAGE_BIT_GLOBAL+1 == | ||
137 | * __PAGE_BIT_SOFTW1 == _PAGE_BIT_SPECIAL. | ||
138 | */ | ||
139 | return (pte_flags(pte) & _PAGE_SPECIAL) && | ||
140 | (pte_flags(pte) & (_PAGE_PRESENT|_PAGE_PROTNONE)); | ||
136 | } | 141 | } |
137 | 142 | ||
138 | static inline unsigned long pte_pfn(pte_t pte) | 143 | static inline unsigned long pte_pfn(pte_t pte) |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index b5ea75c4a4b4..ada2e2d6be3e 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
@@ -71,6 +71,7 @@ obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o | |||
71 | obj-$(CONFIG_X86_TSC) += trace_clock.o | 71 | obj-$(CONFIG_X86_TSC) += trace_clock.o |
72 | obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o | 72 | obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o |
73 | obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o | 73 | obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o |
74 | obj-$(CONFIG_KEXEC_FILE) += kexec-bzimage64.o | ||
74 | obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o | 75 | obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o |
75 | obj-y += kprobes/ | 76 | obj-y += kprobes/ |
76 | obj-$(CONFIG_MODULES) += module.o | 77 | obj-$(CONFIG_MODULES) += module.o |
@@ -118,5 +119,4 @@ ifeq ($(CONFIG_X86_64),y) | |||
118 | 119 | ||
119 | obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o | 120 | obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o |
120 | obj-y += vsmp_64.o | 121 | obj-y += vsmp_64.o |
121 | obj-$(CONFIG_KEXEC) += kexec-bzimage64.o | ||
122 | endif | 122 | endif |
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index 0553a34fa0df..a618fcd2c07d 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c | |||
@@ -182,8 +182,7 @@ void native_machine_crash_shutdown(struct pt_regs *regs) | |||
182 | crash_save_cpu(regs, safe_smp_processor_id()); | 182 | crash_save_cpu(regs, safe_smp_processor_id()); |
183 | } | 183 | } |
184 | 184 | ||
185 | #ifdef CONFIG_X86_64 | 185 | #ifdef CONFIG_KEXEC_FILE |
186 | |||
187 | static int get_nr_ram_ranges_callback(unsigned long start_pfn, | 186 | static int get_nr_ram_ranges_callback(unsigned long start_pfn, |
188 | unsigned long nr_pfn, void *arg) | 187 | unsigned long nr_pfn, void *arg) |
189 | { | 188 | { |
@@ -696,5 +695,4 @@ int crash_load_segments(struct kimage *image) | |||
696 | 695 | ||
697 | return ret; | 696 | return ret; |
698 | } | 697 | } |
699 | 698 | #endif /* CONFIG_KEXEC_FILE */ | |
700 | #endif /* CONFIG_X86_64 */ | ||
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 8b04018e5d1f..485981059a40 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c | |||
@@ -25,9 +25,11 @@ | |||
25 | #include <asm/debugreg.h> | 25 | #include <asm/debugreg.h> |
26 | #include <asm/kexec-bzimage64.h> | 26 | #include <asm/kexec-bzimage64.h> |
27 | 27 | ||
28 | #ifdef CONFIG_KEXEC_FILE | ||
28 | static struct kexec_file_ops *kexec_file_loaders[] = { | 29 | static struct kexec_file_ops *kexec_file_loaders[] = { |
29 | &kexec_bzImage64_ops, | 30 | &kexec_bzImage64_ops, |
30 | }; | 31 | }; |
32 | #endif | ||
31 | 33 | ||
32 | static void free_transition_pgtable(struct kimage *image) | 34 | static void free_transition_pgtable(struct kimage *image) |
33 | { | 35 | { |
@@ -178,6 +180,7 @@ static void load_segments(void) | |||
178 | ); | 180 | ); |
179 | } | 181 | } |
180 | 182 | ||
183 | #ifdef CONFIG_KEXEC_FILE | ||
181 | /* Update purgatory as needed after various image segments have been prepared */ | 184 | /* Update purgatory as needed after various image segments have been prepared */ |
182 | static int arch_update_purgatory(struct kimage *image) | 185 | static int arch_update_purgatory(struct kimage *image) |
183 | { | 186 | { |
@@ -209,6 +212,12 @@ static int arch_update_purgatory(struct kimage *image) | |||
209 | 212 | ||
210 | return ret; | 213 | return ret; |
211 | } | 214 | } |
215 | #else /* !CONFIG_KEXEC_FILE */ | ||
216 | static inline int arch_update_purgatory(struct kimage *image) | ||
217 | { | ||
218 | return 0; | ||
219 | } | ||
220 | #endif /* CONFIG_KEXEC_FILE */ | ||
212 | 221 | ||
213 | int machine_kexec_prepare(struct kimage *image) | 222 | int machine_kexec_prepare(struct kimage *image) |
214 | { | 223 | { |
@@ -329,6 +338,7 @@ void arch_crash_save_vmcoreinfo(void) | |||
329 | 338 | ||
330 | /* arch-dependent functionality related to kexec file-based syscall */ | 339 | /* arch-dependent functionality related to kexec file-based syscall */ |
331 | 340 | ||
341 | #ifdef CONFIG_KEXEC_FILE | ||
332 | int arch_kexec_kernel_image_probe(struct kimage *image, void *buf, | 342 | int arch_kexec_kernel_image_probe(struct kimage *image, void *buf, |
333 | unsigned long buf_len) | 343 | unsigned long buf_len) |
334 | { | 344 | { |
@@ -522,3 +532,4 @@ overflow: | |||
522 | (int)ELF64_R_TYPE(rel[i].r_info), value); | 532 | (int)ELF64_R_TYPE(rel[i].r_info), value); |
523 | return -ENOEXEC; | 533 | return -ENOEXEC; |
524 | } | 534 | } |
535 | #endif /* CONFIG_KEXEC_FILE */ | ||
diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile index 7fde9ee438a4..899dd2454256 100644 --- a/arch/x86/purgatory/Makefile +++ b/arch/x86/purgatory/Makefile | |||
@@ -11,6 +11,7 @@ targets += purgatory.ro | |||
11 | # sure how to relocate those. Like kexec-tools, use custom flags. | 11 | # sure how to relocate those. Like kexec-tools, use custom flags. |
12 | 12 | ||
13 | KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -MD -Os -mcmodel=large | 13 | KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -MD -Os -mcmodel=large |
14 | KBUILD_CFLAGS += -m$(BITS) | ||
14 | 15 | ||
15 | $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE | 16 | $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE |
16 | $(call if_changed,ld) | 17 | $(call if_changed,ld) |
@@ -24,7 +25,4 @@ $(obj)/kexec-purgatory.c: $(obj)/purgatory.ro FORCE | |||
24 | $(call if_changed,bin2c) | 25 | $(call if_changed,bin2c) |
25 | 26 | ||
26 | 27 | ||
27 | # No loaders for 32bits yet. | 28 | obj-$(CONFIG_KEXEC_FILE) += kexec-purgatory.o |
28 | ifeq ($(CONFIG_X86_64),y) | ||
29 | obj-$(CONFIG_KEXEC) += kexec-purgatory.o | ||
30 | endif | ||
diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c index 40b5a3771fb0..4d02e38514f5 100644 --- a/arch/xtensa/kernel/smp.c +++ b/arch/xtensa/kernel/smp.c | |||
@@ -571,6 +571,7 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
571 | }; | 571 | }; |
572 | on_each_cpu(ipi_flush_icache_range, &fd, 1); | 572 | on_each_cpu(ipi_flush_icache_range, &fd, 1); |
573 | } | 573 | } |
574 | EXPORT_SYMBOL(flush_icache_range); | ||
574 | 575 | ||
575 | /* ------------------------------------------------------------------------- */ | 576 | /* ------------------------------------------------------------------------- */ |
576 | 577 | ||
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index dfa4024c448a..d00831c3d731 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c | |||
@@ -378,7 +378,6 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index) | |||
378 | /* Should NEVER happen. Return bio error if it does. */ | 378 | /* Should NEVER happen. Return bio error if it does. */ |
379 | if (unlikely(ret)) { | 379 | if (unlikely(ret)) { |
380 | pr_err("Decompression failed! err=%d, page=%u\n", ret, index); | 380 | pr_err("Decompression failed! err=%d, page=%u\n", ret, index); |
381 | atomic64_inc(&zram->stats.failed_reads); | ||
382 | return ret; | 381 | return ret; |
383 | } | 382 | } |
384 | 383 | ||
@@ -547,8 +546,6 @@ out: | |||
547 | zcomp_strm_release(zram->comp, zstrm); | 546 | zcomp_strm_release(zram->comp, zstrm); |
548 | if (is_partial_io(bvec)) | 547 | if (is_partial_io(bvec)) |
549 | kfree(uncmem); | 548 | kfree(uncmem); |
550 | if (ret) | ||
551 | atomic64_inc(&zram->stats.failed_writes); | ||
552 | return ret; | 549 | return ret; |
553 | } | 550 | } |
554 | 551 | ||
@@ -566,6 +563,13 @@ static int zram_bvec_rw(struct zram *zram, struct bio_vec *bvec, u32 index, | |||
566 | ret = zram_bvec_write(zram, bvec, index, offset); | 563 | ret = zram_bvec_write(zram, bvec, index, offset); |
567 | } | 564 | } |
568 | 565 | ||
566 | if (unlikely(ret)) { | ||
567 | if (rw == READ) | ||
568 | atomic64_inc(&zram->stats.failed_reads); | ||
569 | else | ||
570 | atomic64_inc(&zram->stats.failed_writes); | ||
571 | } | ||
572 | |||
569 | return ret; | 573 | return ret; |
570 | } | 574 | } |
571 | 575 | ||
diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h index 5b0afde729cd..e0f725c87cc6 100644 --- a/drivers/block/zram/zram_drv.h +++ b/drivers/block/zram/zram_drv.h | |||
@@ -84,7 +84,7 @@ struct zram_stats { | |||
84 | atomic64_t compr_data_size; /* compressed size of pages stored */ | 84 | atomic64_t compr_data_size; /* compressed size of pages stored */ |
85 | atomic64_t num_reads; /* failed + successful */ | 85 | atomic64_t num_reads; /* failed + successful */ |
86 | atomic64_t num_writes; /* --do-- */ | 86 | atomic64_t num_writes; /* --do-- */ |
87 | atomic64_t failed_reads; /* should NEVER! happen */ | 87 | atomic64_t failed_reads; /* can happen when memory is too low */ |
88 | atomic64_t failed_writes; /* can happen when memory is too low */ | 88 | atomic64_t failed_writes; /* can happen when memory is too low */ |
89 | atomic64_t invalid_io; /* non-page-aligned I/O requests */ | 89 | atomic64_t invalid_io; /* non-page-aligned I/O requests */ |
90 | atomic64_t notify_free; /* no. of swap slot free notifications */ | 90 | atomic64_t notify_free; /* no. of swap slot free notifications */ |
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c index 8f06250a0389..8754c33361e8 100644 --- a/drivers/rtc/rtc-s5m.c +++ b/drivers/rtc/rtc-s5m.c | |||
@@ -717,12 +717,14 @@ static int s5m_rtc_probe(struct platform_device *pdev) | |||
717 | info->device_type = s5m87xx->device_type; | 717 | info->device_type = s5m87xx->device_type; |
718 | info->wtsr_smpl = s5m87xx->wtsr_smpl; | 718 | info->wtsr_smpl = s5m87xx->wtsr_smpl; |
719 | 719 | ||
720 | info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq); | 720 | if (s5m87xx->irq_data) { |
721 | if (info->irq <= 0) { | 721 | info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq); |
722 | ret = -EINVAL; | 722 | if (info->irq <= 0) { |
723 | dev_err(&pdev->dev, "Failed to get virtual IRQ %d\n", | 723 | ret = -EINVAL; |
724 | dev_err(&pdev->dev, "Failed to get virtual IRQ %d\n", | ||
724 | alarm_irq); | 725 | alarm_irq); |
725 | goto err; | 726 | goto err; |
727 | } | ||
726 | } | 728 | } |
727 | 729 | ||
728 | platform_set_drvdata(pdev, info); | 730 | platform_set_drvdata(pdev, info); |
@@ -744,6 +746,11 @@ static int s5m_rtc_probe(struct platform_device *pdev) | |||
744 | goto err; | 746 | goto err; |
745 | } | 747 | } |
746 | 748 | ||
749 | if (!info->irq) { | ||
750 | dev_info(&pdev->dev, "Alarm IRQ not available\n"); | ||
751 | return 0; | ||
752 | } | ||
753 | |||
747 | ret = devm_request_threaded_irq(&pdev->dev, info->irq, NULL, | 754 | ret = devm_request_threaded_irq(&pdev->dev, info->irq, NULL, |
748 | s5m_rtc_alarm_irq, 0, "rtc-alarm0", | 755 | s5m_rtc_alarm_irq, 0, "rtc-alarm0", |
749 | info); | 756 | info); |
@@ -802,7 +809,7 @@ static int s5m_rtc_resume(struct device *dev) | |||
802 | struct s5m_rtc_info *info = dev_get_drvdata(dev); | 809 | struct s5m_rtc_info *info = dev_get_drvdata(dev); |
803 | int ret = 0; | 810 | int ret = 0; |
804 | 811 | ||
805 | if (device_may_wakeup(dev)) | 812 | if (info->irq && device_may_wakeup(dev)) |
806 | ret = disable_irq_wake(info->irq); | 813 | ret = disable_irq_wake(info->irq); |
807 | 814 | ||
808 | return ret; | 815 | return ret; |
@@ -813,7 +820,7 @@ static int s5m_rtc_suspend(struct device *dev) | |||
813 | struct s5m_rtc_info *info = dev_get_drvdata(dev); | 820 | struct s5m_rtc_info *info = dev_get_drvdata(dev); |
814 | int ret = 0; | 821 | int ret = 0; |
815 | 822 | ||
816 | if (device_may_wakeup(dev)) | 823 | if (info->irq && device_may_wakeup(dev)) |
817 | ret = enable_irq_wake(info->irq); | 824 | ret = enable_irq_wake(info->irq); |
818 | 825 | ||
819 | return ret; | 826 | return ret; |
diff --git a/fs/ocfs2/cluster/quorum.c b/fs/ocfs2/cluster/quorum.c index 1ec141e758d7..62e8ec619b4c 100644 --- a/fs/ocfs2/cluster/quorum.c +++ b/fs/ocfs2/cluster/quorum.c | |||
@@ -160,9 +160,18 @@ static void o2quo_make_decision(struct work_struct *work) | |||
160 | } | 160 | } |
161 | 161 | ||
162 | out: | 162 | out: |
163 | spin_unlock(&qs->qs_lock); | 163 | if (fence) { |
164 | if (fence) | 164 | spin_unlock(&qs->qs_lock); |
165 | o2quo_fence_self(); | 165 | o2quo_fence_self(); |
166 | } else { | ||
167 | mlog(ML_NOTICE, "not fencing this node, heartbeating: %d, " | ||
168 | "connected: %d, lowest: %d (%sreachable)\n", | ||
169 | qs->qs_heartbeating, qs->qs_connected, lowest_hb, | ||
170 | lowest_reachable ? "" : "un"); | ||
171 | spin_unlock(&qs->qs_lock); | ||
172 | |||
173 | } | ||
174 | |||
166 | } | 175 | } |
167 | 176 | ||
168 | static void o2quo_set_hold(struct o2quo_state *qs, u8 node) | 177 | static void o2quo_set_hold(struct o2quo_state *qs, u8 node) |
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index 681691bc233a..ea34952f9496 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -1480,6 +1480,14 @@ static int o2net_set_nodelay(struct socket *sock) | |||
1480 | return ret; | 1480 | return ret; |
1481 | } | 1481 | } |
1482 | 1482 | ||
1483 | static int o2net_set_usertimeout(struct socket *sock) | ||
1484 | { | ||
1485 | int user_timeout = O2NET_TCP_USER_TIMEOUT; | ||
1486 | |||
1487 | return kernel_setsockopt(sock, SOL_TCP, TCP_USER_TIMEOUT, | ||
1488 | (char *)&user_timeout, sizeof(user_timeout)); | ||
1489 | } | ||
1490 | |||
1483 | static void o2net_initialize_handshake(void) | 1491 | static void o2net_initialize_handshake(void) |
1484 | { | 1492 | { |
1485 | o2net_hand->o2hb_heartbeat_timeout_ms = cpu_to_be32( | 1493 | o2net_hand->o2hb_heartbeat_timeout_ms = cpu_to_be32( |
@@ -1536,16 +1544,20 @@ static void o2net_idle_timer(unsigned long data) | |||
1536 | #endif | 1544 | #endif |
1537 | 1545 | ||
1538 | printk(KERN_NOTICE "o2net: Connection to " SC_NODEF_FMT " has been " | 1546 | printk(KERN_NOTICE "o2net: Connection to " SC_NODEF_FMT " has been " |
1539 | "idle for %lu.%lu secs, shutting it down.\n", SC_NODEF_ARGS(sc), | 1547 | "idle for %lu.%lu secs.\n", |
1540 | msecs / 1000, msecs % 1000); | 1548 | SC_NODEF_ARGS(sc), msecs / 1000, msecs % 1000); |
1541 | 1549 | ||
1542 | /* | 1550 | /* idle timerout happen, don't shutdown the connection, but |
1543 | * Initialize the nn_timeout so that the next connection attempt | 1551 | * make fence decision. Maybe the connection can recover before |
1544 | * will continue in o2net_start_connect. | 1552 | * the decision is made. |
1545 | */ | 1553 | */ |
1546 | atomic_set(&nn->nn_timeout, 1); | 1554 | atomic_set(&nn->nn_timeout, 1); |
1555 | o2quo_conn_err(o2net_num_from_nn(nn)); | ||
1556 | queue_delayed_work(o2net_wq, &nn->nn_still_up, | ||
1557 | msecs_to_jiffies(O2NET_QUORUM_DELAY_MS)); | ||
1558 | |||
1559 | o2net_sc_reset_idle_timer(sc); | ||
1547 | 1560 | ||
1548 | o2net_sc_queue_work(sc, &sc->sc_shutdown_work); | ||
1549 | } | 1561 | } |
1550 | 1562 | ||
1551 | static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc) | 1563 | static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc) |
@@ -1560,6 +1572,15 @@ static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc) | |||
1560 | 1572 | ||
1561 | static void o2net_sc_postpone_idle(struct o2net_sock_container *sc) | 1573 | static void o2net_sc_postpone_idle(struct o2net_sock_container *sc) |
1562 | { | 1574 | { |
1575 | struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num); | ||
1576 | |||
1577 | /* clear fence decision since the connection recover from timeout*/ | ||
1578 | if (atomic_read(&nn->nn_timeout)) { | ||
1579 | o2quo_conn_up(o2net_num_from_nn(nn)); | ||
1580 | cancel_delayed_work(&nn->nn_still_up); | ||
1581 | atomic_set(&nn->nn_timeout, 0); | ||
1582 | } | ||
1583 | |||
1563 | /* Only push out an existing timer */ | 1584 | /* Only push out an existing timer */ |
1564 | if (timer_pending(&sc->sc_idle_timeout)) | 1585 | if (timer_pending(&sc->sc_idle_timeout)) |
1565 | o2net_sc_reset_idle_timer(sc); | 1586 | o2net_sc_reset_idle_timer(sc); |
@@ -1650,6 +1671,12 @@ static void o2net_start_connect(struct work_struct *work) | |||
1650 | goto out; | 1671 | goto out; |
1651 | } | 1672 | } |
1652 | 1673 | ||
1674 | ret = o2net_set_usertimeout(sock); | ||
1675 | if (ret) { | ||
1676 | mlog(ML_ERROR, "set TCP_USER_TIMEOUT failed with %d\n", ret); | ||
1677 | goto out; | ||
1678 | } | ||
1679 | |||
1653 | o2net_register_callbacks(sc->sc_sock->sk, sc); | 1680 | o2net_register_callbacks(sc->sc_sock->sk, sc); |
1654 | 1681 | ||
1655 | spin_lock(&nn->nn_lock); | 1682 | spin_lock(&nn->nn_lock); |
@@ -1831,6 +1858,12 @@ static int o2net_accept_one(struct socket *sock, int *more) | |||
1831 | goto out; | 1858 | goto out; |
1832 | } | 1859 | } |
1833 | 1860 | ||
1861 | ret = o2net_set_usertimeout(new_sock); | ||
1862 | if (ret) { | ||
1863 | mlog(ML_ERROR, "set TCP_USER_TIMEOUT failed with %d\n", ret); | ||
1864 | goto out; | ||
1865 | } | ||
1866 | |||
1834 | slen = sizeof(sin); | 1867 | slen = sizeof(sin); |
1835 | ret = new_sock->ops->getname(new_sock, (struct sockaddr *) &sin, | 1868 | ret = new_sock->ops->getname(new_sock, (struct sockaddr *) &sin, |
1836 | &slen, 1); | 1869 | &slen, 1); |
diff --git a/fs/ocfs2/cluster/tcp.h b/fs/ocfs2/cluster/tcp.h index 5bada2a69b50..c571e849fda4 100644 --- a/fs/ocfs2/cluster/tcp.h +++ b/fs/ocfs2/cluster/tcp.h | |||
@@ -63,6 +63,7 @@ typedef void (o2net_post_msg_handler_func)(int status, void *data, | |||
63 | #define O2NET_KEEPALIVE_DELAY_MS_DEFAULT 2000 | 63 | #define O2NET_KEEPALIVE_DELAY_MS_DEFAULT 2000 |
64 | #define O2NET_IDLE_TIMEOUT_MS_DEFAULT 30000 | 64 | #define O2NET_IDLE_TIMEOUT_MS_DEFAULT 30000 |
65 | 65 | ||
66 | #define O2NET_TCP_USER_TIMEOUT 0x7fffffff | ||
66 | 67 | ||
67 | /* TODO: figure this out.... */ | 68 | /* TODO: figure this out.... */ |
68 | static inline int o2net_link_down(int err, struct socket *sock) | 69 | static inline int o2net_link_down(int err, struct socket *sock) |
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c index 6f66b3751ace..53e6c40ed4c6 100644 --- a/fs/ocfs2/ioctl.c +++ b/fs/ocfs2/ioctl.c | |||
@@ -35,9 +35,8 @@ | |||
35 | copy_to_user((typeof(a) __user *)b, &(a), sizeof(a)) | 35 | copy_to_user((typeof(a) __user *)b, &(a), sizeof(a)) |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * This call is void because we are already reporting an error that may | 38 | * This is just a best-effort to tell userspace that this request |
39 | * be -EFAULT. The error will be returned from the ioctl(2) call. It's | 39 | * caused the error. |
40 | * just a best-effort to tell userspace that this request caused the error. | ||
41 | */ | 40 | */ |
42 | static inline void o2info_set_request_error(struct ocfs2_info_request *kreq, | 41 | static inline void o2info_set_request_error(struct ocfs2_info_request *kreq, |
43 | struct ocfs2_info_request __user *req) | 42 | struct ocfs2_info_request __user *req) |
@@ -146,136 +145,105 @@ bail: | |||
146 | static int ocfs2_info_handle_blocksize(struct inode *inode, | 145 | static int ocfs2_info_handle_blocksize(struct inode *inode, |
147 | struct ocfs2_info_request __user *req) | 146 | struct ocfs2_info_request __user *req) |
148 | { | 147 | { |
149 | int status = -EFAULT; | ||
150 | struct ocfs2_info_blocksize oib; | 148 | struct ocfs2_info_blocksize oib; |
151 | 149 | ||
152 | if (o2info_from_user(oib, req)) | 150 | if (o2info_from_user(oib, req)) |
153 | goto bail; | 151 | return -EFAULT; |
154 | 152 | ||
155 | oib.ib_blocksize = inode->i_sb->s_blocksize; | 153 | oib.ib_blocksize = inode->i_sb->s_blocksize; |
156 | 154 | ||
157 | o2info_set_request_filled(&oib.ib_req); | 155 | o2info_set_request_filled(&oib.ib_req); |
158 | 156 | ||
159 | if (o2info_to_user(oib, req)) | 157 | if (o2info_to_user(oib, req)) |
160 | goto bail; | 158 | return -EFAULT; |
161 | |||
162 | status = 0; | ||
163 | bail: | ||
164 | if (status) | ||
165 | o2info_set_request_error(&oib.ib_req, req); | ||
166 | 159 | ||
167 | return status; | 160 | return 0; |
168 | } | 161 | } |
169 | 162 | ||
170 | static int ocfs2_info_handle_clustersize(struct inode *inode, | 163 | static int ocfs2_info_handle_clustersize(struct inode *inode, |
171 | struct ocfs2_info_request __user *req) | 164 | struct ocfs2_info_request __user *req) |
172 | { | 165 | { |
173 | int status = -EFAULT; | ||
174 | struct ocfs2_info_clustersize oic; | 166 | struct ocfs2_info_clustersize oic; |
175 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 167 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
176 | 168 | ||
177 | if (o2info_from_user(oic, req)) | 169 | if (o2info_from_user(oic, req)) |
178 | goto bail; | 170 | return -EFAULT; |
179 | 171 | ||
180 | oic.ic_clustersize = osb->s_clustersize; | 172 | oic.ic_clustersize = osb->s_clustersize; |
181 | 173 | ||
182 | o2info_set_request_filled(&oic.ic_req); | 174 | o2info_set_request_filled(&oic.ic_req); |
183 | 175 | ||
184 | if (o2info_to_user(oic, req)) | 176 | if (o2info_to_user(oic, req)) |
185 | goto bail; | 177 | return -EFAULT; |
186 | |||
187 | status = 0; | ||
188 | bail: | ||
189 | if (status) | ||
190 | o2info_set_request_error(&oic.ic_req, req); | ||
191 | 178 | ||
192 | return status; | 179 | return 0; |
193 | } | 180 | } |
194 | 181 | ||
195 | static int ocfs2_info_handle_maxslots(struct inode *inode, | 182 | static int ocfs2_info_handle_maxslots(struct inode *inode, |
196 | struct ocfs2_info_request __user *req) | 183 | struct ocfs2_info_request __user *req) |
197 | { | 184 | { |
198 | int status = -EFAULT; | ||
199 | struct ocfs2_info_maxslots oim; | 185 | struct ocfs2_info_maxslots oim; |
200 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 186 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
201 | 187 | ||
202 | if (o2info_from_user(oim, req)) | 188 | if (o2info_from_user(oim, req)) |
203 | goto bail; | 189 | return -EFAULT; |
204 | 190 | ||
205 | oim.im_max_slots = osb->max_slots; | 191 | oim.im_max_slots = osb->max_slots; |
206 | 192 | ||
207 | o2info_set_request_filled(&oim.im_req); | 193 | o2info_set_request_filled(&oim.im_req); |
208 | 194 | ||
209 | if (o2info_to_user(oim, req)) | 195 | if (o2info_to_user(oim, req)) |
210 | goto bail; | 196 | return -EFAULT; |
211 | 197 | ||
212 | status = 0; | 198 | return 0; |
213 | bail: | ||
214 | if (status) | ||
215 | o2info_set_request_error(&oim.im_req, req); | ||
216 | |||
217 | return status; | ||
218 | } | 199 | } |
219 | 200 | ||
220 | static int ocfs2_info_handle_label(struct inode *inode, | 201 | static int ocfs2_info_handle_label(struct inode *inode, |
221 | struct ocfs2_info_request __user *req) | 202 | struct ocfs2_info_request __user *req) |
222 | { | 203 | { |
223 | int status = -EFAULT; | ||
224 | struct ocfs2_info_label oil; | 204 | struct ocfs2_info_label oil; |
225 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 205 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
226 | 206 | ||
227 | if (o2info_from_user(oil, req)) | 207 | if (o2info_from_user(oil, req)) |
228 | goto bail; | 208 | return -EFAULT; |
229 | 209 | ||
230 | memcpy(oil.il_label, osb->vol_label, OCFS2_MAX_VOL_LABEL_LEN); | 210 | memcpy(oil.il_label, osb->vol_label, OCFS2_MAX_VOL_LABEL_LEN); |
231 | 211 | ||
232 | o2info_set_request_filled(&oil.il_req); | 212 | o2info_set_request_filled(&oil.il_req); |
233 | 213 | ||
234 | if (o2info_to_user(oil, req)) | 214 | if (o2info_to_user(oil, req)) |
235 | goto bail; | 215 | return -EFAULT; |
236 | 216 | ||
237 | status = 0; | 217 | return 0; |
238 | bail: | ||
239 | if (status) | ||
240 | o2info_set_request_error(&oil.il_req, req); | ||
241 | |||
242 | return status; | ||
243 | } | 218 | } |
244 | 219 | ||
245 | static int ocfs2_info_handle_uuid(struct inode *inode, | 220 | static int ocfs2_info_handle_uuid(struct inode *inode, |
246 | struct ocfs2_info_request __user *req) | 221 | struct ocfs2_info_request __user *req) |
247 | { | 222 | { |
248 | int status = -EFAULT; | ||
249 | struct ocfs2_info_uuid oiu; | 223 | struct ocfs2_info_uuid oiu; |
250 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 224 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
251 | 225 | ||
252 | if (o2info_from_user(oiu, req)) | 226 | if (o2info_from_user(oiu, req)) |
253 | goto bail; | 227 | return -EFAULT; |
254 | 228 | ||
255 | memcpy(oiu.iu_uuid_str, osb->uuid_str, OCFS2_TEXT_UUID_LEN + 1); | 229 | memcpy(oiu.iu_uuid_str, osb->uuid_str, OCFS2_TEXT_UUID_LEN + 1); |
256 | 230 | ||
257 | o2info_set_request_filled(&oiu.iu_req); | 231 | o2info_set_request_filled(&oiu.iu_req); |
258 | 232 | ||
259 | if (o2info_to_user(oiu, req)) | 233 | if (o2info_to_user(oiu, req)) |
260 | goto bail; | 234 | return -EFAULT; |
261 | |||
262 | status = 0; | ||
263 | bail: | ||
264 | if (status) | ||
265 | o2info_set_request_error(&oiu.iu_req, req); | ||
266 | 235 | ||
267 | return status; | 236 | return 0; |
268 | } | 237 | } |
269 | 238 | ||
270 | static int ocfs2_info_handle_fs_features(struct inode *inode, | 239 | static int ocfs2_info_handle_fs_features(struct inode *inode, |
271 | struct ocfs2_info_request __user *req) | 240 | struct ocfs2_info_request __user *req) |
272 | { | 241 | { |
273 | int status = -EFAULT; | ||
274 | struct ocfs2_info_fs_features oif; | 242 | struct ocfs2_info_fs_features oif; |
275 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 243 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
276 | 244 | ||
277 | if (o2info_from_user(oif, req)) | 245 | if (o2info_from_user(oif, req)) |
278 | goto bail; | 246 | return -EFAULT; |
279 | 247 | ||
280 | oif.if_compat_features = osb->s_feature_compat; | 248 | oif.if_compat_features = osb->s_feature_compat; |
281 | oif.if_incompat_features = osb->s_feature_incompat; | 249 | oif.if_incompat_features = osb->s_feature_incompat; |
@@ -284,39 +252,28 @@ static int ocfs2_info_handle_fs_features(struct inode *inode, | |||
284 | o2info_set_request_filled(&oif.if_req); | 252 | o2info_set_request_filled(&oif.if_req); |
285 | 253 | ||
286 | if (o2info_to_user(oif, req)) | 254 | if (o2info_to_user(oif, req)) |
287 | goto bail; | 255 | return -EFAULT; |
288 | 256 | ||
289 | status = 0; | 257 | return 0; |
290 | bail: | ||
291 | if (status) | ||
292 | o2info_set_request_error(&oif.if_req, req); | ||
293 | |||
294 | return status; | ||
295 | } | 258 | } |
296 | 259 | ||
297 | static int ocfs2_info_handle_journal_size(struct inode *inode, | 260 | static int ocfs2_info_handle_journal_size(struct inode *inode, |
298 | struct ocfs2_info_request __user *req) | 261 | struct ocfs2_info_request __user *req) |
299 | { | 262 | { |
300 | int status = -EFAULT; | ||
301 | struct ocfs2_info_journal_size oij; | 263 | struct ocfs2_info_journal_size oij; |
302 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 264 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
303 | 265 | ||
304 | if (o2info_from_user(oij, req)) | 266 | if (o2info_from_user(oij, req)) |
305 | goto bail; | 267 | return -EFAULT; |
306 | 268 | ||
307 | oij.ij_journal_size = i_size_read(osb->journal->j_inode); | 269 | oij.ij_journal_size = i_size_read(osb->journal->j_inode); |
308 | 270 | ||
309 | o2info_set_request_filled(&oij.ij_req); | 271 | o2info_set_request_filled(&oij.ij_req); |
310 | 272 | ||
311 | if (o2info_to_user(oij, req)) | 273 | if (o2info_to_user(oij, req)) |
312 | goto bail; | 274 | return -EFAULT; |
313 | 275 | ||
314 | status = 0; | 276 | return 0; |
315 | bail: | ||
316 | if (status) | ||
317 | o2info_set_request_error(&oij.ij_req, req); | ||
318 | |||
319 | return status; | ||
320 | } | 277 | } |
321 | 278 | ||
322 | static int ocfs2_info_scan_inode_alloc(struct ocfs2_super *osb, | 279 | static int ocfs2_info_scan_inode_alloc(struct ocfs2_super *osb, |
@@ -373,7 +330,7 @@ static int ocfs2_info_handle_freeinode(struct inode *inode, | |||
373 | u32 i; | 330 | u32 i; |
374 | u64 blkno = -1; | 331 | u64 blkno = -1; |
375 | char namebuf[40]; | 332 | char namebuf[40]; |
376 | int status = -EFAULT, type = INODE_ALLOC_SYSTEM_INODE; | 333 | int status, type = INODE_ALLOC_SYSTEM_INODE; |
377 | struct ocfs2_info_freeinode *oifi = NULL; | 334 | struct ocfs2_info_freeinode *oifi = NULL; |
378 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 335 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
379 | struct inode *inode_alloc = NULL; | 336 | struct inode *inode_alloc = NULL; |
@@ -385,8 +342,10 @@ static int ocfs2_info_handle_freeinode(struct inode *inode, | |||
385 | goto out_err; | 342 | goto out_err; |
386 | } | 343 | } |
387 | 344 | ||
388 | if (o2info_from_user(*oifi, req)) | 345 | if (o2info_from_user(*oifi, req)) { |
389 | goto bail; | 346 | status = -EFAULT; |
347 | goto out_free; | ||
348 | } | ||
390 | 349 | ||
391 | oifi->ifi_slotnum = osb->max_slots; | 350 | oifi->ifi_slotnum = osb->max_slots; |
392 | 351 | ||
@@ -424,14 +383,16 @@ static int ocfs2_info_handle_freeinode(struct inode *inode, | |||
424 | 383 | ||
425 | o2info_set_request_filled(&oifi->ifi_req); | 384 | o2info_set_request_filled(&oifi->ifi_req); |
426 | 385 | ||
427 | if (o2info_to_user(*oifi, req)) | 386 | if (o2info_to_user(*oifi, req)) { |
428 | goto bail; | 387 | status = -EFAULT; |
388 | goto out_free; | ||
389 | } | ||
429 | 390 | ||
430 | status = 0; | 391 | status = 0; |
431 | bail: | 392 | bail: |
432 | if (status) | 393 | if (status) |
433 | o2info_set_request_error(&oifi->ifi_req, req); | 394 | o2info_set_request_error(&oifi->ifi_req, req); |
434 | 395 | out_free: | |
435 | kfree(oifi); | 396 | kfree(oifi); |
436 | out_err: | 397 | out_err: |
437 | return status; | 398 | return status; |
@@ -658,7 +619,7 @@ static int ocfs2_info_handle_freefrag(struct inode *inode, | |||
658 | { | 619 | { |
659 | u64 blkno = -1; | 620 | u64 blkno = -1; |
660 | char namebuf[40]; | 621 | char namebuf[40]; |
661 | int status = -EFAULT, type = GLOBAL_BITMAP_SYSTEM_INODE; | 622 | int status, type = GLOBAL_BITMAP_SYSTEM_INODE; |
662 | 623 | ||
663 | struct ocfs2_info_freefrag *oiff; | 624 | struct ocfs2_info_freefrag *oiff; |
664 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 625 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
@@ -671,8 +632,10 @@ static int ocfs2_info_handle_freefrag(struct inode *inode, | |||
671 | goto out_err; | 632 | goto out_err; |
672 | } | 633 | } |
673 | 634 | ||
674 | if (o2info_from_user(*oiff, req)) | 635 | if (o2info_from_user(*oiff, req)) { |
675 | goto bail; | 636 | status = -EFAULT; |
637 | goto out_free; | ||
638 | } | ||
676 | /* | 639 | /* |
677 | * chunksize from userspace should be power of 2. | 640 | * chunksize from userspace should be power of 2. |
678 | */ | 641 | */ |
@@ -711,14 +674,14 @@ static int ocfs2_info_handle_freefrag(struct inode *inode, | |||
711 | 674 | ||
712 | if (o2info_to_user(*oiff, req)) { | 675 | if (o2info_to_user(*oiff, req)) { |
713 | status = -EFAULT; | 676 | status = -EFAULT; |
714 | goto bail; | 677 | goto out_free; |
715 | } | 678 | } |
716 | 679 | ||
717 | status = 0; | 680 | status = 0; |
718 | bail: | 681 | bail: |
719 | if (status) | 682 | if (status) |
720 | o2info_set_request_error(&oiff->iff_req, req); | 683 | o2info_set_request_error(&oiff->iff_req, req); |
721 | 684 | out_free: | |
722 | kfree(oiff); | 685 | kfree(oiff); |
723 | out_err: | 686 | out_err: |
724 | return status; | 687 | return status; |
@@ -727,23 +690,17 @@ out_err: | |||
727 | static int ocfs2_info_handle_unknown(struct inode *inode, | 690 | static int ocfs2_info_handle_unknown(struct inode *inode, |
728 | struct ocfs2_info_request __user *req) | 691 | struct ocfs2_info_request __user *req) |
729 | { | 692 | { |
730 | int status = -EFAULT; | ||
731 | struct ocfs2_info_request oir; | 693 | struct ocfs2_info_request oir; |
732 | 694 | ||
733 | if (o2info_from_user(oir, req)) | 695 | if (o2info_from_user(oir, req)) |
734 | goto bail; | 696 | return -EFAULT; |
735 | 697 | ||
736 | o2info_clear_request_filled(&oir); | 698 | o2info_clear_request_filled(&oir); |
737 | 699 | ||
738 | if (o2info_to_user(oir, req)) | 700 | if (o2info_to_user(oir, req)) |
739 | goto bail; | 701 | return -EFAULT; |
740 | 702 | ||
741 | status = 0; | 703 | return 0; |
742 | bail: | ||
743 | if (status) | ||
744 | o2info_set_request_error(&oir, req); | ||
745 | |||
746 | return status; | ||
747 | } | 704 | } |
748 | 705 | ||
749 | /* | 706 | /* |
diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h index c38355c1f3c9..1590c49cae57 100644 --- a/include/uapi/linux/xattr.h +++ b/include/uapi/linux/xattr.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #ifndef _UAPI_LINUX_XATTR_H | 13 | #ifndef _UAPI_LINUX_XATTR_H |
14 | #define _UAPI_LINUX_XATTR_H | 14 | #define _UAPI_LINUX_XATTR_H |
15 | 15 | ||
16 | #ifdef __UAPI_DEF_XATTR | 16 | #if __UAPI_DEF_XATTR |
17 | #define __USE_KERNEL_XATTR_DEFS | 17 | #define __USE_KERNEL_XATTR_DEFS |
18 | 18 | ||
19 | #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ | 19 | #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ |
diff --git a/kernel/kexec.c b/kernel/kexec.c index 0b49a0a58102..2bee072268d9 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -64,7 +64,9 @@ bool kexec_in_progress = false; | |||
64 | char __weak kexec_purgatory[0]; | 64 | char __weak kexec_purgatory[0]; |
65 | size_t __weak kexec_purgatory_size = 0; | 65 | size_t __weak kexec_purgatory_size = 0; |
66 | 66 | ||
67 | #ifdef CONFIG_KEXEC_FILE | ||
67 | static int kexec_calculate_store_digests(struct kimage *image); | 68 | static int kexec_calculate_store_digests(struct kimage *image); |
69 | #endif | ||
68 | 70 | ||
69 | /* Location of the reserved area for the crash kernel */ | 71 | /* Location of the reserved area for the crash kernel */ |
70 | struct resource crashk_res = { | 72 | struct resource crashk_res = { |
@@ -341,6 +343,7 @@ out_free_image: | |||
341 | return ret; | 343 | return ret; |
342 | } | 344 | } |
343 | 345 | ||
346 | #ifdef CONFIG_KEXEC_FILE | ||
344 | static int copy_file_from_fd(int fd, void **buf, unsigned long *buf_len) | 347 | static int copy_file_from_fd(int fd, void **buf, unsigned long *buf_len) |
345 | { | 348 | { |
346 | struct fd f = fdget(fd); | 349 | struct fd f = fdget(fd); |
@@ -612,6 +615,9 @@ out_free_image: | |||
612 | kfree(image); | 615 | kfree(image); |
613 | return ret; | 616 | return ret; |
614 | } | 617 | } |
618 | #else /* CONFIG_KEXEC_FILE */ | ||
619 | static inline void kimage_file_post_load_cleanup(struct kimage *image) { } | ||
620 | #endif /* CONFIG_KEXEC_FILE */ | ||
615 | 621 | ||
616 | static int kimage_is_destination_range(struct kimage *image, | 622 | static int kimage_is_destination_range(struct kimage *image, |
617 | unsigned long start, | 623 | unsigned long start, |
@@ -1375,6 +1381,7 @@ COMPAT_SYSCALL_DEFINE4(kexec_load, compat_ulong_t, entry, | |||
1375 | } | 1381 | } |
1376 | #endif | 1382 | #endif |
1377 | 1383 | ||
1384 | #ifdef CONFIG_KEXEC_FILE | ||
1378 | SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd, | 1385 | SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd, |
1379 | unsigned long, cmdline_len, const char __user *, cmdline_ptr, | 1386 | unsigned long, cmdline_len, const char __user *, cmdline_ptr, |
1380 | unsigned long, flags) | 1387 | unsigned long, flags) |
@@ -1451,6 +1458,8 @@ out: | |||
1451 | return ret; | 1458 | return ret; |
1452 | } | 1459 | } |
1453 | 1460 | ||
1461 | #endif /* CONFIG_KEXEC_FILE */ | ||
1462 | |||
1454 | void crash_kexec(struct pt_regs *regs) | 1463 | void crash_kexec(struct pt_regs *regs) |
1455 | { | 1464 | { |
1456 | /* Take the kexec_mutex here to prevent sys_kexec_load | 1465 | /* Take the kexec_mutex here to prevent sys_kexec_load |
@@ -2006,6 +2015,7 @@ static int __init crash_save_vmcoreinfo_init(void) | |||
2006 | 2015 | ||
2007 | subsys_initcall(crash_save_vmcoreinfo_init); | 2016 | subsys_initcall(crash_save_vmcoreinfo_init); |
2008 | 2017 | ||
2018 | #ifdef CONFIG_KEXEC_FILE | ||
2009 | static int __kexec_add_segment(struct kimage *image, char *buf, | 2019 | static int __kexec_add_segment(struct kimage *image, char *buf, |
2010 | unsigned long bufsz, unsigned long mem, | 2020 | unsigned long bufsz, unsigned long mem, |
2011 | unsigned long memsz) | 2021 | unsigned long memsz) |
@@ -2682,6 +2692,7 @@ int kexec_purgatory_get_set_symbol(struct kimage *image, const char *name, | |||
2682 | 2692 | ||
2683 | return 0; | 2693 | return 0; |
2684 | } | 2694 | } |
2695 | #endif /* CONFIG_KEXEC_FILE */ | ||
2685 | 2696 | ||
2686 | /* | 2697 | /* |
2687 | * Move into place and start executing a preloaded standalone | 2698 | * Move into place and start executing a preloaded standalone |
diff --git a/kernel/resource.c b/kernel/resource.c index da14b8d09296..60c5a3856ab7 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -351,15 +351,12 @@ static int find_next_iomem_res(struct resource *res, char *name, | |||
351 | end = res->end; | 351 | end = res->end; |
352 | BUG_ON(start >= end); | 352 | BUG_ON(start >= end); |
353 | 353 | ||
354 | read_lock(&resource_lock); | 354 | if (first_level_children_only) |
355 | |||
356 | if (first_level_children_only) { | ||
357 | p = iomem_resource.child; | ||
358 | sibling_only = true; | 355 | sibling_only = true; |
359 | } else | ||
360 | p = &iomem_resource; | ||
361 | 356 | ||
362 | while ((p = next_resource(p, sibling_only))) { | 357 | read_lock(&resource_lock); |
358 | |||
359 | for (p = iomem_resource.child; p; p = next_resource(p, sibling_only)) { | ||
363 | if (p->flags != res->flags) | 360 | if (p->flags != res->flags) |
364 | continue; | 361 | continue; |
365 | if (name && strcmp(p->name, name)) | 362 | if (name && strcmp(p->name, name)) |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 1b233fc67466..a28590083622 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -1036,8 +1036,13 @@ config TRACE_IRQFLAGS | |||
1036 | either tracing or lock debugging. | 1036 | either tracing or lock debugging. |
1037 | 1037 | ||
1038 | config STACKTRACE | 1038 | config STACKTRACE |
1039 | bool | 1039 | bool "Stack backtrace support" |
1040 | depends on STACKTRACE_SUPPORT | 1040 | depends on STACKTRACE_SUPPORT |
1041 | help | ||
1042 | This option causes the kernel to create a /proc/pid/stack for | ||
1043 | every process, showing its current stack trace. | ||
1044 | It is also used by various kernel debugging features that require | ||
1045 | stack trace generation. | ||
1041 | 1046 | ||
1042 | config DEBUG_KOBJECT | 1047 | config DEBUG_KOBJECT |
1043 | bool "kobject debugging" | 1048 | bool "kobject debugging" |
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index 9eebfadeeee1..a67c26e0f360 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c | |||
@@ -217,7 +217,7 @@ void hugetlb_cgroup_uncharge_page(int idx, unsigned long nr_pages, | |||
217 | 217 | ||
218 | if (hugetlb_cgroup_disabled()) | 218 | if (hugetlb_cgroup_disabled()) |
219 | return; | 219 | return; |
220 | VM_BUG_ON(!spin_is_locked(&hugetlb_lock)); | 220 | lockdep_assert_held(&hugetlb_lock); |
221 | h_cg = hugetlb_cgroup_from_page(page); | 221 | h_cg = hugetlb_cgroup_from_page(page); |
222 | if (unlikely(!h_cg)) | 222 | if (unlikely(!h_cg)) |
223 | return; | 223 | return; |
diff --git a/mm/memblock.c b/mm/memblock.c index 6d2f219a48b0..70fad0c0dafb 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -192,8 +192,7 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size, | |||
192 | phys_addr_t align, phys_addr_t start, | 192 | phys_addr_t align, phys_addr_t start, |
193 | phys_addr_t end, int nid) | 193 | phys_addr_t end, int nid) |
194 | { | 194 | { |
195 | int ret; | 195 | phys_addr_t kernel_end, ret; |
196 | phys_addr_t kernel_end; | ||
197 | 196 | ||
198 | /* pump up @end */ | 197 | /* pump up @end */ |
199 | if (end == MEMBLOCK_ALLOC_ACCESSIBLE) | 198 | if (end == MEMBLOCK_ALLOC_ACCESSIBLE) |
diff --git a/mm/memory.c b/mm/memory.c index ab3537bcfed2..adeac306610f 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -751,7 +751,7 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, | |||
751 | unsigned long pfn = pte_pfn(pte); | 751 | unsigned long pfn = pte_pfn(pte); |
752 | 752 | ||
753 | if (HAVE_PTE_SPECIAL) { | 753 | if (HAVE_PTE_SPECIAL) { |
754 | if (likely(!pte_special(pte) || pte_numa(pte))) | 754 | if (likely(!pte_special(pte))) |
755 | goto check_pfn; | 755 | goto check_pfn; |
756 | if (vma->vm_flags & (VM_PFNMAP | VM_MIXEDMAP)) | 756 | if (vma->vm_flags & (VM_PFNMAP | VM_MIXEDMAP)) |
757 | return NULL; | 757 | return NULL; |
@@ -777,15 +777,14 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, | |||
777 | } | 777 | } |
778 | } | 778 | } |
779 | 779 | ||
780 | if (is_zero_pfn(pfn)) | ||
781 | return NULL; | ||
780 | check_pfn: | 782 | check_pfn: |
781 | if (unlikely(pfn > highest_memmap_pfn)) { | 783 | if (unlikely(pfn > highest_memmap_pfn)) { |
782 | print_bad_pte(vma, addr, pte, NULL); | 784 | print_bad_pte(vma, addr, pte, NULL); |
783 | return NULL; | 785 | return NULL; |
784 | } | 786 | } |
785 | 787 | ||
786 | if (is_zero_pfn(pfn)) | ||
787 | return NULL; | ||
788 | |||
789 | /* | 788 | /* |
790 | * NOTE! We still have PageReserved() pages in the page tables. | 789 | * NOTE! We still have PageReserved() pages in the page tables. |
791 | * eg. VDSO mappings can cause them to exist. | 790 | * eg. VDSO mappings can cause them to exist. |
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index a8b919925934..dfb79e028ecb 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c | |||
@@ -195,7 +195,7 @@ void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, | |||
195 | pmd_t entry = *pmdp; | 195 | pmd_t entry = *pmdp; |
196 | if (pmd_numa(entry)) | 196 | if (pmd_numa(entry)) |
197 | entry = pmd_mknonnuma(entry); | 197 | entry = pmd_mknonnuma(entry); |
198 | set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(*pmdp)); | 198 | set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(entry)); |
199 | flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); | 199 | flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); |
200 | } | 200 | } |
201 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | 201 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
@@ -195,6 +195,7 @@ static struct zpool_driver zbud_zpool_driver = { | |||
195 | .total_size = zbud_zpool_total_size, | 195 | .total_size = zbud_zpool_total_size, |
196 | }; | 196 | }; |
197 | 197 | ||
198 | MODULE_ALIAS("zpool-zbud"); | ||
198 | #endif /* CONFIG_ZPOOL */ | 199 | #endif /* CONFIG_ZPOOL */ |
199 | 200 | ||
200 | /***************** | 201 | /***************** |
diff --git a/mm/zpool.c b/mm/zpool.c index e40612a1df00..739cdf0d183a 100644 --- a/mm/zpool.c +++ b/mm/zpool.c | |||
@@ -150,7 +150,7 @@ struct zpool *zpool_create_pool(char *type, gfp_t gfp, struct zpool_ops *ops) | |||
150 | driver = zpool_get_driver(type); | 150 | driver = zpool_get_driver(type); |
151 | 151 | ||
152 | if (!driver) { | 152 | if (!driver) { |
153 | request_module(type); | 153 | request_module("zpool-%s", type); |
154 | driver = zpool_get_driver(type); | 154 | driver = zpool_get_driver(type); |
155 | } | 155 | } |
156 | 156 | ||
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 4e2fc83cb394..94f38fac5e81 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c | |||
@@ -315,6 +315,7 @@ static struct zpool_driver zs_zpool_driver = { | |||
315 | .total_size = zs_zpool_total_size, | 315 | .total_size = zs_zpool_total_size, |
316 | }; | 316 | }; |
317 | 317 | ||
318 | MODULE_ALIAS("zpool-zsmalloc"); | ||
318 | #endif /* CONFIG_ZPOOL */ | 319 | #endif /* CONFIG_ZPOOL */ |
319 | 320 | ||
320 | /* per-cpu VM mapping areas for zspage accesses that cross page boundaries */ | 321 | /* per-cpu VM mapping areas for zspage accesses that cross page boundaries */ |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 31a731e06f50..b385bcbbf2f5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2133,7 +2133,7 @@ sub process { | |||
2133 | # Check for improperly formed commit descriptions | 2133 | # Check for improperly formed commit descriptions |
2134 | if ($in_commit_log && | 2134 | if ($in_commit_log && |
2135 | $line =~ /\bcommit\s+[0-9a-f]{5,}/i && | 2135 | $line =~ /\bcommit\s+[0-9a-f]{5,}/i && |
2136 | $line !~ /\b[Cc]ommit [0-9a-f]{12,16} \("/) { | 2136 | $line !~ /\b[Cc]ommit [0-9a-f]{12,40} \("/) { |
2137 | $line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i; | 2137 | $line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i; |
2138 | my $init_char = $1; | 2138 | my $init_char = $1; |
2139 | my $orig_commit = lc($2); | 2139 | my $orig_commit = lc($2); |
@@ -2141,7 +2141,7 @@ sub process { | |||
2141 | my $desc = 'commit description'; | 2141 | my $desc = 'commit description'; |
2142 | ($id, $desc) = git_commit_info($orig_commit, $id, $desc); | 2142 | ($id, $desc) = git_commit_info($orig_commit, $id, $desc); |
2143 | ERROR("GIT_COMMIT_ID", | 2143 | ERROR("GIT_COMMIT_ID", |
2144 | "Please use 12 to 16 chars for the git commit ID like: '${init_char}ommit $id (\"$desc\")'\n" . $herecurr); | 2144 | "Please use 12 or more chars for the git commit ID like: '${init_char}ommit $id (\"$desc\")'\n" . $herecurr); |
2145 | } | 2145 | } |
2146 | 2146 | ||
2147 | # Check for added, moved or deleted files | 2147 | # Check for added, moved or deleted files |
diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile index 5386fd7c43ae..74bbefdeaf4c 100644 --- a/tools/testing/selftests/ipc/Makefile +++ b/tools/testing/selftests/ipc/Makefile | |||
@@ -1,18 +1,18 @@ | |||
1 | uname_M := $(shell uname -m 2>/dev/null || echo not) | 1 | uname_M := $(shell uname -m 2>/dev/null || echo not) |
2 | ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) | 2 | ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) |
3 | ifeq ($(ARCH),i386) | 3 | ifeq ($(ARCH),i386) |
4 | ARCH := X86 | 4 | ARCH := x86 |
5 | CFLAGS := -DCONFIG_X86_32 -D__i386__ | 5 | CFLAGS := -DCONFIG_X86_32 -D__i386__ |
6 | endif | 6 | endif |
7 | ifeq ($(ARCH),x86_64) | 7 | ifeq ($(ARCH),x86_64) |
8 | ARCH := X86 | 8 | ARCH := x86 |
9 | CFLAGS := -DCONFIG_X86_64 -D__x86_64__ | 9 | CFLAGS := -DCONFIG_X86_64 -D__x86_64__ |
10 | endif | 10 | endif |
11 | 11 | ||
12 | CFLAGS += -I../../../../usr/include/ | 12 | CFLAGS += -I../../../../usr/include/ |
13 | 13 | ||
14 | all: | 14 | all: |
15 | ifeq ($(ARCH),X86) | 15 | ifeq ($(ARCH),x86) |
16 | gcc $(CFLAGS) msgque.c -o msgque_test | 16 | gcc $(CFLAGS) msgque.c -o msgque_test |
17 | else | 17 | else |
18 | echo "Not an x86 target, can't build msgque selftest" | 18 | echo "Not an x86 target, can't build msgque selftest" |
diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index d7d6bbeeff2f..8aabd82db9e4 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile | |||
@@ -1,11 +1,11 @@ | |||
1 | uname_M := $(shell uname -m 2>/dev/null || echo not) | 1 | uname_M := $(shell uname -m 2>/dev/null || echo not) |
2 | ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) | 2 | ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) |
3 | ifeq ($(ARCH),i386) | 3 | ifeq ($(ARCH),i386) |
4 | ARCH := X86 | 4 | ARCH := x86 |
5 | CFLAGS := -DCONFIG_X86_32 -D__i386__ | 5 | CFLAGS := -DCONFIG_X86_32 -D__i386__ |
6 | endif | 6 | endif |
7 | ifeq ($(ARCH),x86_64) | 7 | ifeq ($(ARCH),x86_64) |
8 | ARCH := X86 | 8 | ARCH := x86 |
9 | CFLAGS := -DCONFIG_X86_64 -D__x86_64__ | 9 | CFLAGS := -DCONFIG_X86_64 -D__x86_64__ |
10 | endif | 10 | endif |
11 | 11 | ||
@@ -15,7 +15,7 @@ CFLAGS += -I../../../../usr/include/ | |||
15 | CFLAGS += -I../../../../arch/x86/include/ | 15 | CFLAGS += -I../../../../arch/x86/include/ |
16 | 16 | ||
17 | all: | 17 | all: |
18 | ifeq ($(ARCH),X86) | 18 | ifeq ($(ARCH),x86) |
19 | gcc $(CFLAGS) kcmp_test.c -o kcmp_test | 19 | gcc $(CFLAGS) kcmp_test.c -o kcmp_test |
20 | else | 20 | else |
21 | echo "Not an x86 target, can't build kcmp selftest" | 21 | echo "Not an x86 target, can't build kcmp selftest" |
diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile index 6816c491c5ff..ad4ab01cd28f 100644 --- a/tools/testing/selftests/memfd/Makefile +++ b/tools/testing/selftests/memfd/Makefile | |||
@@ -1,10 +1,10 @@ | |||
1 | uname_M := $(shell uname -m 2>/dev/null || echo not) | 1 | uname_M := $(shell uname -m 2>/dev/null || echo not) |
2 | ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) | 2 | ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) |
3 | ifeq ($(ARCH),i386) | 3 | ifeq ($(ARCH),i386) |
4 | ARCH := X86 | 4 | ARCH := x86 |
5 | endif | 5 | endif |
6 | ifeq ($(ARCH),x86_64) | 6 | ifeq ($(ARCH),x86_64) |
7 | ARCH := X86 | 7 | ARCH := x86 |
8 | endif | 8 | endif |
9 | 9 | ||
10 | CFLAGS += -D_FILE_OFFSET_BITS=64 | 10 | CFLAGS += -D_FILE_OFFSET_BITS=64 |
@@ -14,20 +14,20 @@ CFLAGS += -I../../../../include/uapi/ | |||
14 | CFLAGS += -I../../../../include/ | 14 | CFLAGS += -I../../../../include/ |
15 | 15 | ||
16 | all: | 16 | all: |
17 | ifeq ($(ARCH),X86) | 17 | ifeq ($(ARCH),x86) |
18 | gcc $(CFLAGS) memfd_test.c -o memfd_test | 18 | gcc $(CFLAGS) memfd_test.c -o memfd_test |
19 | else | 19 | else |
20 | echo "Not an x86 target, can't build memfd selftest" | 20 | echo "Not an x86 target, can't build memfd selftest" |
21 | endif | 21 | endif |
22 | 22 | ||
23 | run_tests: all | 23 | run_tests: all |
24 | ifeq ($(ARCH),X86) | 24 | ifeq ($(ARCH),x86) |
25 | gcc $(CFLAGS) memfd_test.c -o memfd_test | 25 | gcc $(CFLAGS) memfd_test.c -o memfd_test |
26 | endif | 26 | endif |
27 | @./memfd_test || echo "memfd_test: [FAIL]" | 27 | @./memfd_test || echo "memfd_test: [FAIL]" |
28 | 28 | ||
29 | build_fuse: | 29 | build_fuse: |
30 | ifeq ($(ARCH),X86) | 30 | ifeq ($(ARCH),x86) |
31 | gcc $(CFLAGS) fuse_mnt.c `pkg-config fuse --cflags --libs` -o fuse_mnt | 31 | gcc $(CFLAGS) fuse_mnt.c `pkg-config fuse --cflags --libs` -o fuse_mnt |
32 | gcc $(CFLAGS) fuse_test.c -o fuse_test | 32 | gcc $(CFLAGS) fuse_test.c -o fuse_test |
33 | else | 33 | else |