aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-02-28s390/page table dumper: add support for change-recording override bitHeiko Carstens2-5/+22
Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
2013-02-289p: if v9fs_fid_lookup() gets to asking server, it'd better have hashed dentryAl Viro1-3/+17
... otherwise the path we'd built isn't worth much. Don't accept such fids obtained from paths unless dentry is still alived by the end of the work. Signed-off-by: Al Viro <[email protected]>
2013-02-28x86/kvm: Fix pvclock vsyscall fixmapPeter Hurley1-1/+1
The physical memory fixmapped for the pvclock clock_gettime vsyscall was allocated, and thus is not a kernel symbol. __pa() is the proper method to use in this case. Fixes the crash below when booting a next-20130204+ smp guest on a 3.8-rc5+ KVM host. [ 0.666410] udevd[97]: starting version 175 [ 0.674043] udevd[97]: udevd:[97]: segfault at ffffffffff5fd020 ip 00007fff069e277f sp 00007fff068c9ef8 error d Acked-by: Marcelo Tosatti <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Gleb Natapov <[email protected]>
2013-02-289p: make sure ->lookup() adds fid to the right dentryAl Viro1-2/+5
Signed-off-by: Al Viro <[email protected]>
2013-02-289p: untangle ->lookup() a bitAl Viro1-18/+9
Signed-off-by: Al Viro <[email protected]>
2013-02-289p: double iput() in ->lookup() if d_materialise_unique() failsAl Viro1-1/+0
d_materialise_unique() does iput() itself. Signed-off-by: Al Viro <[email protected]>
2013-02-289p: v9fs_fid_add() can't fail nowAl Viro4-22/+11
Signed-off-by: Al Viro <[email protected]>
2013-02-28v9fs: get rid of v9fs_dentryAl Viro3-51/+9
->d_fsdata can act as hlist_head... Signed-off-by: Al Viro <[email protected]>
2013-02-27Merge branch 'akpm' (final batch from Andrew)Linus Torvalds429-3493/+5226
Merge third patch-bumb from Andrew Morton: "This wraps me up for -rc1. - Lots of misc stuff and things which were deferred/missed from patchbombings 1 & 2. - ocfs2 things - lib/scatterlist - hfsplus - fatfs - documentation - signals - procfs - lockdep - coredump - seqfile core - kexec - Tejun's large IDR tree reworkings - ipmi - partitions - nbd - random() things - kfifo - tools/testing/selftests updates - Sasha's large and pointless hlist cleanup" * emailed patches from Andrew Morton <[email protected]>: (163 commits) hlist: drop the node parameter from iterators kcmp: make it depend on CHECKPOINT_RESTORE selftests: add a simple doc tools/testing/selftests/Makefile: rearrange targets selftests/efivarfs: add create-read test selftests/efivarfs: add empty file creation test selftests: add tests for efivarfs kfifo: fix kfifo_alloc() and kfifo_init() kfifo: move kfifo.c from kernel/ to lib/ arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS w1: add support for DS2413 Dual Channel Addressable Switch memstick: move the dereference below the NULL test drivers/pps/clients/pps-gpio.c: use devm_kzalloc Documentation/DMA-API-HOWTO.txt: fix typo include/linux/eventfd.h: fix incorrect filename is a comment mtd: mtd_stresstest: use prandom_bytes() mtd: mtd_subpagetest: convert to use prandom library mtd: mtd_speedtest: use prandom_bytes mtd: mtd_pagetest: convert to use prandom library mtd: mtd_oobtest: convert to use prandom library ...
2013-02-28dmaengine: dw_dmac: move to generic DMA bindingArnd Bergmann4-116/+111
The original device tree binding for this driver, from Viresh Kumar unfortunately conflicted with the generic DMA binding, and did not allow to completely seperate slave device configuration from the controller. This is an attempt to replace it with an implementation of the generic binding, but it is currently completely untested, because I do not have any hardware with this particular controller. The patch applies on top of the slave-dma tree, which contains both the base support for the generic DMA binding, as well as the earlier attempt from Viresh. Both of these are currently not merged upstream however. This version incorporates feedback from Viresh Kumar, Andy Shevchenko and Russell King. Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Viresh Kumar <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Cc: Vinod Koul <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Vinod Koul <[email protected]>
2013-02-279p: turn fid->dlist into hlistAl Viro4-11/+9
Signed-off-by: Al Viro <[email protected]>
2013-02-279p: don't bother with private lock in ->d_fsdata; dentry->d_lock will do ↵Al Viro2-7/+6
just fine Signed-off-by: Al Viro <[email protected]>
2013-02-27target/pscsi: Rename sg_num to nr_vecs in pscsi_get_bio()Asias He1-2/+2
It is actually a vector not a sg, so nr_vecs is better than sg_num. Signed-off-by: Asias He <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-02-27target/pscsi: Fix page incrementAsias He1-1/+0
The page++ is wrong. It makes bio_add_pc_page() pointing to a wrong page address if the 'while (len > 0 && data_len > 0) { ... }' loop is executed more than one once. Signed-off-by: Asias He <[email protected]> Cc: <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-02-27target/pscsi: Drop unnecessary NULL assignment to bio->bi_nextAsias He1-2/+0
Signed-off-by: Asias He <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-02-27target: Add __exit annotation for module_exit functionsAsias He4-4/+4
Inclues sbp_exit, fileio_module_exit, iblock_module_exit and pscsi_module_exit. Note: rd_module_exit() can not be annotated by __exit, becasue it is called by target_core_init_configfs() which is annotated by __init. Signed-off-by: Asias He <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-02-27hlist: drop the node parameter from iteratorsSasha Levin218-1494/+987
I'm not sure why, but the hlist for each entry iterators were conceived list_for_each_entry(pos, head, member) The hlist ones were greedy and wanted an extra parameter: hlist_for_each_entry(tpos, pos, head, member) Why did they need an extra pos parameter? I'm not quite sure. Not only they don't really need it, it also prevents the iterator from looking exactly like the list iterator, which is unfortunate. Besides the semantic patch, there was some manual work required: - Fix up the actual hlist iterators in linux/list.h - Fix up the declaration of other iterators based on the hlist ones. - A very small amount of places were using the 'node' parameter, this was modified to use 'obj->member' instead. - Coccinelle didn't handle the hlist_for_each_entry_safe iterator properly, so those had to be fixed up manually. The semantic patch which is mostly the work of Peter Senna Tschudin is here: @@ iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host; type T; expression a,c,d,e; identifier b; statement S; @@ -T b; <+... when != b ( hlist_for_each_entry(a, - b, c, d) S | hlist_for_each_entry_continue(a, - b, c) S | hlist_for_each_entry_from(a, - b, c) S | hlist_for_each_entry_rcu(a, - b, c, d) S | hlist_for_each_entry_rcu_bh(a, - b, c, d) S | hlist_for_each_entry_continue_rcu_bh(a, - b, c) S | for_each_busy_worker(a, c, - b, d) S | ax25_uid_for_each(a, - b, c) S | ax25_for_each(a, - b, c) S | inet_bind_bucket_for_each(a, - b, c) S | sctp_for_each_hentry(a, - b, c) S | sk_for_each(a, - b, c) S | sk_for_each_rcu(a, - b, c) S | sk_for_each_from -(a, b) +(a) S + sk_for_each_from(a) S | sk_for_each_safe(a, - b, c, d) S | sk_for_each_bound(a, - b, c) S | hlist_for_each_entry_safe(a, - b, c, d, e) S | hlist_for_each_entry_continue_rcu(a, - b, c) S | nr_neigh_for_each(a, - b, c) S | nr_neigh_for_each_safe(a, - b, c, d) S | nr_node_for_each(a, - b, c) S | nr_node_for_each_safe(a, - b, c, d) S | - for_each_gfn_sp(a, c, d, b) S + for_each_gfn_sp(a, c, d) S | - for_each_gfn_indirect_valid_sp(a, c, d, b) S + for_each_gfn_indirect_valid_sp(a, c, d) S | for_each_host(a, - b, c) S | for_each_host_safe(a, - b, c, d) S | for_each_mesh_entry(a, - b, c, d) S ) ...+> [[email protected]: drop bogus change from net/ipv4/raw.c] [[email protected]: drop bogus hunk from net/ipv6/raw.c] [[email protected]: checkpatch fixes] [[email protected]: fix warnings] [[email protected]: redo intrusive kvm changes] Tested-by: Peter Senna Tschudin <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Cc: Wu Fengguang <[email protected]> Cc: Marcelo Tosatti <[email protected]> Cc: Gleb Natapov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27kcmp: make it depend on CHECKPOINT_RESTORECyrill Gorcunov1-3/+1
Since kcmp syscall has been implemented (initially on x86 architecture) a number of other archs wire it up as well: xtensa, sparc, sh, s390, mips, microblaze, m68k (not taking into account those who uses <asm-generic/unistd.h> for syscall numbers definitions). But the Makefile, which turns kcmp.o generation on still depends on former config-x86. Thus get rid of this limitation and make kcmp.o depend on CHECKPOINT_RESTORE option. Signed-off-by: Cyrill Gorcunov <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: Andrey Vagin <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27selftests: add a simple docJeremy Kerr1-0/+42
This change adds a little documentation to the tests under tools/testing/selftests/, based on akpm's explanation. [[email protected]: move from Documentation to tools/testing/selftests/README.txt] Signed-off-by: Jeremy Kerr <[email protected]> Cc: Dave Young <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27tools/testing/selftests/Makefile: rearrange targetsAndrew Morton1-1/+7
Do it one-per-line to reduce patch conflict pain. Cc: Dave Young <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27selftests/efivarfs: add create-read testJeremy Kerr3-1/+46
Test that reads from a newly-created efivarfs file (with no data written) will return EOF. Signed-off-by: Jeremy Kerr <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Lingzhu Xiang <[email protected]> Cc: Dave Young <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27selftests/efivarfs: add empty file creation testJeremy Kerr1-0/+13
Signed-off-by: Jeremy Kerr <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Lingzhu Xiang <[email protected]> Cc: Dave Young <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27selftests: add tests for efivarfsJeremy Kerr4-1/+195
This change adds a few initial efivarfs tests to the tools/testing/selftests directory. The open-unlink test is based on code from Lingzhu Xiang. Signed-off-by: Jeremy Kerr <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Lingzhu Xiang <[email protected]> Cc: Dave Young <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27kfifo: fix kfifo_alloc() and kfifo_init()Stefani Seibold1-4/+2
Fix kfifo_alloc() and kfifo_init() to alloc at least the requested number of elements. Since the kfifo operates on power of 2 the request size will be rounded up to the next power of two. Signed-off-by: Stefani Seibold <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27kfifo: move kfifo.c from kernel/ to lib/Stefani Seibold3-2/+2
Move kfifo.c from kernel/ to lib/ Signed-off-by: Stefani Seibold <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUSStephen Rothwell26-10/+30
Change it to CONFIG_HAVE_VIRT_TO_BUS and set it in all architecures that already provide virt_to_bus(). Signed-off-by: Stephen Rothwell <[email protected]> Reviewed-by: James Hogan <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: H Hartley Sweeten <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: James Bottomley <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27w1: add support for DS2413 Dual Channel Addressable SwitchMariusz Bialonczyk4-5/+189
Also fixes some whitespace inconsistency in Kconfig and w1_family.h when DS2408 chip support was added. Signed-off-by: Mariusz Bialonczyk <[email protected]> Acked-by: Evgeniy Polyakov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27memstick: move the dereference below the NULL testWei Yongjun1-1/+2
The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <[email protected]> Cc: Maxim Levitsky <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27drivers/pps/clients/pps-gpio.c: use devm_kzallocJulia Lawall1-4/+2
devm_kzalloc allocates memory that is released when a driver detaches. This patch uses devm_kzalloc for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall <[email protected]> Cc: Rodolfo Giometti <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27Documentation/DMA-API-HOWTO.txt: fix typoAndrew Morton1-1/+1
Noted by Jesper Cc: Jesper Juhl <[email protected]> Cc: Konrad Rzeszutek Wilk <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27include/linux/eventfd.h: fix incorrect filename is a commentMartin Sustrik1-1/+1
Comment in eventfd.h referred to 'include/asm-generic/fcntl.h' while the correct path is 'include/uapi/asm-generic/fcntl.h'. Signed-off-by: Martin Sustrik <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27mtd: mtd_stresstest: use prandom_bytes()Akinobu Mita1-2/+1
Signed-off-by: Akinobu Mita <[email protected]> Cc: Artem Bityutskiy <[email protected]> Cc: David Woodhouse <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Laight <[email protected]> Cc: Eilon Greenstein <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: Robert Love <[email protected]> Cc: Valdis Kletnieks <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27mtd: mtd_subpagetest: convert to use prandom libraryAkinobu Mita1-30/+12
This removes home-brewed pseudo-random number generator and use prandom library. Signed-off-by: Akinobu Mita <[email protected]> Cc: Artem Bityutskiy <[email protected]> Cc: David Woodhouse <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Laight <[email protected]> Cc: Eilon Greenstein <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: Robert Love <[email protected]> Cc: Valdis Kletnieks <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27mtd: mtd_speedtest: use prandom_bytesAkinobu Mita1-8/+1
Use prandom_bytes instead of equivalent local function. Signed-off-by: Akinobu Mita <[email protected]> Cc: Artem Bityutskiy <[email protected]> Cc: David Woodhouse <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Laight <[email protected]> Cc: Eilon Greenstein <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: Robert Love <[email protected]> Cc: Valdis Kletnieks <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27mtd: mtd_pagetest: convert to use prandom libraryAkinobu Mita1-30/+13
This removes home-brewed pseudo-random number generator and use prandom library. Signed-off-by: Akinobu Mita <[email protected]> Cc: Artem Bityutskiy <[email protected]> Cc: David Woodhouse <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Laight <[email protected]> Cc: Eilon Greenstein <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: Robert Love <[email protected]> Cc: Valdis Kletnieks <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27mtd: mtd_oobtest: convert to use prandom libraryAkinobu Mita1-33/+16
This removes home-brewed pseudo-random number generator and use prandom library. Signed-off-by: Akinobu Mita <[email protected]> Cc: Artem Bityutskiy <[email protected]> Cc: David Woodhouse <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Laight <[email protected]> Cc: Eilon Greenstein <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: Robert Love <[email protected]> Cc: Valdis Kletnieks <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27mtd: mtd_nandecctest: use prandom_bytes instead of get_random_bytes()Akinobu Mita1-1/+1
Using prandom_bytes() is enough. Because this data is only used for testing, not used for cryptographic use. Signed-off-by: Akinobu Mita <[email protected]> Cc: Artem Bityutskiy <[email protected]> Cc: David Woodhouse <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Laight <[email protected]> Cc: Eilon Greenstein <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: Robert Love <[email protected]> Cc: Valdis Kletnieks <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27kernel/utsname.c: fix wrong comment about clone_uts_ns()Yuanhan Liu1-1/+1
Fix the wrong comment about the return value of clone_uts_ns() Signed-off-by: Yuanhan Liu <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27nbd: fix sparse warningAlex Elder1-0/+1
I just fixed this in "drivers/block/rbd.c" and I noticed that "drivers/block/nbd.c" has the same problem. Fix a warning issued by sparse by adding some lockdep annotations to indicate the queue lock gets dropped (because it's held when do_nbd_request() is called) and re-acquired within the function. Signed-off-by: Alex Elder <[email protected]> Cc: Paul Clements <[email protected]> Cc: Paul Clements <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27nbd: update documentation and link to mailinglistWouter Verhelst2-34/+5
Documentation/blockdev/nbd.txt contained some documentation which was horribly outdated and probably still dates from the original patch that added NBD support to the kernel. This patch removes the useless and outdated bits. The tools on nbd.sf.net are fully documented in manpages, which is where documentation for the non-kernel bits should live. Additionally, add a reference to the MAINTAINERS file for the nbd-general mailinglist that is used for discussion of the userland tools and the kernel module already. Signed-off-by: Wouter Verhelst <[email protected]> Cc: Paul Clements <[email protected]> Cc: Paolo Bonzini <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27nbd: show read-only state in sysfsPaolo Bonzini1-0/+3
Pass the read-only flag to set_device_ro, so that it will be visible to the block layer and in sysfs. Signed-off-by: Paolo Bonzini <[email protected]> Cc: Paul Clements <[email protected]> Cc: Alex Bligh <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27nbd: fsync and kill block device on shutdownPaolo Bonzini1-0/+10
There are two problems with shutdown in the NBD driver. 1: Receiving the NBD_DISCONNECT ioctl does not sync the filesystem. This patch adds the sync operation into __nbd_ioctl()'s NBD_DISCONNECT handler. This is useful because BLKFLSBUF is restricted to processes that have CAP_SYS_ADMIN, and the NBD client may not possess it (fsync of the block device does not sync the filesystem, either). 2: Once we clear the socket we have no guarantee that later reads will come from the same backing storage. The patch adds calls to kill_bdev() in __nbd_ioctl()'s socket clearing code so the page cache is cleaned, lest reads that hit on the page cache will return stale data from the previously-accessible disk. Example: # qemu-nbd -r -c/dev/nbd0 /dev/sr0 # file -s /dev/nbd0 /dev/stdin: # UDF filesystem data (version 1.5) etc. # qemu-nbd -d /dev/nbd0 # qemu-nbd -r -c/dev/nbd0 /dev/sda # file -s /dev/nbd0 /dev/stdin: # UDF filesystem data (version 1.5) etc. While /dev/sda has: # file -s /dev/sda /dev/sda: x86 boot sector; etc. Signed-off-by: Paolo Bonzini <[email protected]> Acked-by: Paul Clements <[email protected]> Cc: Alex Bligh <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27nbd: support FLUSH requestsAlex Bligh2-3/+22
Currently, the NBD device does not accept flush requests from the Linux block layer. If the NBD server opened the target with neither O_SYNC nor O_DSYNC, however, the device will be effectively backed by a writeback cache. Without issuing flushes properly, operation of the NBD device will not be safe against power losses. The NBD protocol has support for both a cache flush command and a FUA command flag; the server will also pass a flag to note its support for these features. This patch adds support for the cache flush command and flag. In the kernel, we receive the flags via the NBD_SET_FLAGS ioctl, and map NBD_FLAG_SEND_FLUSH to the argument of blk_queue_flush. When the flag is active the block layer will send REQ_FLUSH requests, which we translate to NBD_CMD_FLUSH commands. FUA support is not included in this patch because all free software servers implement it with a full fdatasync; thus it has no advantage over supporting flush only. Because I [Paolo] cannot really benchmark it in a realistic scenario, I cannot tell if it is a good idea or not. It is also not clear if it is valid for an NBD server to support FUA but not flush. The Linux block layer gives a warning for this combination, the NBD protocol documentation says nothing about it. The patch also fixes a small problem in the handling of flags: nbd->flags must be cleared at the end of NBD_DO_IT, but the driver was not doing that. The bug manifests itself as follows. Suppose you two different client/server pairs to start the NBD device. Suppose also that the first client supports NBD_SET_FLAGS, and the first server sends NBD_FLAG_SEND_FLUSH; the second pair instead does neither of these two things. Before this patch, the second invocation of NBD_DO_IT will use a stale value of nbd->flags, and the second server will issue an error every time it receives an NBD_CMD_FLUSH command. This bug is pre-existing, but it becomes much more important after this patch; flush failures make the device pretty much unusable, unlike Signed-off-by: Paolo Bonzini <[email protected]> Signed-off-by: Alex Bligh <[email protected]> Acked-by: Paul Clements <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27kernel/utsname_sysctl.c: put get/get_uts() into CONFIG_PROC_SYSCTL code blockYuanhan Liu1-1/+2
Put get/get_uts() into CONFIG_PROC_SYSCTL code block as they are used only when CONFIG_PROC_SYSCTL is enabled. Signed-off-by: Yuanhan Liu <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27sysctl: fix null checking in bin_dn_node_address()Xi Wang1-1/+2
The null check of `strchr() + 1' is broken, which is always non-null, leading to OOB read. Instead, check the result of strchr(). Signed-off-by: Xi Wang <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27block/partitions: optimize memory allocation in check_partition()Ming Lei3-8/+37
Currently, sizeof(struct parsed_partitions) may be 64KB in 32bit arch, so it is easy to trigger page allocation failure by check_partition, especially in hotplug block device situation(such as, USB mass storage, MMC card, ...), and Felipe Balbi has observed the failure. This patch does below optimizations on the allocation of struct parsed_partitions to try to address the issue: - make parsed_partitions.parts as pointer so that the pointed memory can fit in 32KB buffer, then approximate 32KB memory can be saved - vmalloc the buffer pointed by parsed_partitions.parts because 32KB is still a bit big for kmalloc - given that many devices have the partition count limit, so only allocate disk_max_parts() partitions instead of 256 partitions always Signed-off-by: Ming Lei <[email protected]> Reported-by: Felipe Balbi <[email protected]> Cc: Jens Axboe <[email protected]> Reviewed-by: Yasuaki Ishimatsu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27block/partitions/mac.c: obey the state->limit constraintMing Lei1-0/+4
It isn't necessary to read the information of partitions whose number is equal and more than state->limit since only maximum state->limit partitions will be added inside rescan_partitions(). That is also what other kind of partitions are doing. Signed-off-by: Ming Lei <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Yasuaki Ishimatsu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27block/partitions/efi.c: ensure that the GPT header is at least the size of ↵Peter Jones1-2/+10
the structure. UEFI 2.3.1D will include a change to the spec language mandating that a GPT header must be greater than *or equal to* the size of the defined structure. While verifying that this would work on Linux, I discovered that we're not actually checking the minimum bound at all. The result of this is that when we verify the checksum, it's possible that on a malformed header (with header_size of 0), we won't actually verify any data. [[email protected]: fix printk warning] Signed-off-by: Peter Jones <[email protected]> Acked-by: Matt Fleming <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Stephen Warren <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27block/partition/msdos: detect AIX formatted disks even without 55aaPhilippe De Muyter1-3/+8
AIX formatted disks do not always have the MSDOS 55aa signature. This happens e.g. for unbootable AIX disks. Up to now, such disks were not recognized as AIX disks, because of the missing 55aa. Fix that by inverting the two tests. Let's first check for the AIX magic strings, and only if that fails check for the MSDOS magic word. Signed-off-by: Philippe De Muyter <[email protected]> Cc: Andreas Mohr <[email protected]> Cc: OGAWA Hirofumi <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Olaf Hering <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-27drivers/char/misc.c:misc_register(): do not loop on misc_list unconditionallyDae S. Kim1-7/+9
If the minor number is assigned dynamically, there is no need to search for misc->minor in misc_list, since misc->minor == MISC_DYNAMIC_MINOR. [[email protected]: reduce scope of local `c'] Signed-off-by: Dae S. Kim <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Greg KH <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>