path: root/.gitconfig
diff options
authorTobias Klauser <>2010-04-01 11:03:36 +0200
committerTobias Klauser <>2010-04-01 11:03:36 +0200
commitd7eb7f62e35df8d07d36046aac09a34dab49946d (patch)
tree963368e53ec20b3105bfd51b7cc347024a6c0628 /.gitconfig
parent6898becdeb56f90e25b87e0599b7fe12ab1d6bc1 (diff)
Add dist alias, taken from madduck and slightly adjusted
Diffstat (limited to '.gitconfig')
1 files changed, 1 insertions, 0 deletions
diff --git a/.gitconfig b/.gitconfig
index b440eb8..43d0de7 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -14,6 +14,7 @@
d = diff
ds = diff --stat
lp = log -p
+ dist = "!git archive --format=tar -v --prefix=$(git describe HEAD)/ $(git describe HEAD) | bzip2 -9v > ../$(git describe HEAD).tar.bz2"
ui = true
nvdimm: register nvdimm_bus devices with an nd_bus driver pmem: clarify a debug print in pmem_clear_poison x86/insn: remove pcommit Revert "KVM: x86: add pcommit support" nfit, tools/testing/nvdimm/: unify shutdown paths libnvdimm: move ->module to struct nvdimm_bus_descriptor nfit: cleanup acpi_nfit_init calling convention nfit: fix _FIT evaluation memory leak + use after free tools/testing/nvdimm: add manufacturing_{date|location} dimm properties tools/testing/nvdimm: add virtual ramdisk range acpi, nfit: treat virtual ramdisk SPA as pmem region pmem: kill __pmem address space pmem: kill wmb_pmem() libnvdimm, pmem: use nvdimm_flush() for namespace I/O writes fs/dax: remove wmb_pmem() libnvdimm, pmem: flush posted-write queues on shutdown ... 2016-07-26Merge branch 'for-4.8/drivers' of git:// Torvalds1-3/+1 Pull block driver updates from Jens Axboe: "This branch also contains core changes. I've come to the conclusion that from 4.9 and forward, I'll be doing just a single branch. We often have dependencies between core and drivers, and it's hard to always split them up appropriately without pulling core into drivers when that happens. That said, this contains: - separate secure erase type for the core block layer, from Christoph. - set of discard fixes, from Christoph. - bio shrinking fixes from Christoph, as a followup up to the op/flags change in the core branch. - map and append request fixes from Christoph. - NVMeF (NVMe over Fabrics) code from Christoph. This is pretty exciting! - nvme-loop fixes from Arnd. - removal of ->driverfs_dev from Dan, after providing a device_add_disk() helper. - bcache fixes from Bhaktipriya and Yijing. - cdrom subchannel read fix from Vchannaiah. - set of lightnvm updates from Wenwei, Matias, Johannes, and Javier. - set of drbd updates and fixes from Fabian, Lars, and Philipp. - mg_disk error path fix from Bart. - user notification for failed device add for loop, from Minfei. - NVMe in general: + NVMe delay quirk from Guilherme. + SR-IOV support and command retry limits from Keith. + fix for memory-less NUMA node from Masayoshi. + use UINT_MAX for discard sectors, from Minfei. + cancel IO fixes from Ming. + don't allocate unused major, from Neil. + error code fixup from Dan. + use constants for PSDT/FUSE from James. + variable init fix from Jay. + fabrics fixes from Ming, Sagi, and Wei. + various fixes" * 'for-4.8/drivers' of git:// (115 commits) nvme/pci: Provide SR-IOV support nvme: initialize variable before logical OR'ing it block: unexport various bio mapping helpers scsi/osd: open code blk_make_request target: stop using blk_make_request block: simplify and export blk_rq_append_bio block: ensure bios return from blk_get_request are properly initialized virtio_blk: use blk_rq_map_kern memstick: don't allow REQ_TYPE_BLOCK_PC requests block: shrink bio size again block: simplify and cleanup bvec pool handling block: get rid of bio_rw and READA block: don't ignore -EOPNOTSUPP blkdev_issue_write_same block: introduce BLKDEV_DISCARD_ZERO to fix zeroout NVMe: don't allocate unused nvme_major nvme: avoid crashes when node 0 is memoryless node. nvme: Limit command retries loop: Make user notify for adding loop device failed nvme-loop: fix nvme-loop Kconfig dependencies nvmet: fix return value check in nvmet_subsys_alloc() ... 2016-07-20block: add QUEUE_FLAG_DAX for devices to advertise their DAX supportToshi Kani1-1/+3 Currently, presence of direct_access() in block_device_operations indicates support of DAX on its block device. Because block_device_operations is instantiated with 'const', this DAX capablity may not be enabled conditinally. In preparation for supporting DAX to device-mapper devices, add QUEUE_FLAG_DAX to request_queue flags to advertise their DAX support. This will allow to set the DAX capability based on how mapped device is composed. Signed-off-by: Toshi Kani <> Acked-by: Dan Williams <> Signed-off-by: Mike Snitzer <> Cc: Jens Axboe <> Cc: Ross Zwisler <> Cc: Martin Schwidefsky <> Cc: Heiko Carstens <> Cc: <> Signed-off-by: Jens Axboe <> 2016-07-20block: get rid of bio_rw and READAChristoph Hellwig1-3/+1 These two are confusing leftover of the old world order, combining values of the REQ_OP_ and REQ_ namespaces. For callers that don't special case we mostly just replace bi_rw with bio_data_dir or op_is_write, except for the few cases where a switch over the REQ_OP_ values makes more sense. Any check for READA is replaced with an explicit check for REQ_RAHEAD. Also remove the READA alias for REQ_RAHEAD. Signed-off-by: Christoph Hellwig <> Reviewed-by: Johannes Thumshirn <> Reviewed-by: Mike Christie <> Signed-off-by: Jens Axboe <> 2016-07-12pmem: kill __pmem address spaceDan Williams1-2/+2 The __pmem address space was meant to annotate codepaths that touch persistent memory and need to coordinate a call to wmb_pmem(). Now that wmb_pmem() is gone, there is little need to keep this annotation. Cc: Christoph Hellwig <> Cc: Ross Zwisler <> Signed-off-by: Dan Williams <> 2016-06-07block, fs, mm, drivers: use bio set/get op accessorsMike Christie1-1/+1 This patch converts the simple bi_rw use cases in the block, drivers, mm and fs code to set/get the bio operation using bio_set_op_attrs/bio_op These should be simple one or two liner cases, so I just did them in one patch. The next patches handle the more complicated cases in a module per patch. Signed-off-by: Mike Christie <> Reviewed-by: Hannes Reinecke <> Signed-off-by: Jens Axboe <> 2016-05-18dax: enable dax in the presence of known media errors (badblocks)Dan Williams1-1/+1 1/ If a mapping overlaps a bad sector fail the request. 2/ Do not opportunistically report more dax-capable capacity than is requested when errors present. Reviewed-by: Jeff Moyer <> Reviewed-by: Christoph Hellwig <> Signed-off-by: Dan Williams <> [vishal: fix a conflict with system RAM collision patches] [vishal: add a 'size' parameter to ->direct_access] [vishal: fix a conflict with DAX alignment check patches] Signed-off-by: Vishal Verma <> 2016-04-04mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macrosKirill A. Shutemov1-1/+1 PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time ago with promise that one day it will be possible to implement page cache with bigger chunks than PAGE_SIZE. This promise never materialized. And unlikely will. We have many places where PAGE_CACHE_SIZE assumed to be equal to PAGE_SIZE. And it's constant source of confusion on whether PAGE_CACHE_* or PAGE_* constant should be used in a particular case, especially on the border between fs and mm. Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much breakage to be doable. Let's stop pretending that pages in page cache are special. They are not. The changes are pretty straight-forward: - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>; - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>; - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN}; - page_cache_get() -> get_page(); - page_cache_release() -> put_page(); This patch contains automated changes generated with coccinelle using script below. For some reason, coccinelle doesn't patch header files. I've called spatch for them manually. The only adjustment after coccinelle is revert of changes to PAGE_CAHCE_ALIGN definition: we are going to drop it later. There are few places in the code where coccinelle didn't reach. I'll fix them manually in a separate patch. Comments and documentation also will be addressed with the separate patch. virtual patch @@ expression E; @@ - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT) + E @@ expression E; @@ - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) + E @@ @@ - PAGE_CACHE_SHIFT + PAGE_SHIFT @@ @@ - PAGE_CACHE_SIZE + PAGE_SIZE @@ @@ - PAGE_CACHE_MASK + PAGE_MASK @@ expression E; @@ - PAGE_CACHE_ALIGN(E) + PAGE_ALIGN(E) @@ expression E; @@ - page_cache_get(E) + get_page(E) @@ expression E; @@ - page_cache_release(E) + put_page(E) Signed-off-by: Kirill A. Shutemov <> Acked-by: Michal Hocko <> Signed-off-by: Linus Torvalds <> 2016-03-15brd: Fix discard request processingBart Van Assche1-1/+1 Avoid that discard requests with size => PAGE_SIZE fail with -EIO. Refuse discard requests if the discard size is not a multiple of the page size. Fixes: 2dbe54957636 ("brd: Refuse improperly aligned discard requests") Signed-off-by: Bart Van Assche <> Reviewed-by: Jan Kara <> Cc: Christoph Hellwig <> Cc: Robert Elliot <> Cc: stable <> # v4.4+ Signed-off-by: Jens Axboe <> 2016-01-15mm, dax, pmem: introduce pfn_tDan Williams1-2/+5 For the purpose of communicating the optional presence of a 'struct page' for the pfn returned from ->direct_access(), introduce a type that encapsulates a page-frame-number plus flags. These flags contain the historical "page_link" encoding for a scatterlist entry, but can also denote "device memory". Where "device memory" is a set of pfns that are not part of the kernel's linear mapping by default, but are accessed via the same memory controller as ram. The motivation for this new type is large capacity persistent memory that needs struct page entries in the 'memmap' to support 3rd party DMA (i.e. O_DIRECT I/O with a persistent memory source/target). However, we also need it in support of maintaining a list of mapped inodes which need to be unmapped at driver teardown or freeze_bdev() time. Signed-off-by: Dan Williams <> Cc: Christoph Hellwig <> Cc: Dave Hansen <> Cc: Ross Zwisler <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <> 2015-11-11brd: Refuse improperly aligned discard requestsJan Kara1-0/+3 Currently when improperly aligned discard request is submitted, we just silently discard more / less data which results in filesystem corruption in some cases. Refuse such misaligned requests. Signed-off-by: Jan Kara <> Signed-off-by: Jens Axboe <> 2015-11-07block: change ->make_request_fn() and users to return a queue cookieJens Axboe1-2/+3 No functional changes in this patch, but it prepares us for returning a more useful cookie related to the IO that was queued up. Signed-off-by: Jens Axboe <> Acked-by: Christoph Hellwig <> Acked-by: Keith Busch <> 2015-09-08Merge tag 'libnvdimm-for-4.3' of ↵Linus Torvalds1-6/+2 git:// Pull libnvdimm updates from Dan Williams: "This update has successfully completed a 0day-kbuild run and has appeared in a linux-next release. The changes outside of the typical drivers/nvdimm/ and drivers/acpi/nfit.[ch] paths are related to the removal of IORESOURCE_CACHEABLE, the introduction of memremap(), and the introduction of ZONE_DEVICE + devm_memremap_pages(). Summary: - Introduce ZONE_DEVICE and devm_memremap_pages() as a generic mechanism for adding device-driver-discovered memory regions to the kernel's direct map. This facility is used by the pmem driver to enable pfn_to_page() operations on the page frames returned by DAX ('direct_access' in 'struct block_device_operations'). For now, the 'memmap' allocation for these "device" pages comes from "System RAM". Support for allocating the memmap from device memory will arrive in a later kernel. - Introduce memremap() to replace usages of ioremap_cache() and ioremap_wt(). memremap() drops the __iomem annotation for these mappings to memory that do not have i/o side effects. The replacement of ioremap_cache() with memremap() is limited to the pmem driver to ease merging the api change in v4.3. Completion of the conversion is targeted for v4.4. - Similar to the usage of memcpy_to_pmem() + wmb_pmem() in the pmem driver, update the VFS DAX implementation and PMEM api to provide persistence guarantees for kernel operations on a DAX mapping. - Convert the ACPI NFIT 'BLK' driver to map the block apertures as cacheable to improve performance. - Miscellaneous updates and fixes to libnvdimm including support for issuing "address range scrub" commands, clarifying the optimal 'sector size' of pmem devices, a clarification of the usage of the ACPI '_STA' (status) property for DIMM devices, and other minor fixes" * tag 'libnvdimm-for-4.3' of git:// (34 commits) libnvdimm, pmem: direct map legacy pmem by default libnvdimm, pmem: 'struct page' for pmem libnvdimm, pfn: 'struct page' provider infrastructure x86, pmem: clarify that ARCH_HAS_PMEM_API implies PMEM mapped WB add devm_memremap_pages mm: ZONE_DEVICE for "device memory" mm: move __phys_to_pfn and __pfn_to_phys to asm/generic/memory_model.h dax: drop size parameter to ->direct_access() nd_blk: change aperture mapping from WC to WB nvdimm: change to use generic kvfree() pmem, dax: have direct_access use __pmem annotation dax: update I/O path to do proper PMEM flushing pmem: add copy_from_iter_pmem() and clear_pmem() pmem, x86: clean up conditional pmem includes pmem: remove layer when calling arch_has_wmb_pmem() pmem, x86: move x86 PMEM API to new pmem.h header libnvdimm, e820: make CONFIG_X86_PMEM_LEGACY a tristate option pmem: switch to devm_ allocations devres: add devm_memremap libnvdimm, btt: write and validate parent_uuid ... 2015-08-27dax: drop size parameter to ->direct_access()Dan Williams1-5/+1 None of the implementations currently use it. The common bdev_direct_access() entry point handles all the size checks before calling ->direct_access(). Signed-off-by: Christoph Hellwig <> Signed-off-by: Dan Williams <> 2015-08-20pmem, dax: have direct_access use __pmem annotationRoss Zwisler1-2/+2 Update the annotation for the kaddr pointer returned by direct_access() so that it is a __pmem pointer. This is consistent with the PMEM driver and with how this direct_access() pointer is used in the DAX code. Signed-off-by: Ross Zwisler <> Reviewed-by: Christoph Hellwig <> Signed-off-by: Dan Williams <> 2015-07-29block: add a bi_error field to struct bioChristoph Hellwig1-5/+8 Currently we have two different ways to signal an I/O error on a BIO: (1) by clearing the BIO_UPTODATE flag (2) by returning a Linux errno value to the bi_end_io callback The first one has the drawback of only communicating a single possible error (-EIO), and the second one has the drawback of not beeing persistent when bios are queued up, and are not passed along from child to parent bio in the ever more popular chaining scenario. Having both mechanisms available has the additional drawback of utterly confusing driver authors and introducing bugs where various I/O submitters only deal with one of them, and the others have to add boilerplate code to deal with both kinds of error returns. So add a new bi_error field to store an errno value directly in struct bio and remove the existing mechanisms to clean all this up. Signed-off-by: Christoph Hellwig <> Reviewed-by: Hannes Reinecke <> Reviewed-by: NeilBrown <> Signed-off-by: Jens Axboe <> 2015-07-17block: have drivers use blk_queue_max_discard_sectors()Jens Axboe1-1/+1 Some drivers use it now, others just set the limits field manually. But in preparation for splitting this into a hard and soft limit, ensure that they all call the proper function for setting the hw limit for discards. Reviewed-by: Jeff Moyer <> Signed-off-by: Jens Axboe <> 2015-02-16brd: rename XIP to DAXMatthew Wilcox1-7/+7 Since this is relating to FS_XIP, not KERNEL_XIP, it should be called DAX instead of XIP. Signed-off-by: Matthew Wilcox <> Cc: Andreas Dilger <> Cc: Boaz Harrosh <> Cc: Christoph Hellwig <> Cc: Dave Chinner <> Cc: Jan Kara <> Cc: Jens Axboe <> Cc: Kirill A. Shutemov <> Cc: Mathieu Desnoyers <> Cc: Randy Dunlap <> Cc: Ross Zwisler <> Cc: Theodore Ts'o <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <> 2015-01-13brd: Request from fdisk 4k alignmentBoaz Harrosh1-0/+9 Because of the direct_access() API which returns a PFN. partitions better start on 4K boundary, else offset ZERO of a partition will not be aligned and blk_direct_access() will fail the call. By setting blk_queue_physical_block_size(PAGE_SIZE) we can communicate this to fdisk and friends. The call to blk_queue_physical_block_size() is harmless and will not affect the Kernel behavior in any way. It is only for communication to user-mode. before this patch running fdisk on a default size brd of 4M the first sector offered is 34 (BAD), but after this patch it will be 40, ie 8 sectors aligned. Also when entering some random partition sizes the next partition-start sector is offered 8 sectors aligned after this patch. (Please note that with fdisk the user can still enter bad values, only the offered default values will be correct) Note that with bdev-size > 4M fdisk will try to align on a 1M boundary (above first-sector will be 2048), in any case. CC: Martin K. Petersen <> Signed-off-by: Boaz Harrosh <> Reviewed-by: Martin K. Petersen <> Signed-off-by: Jens Axboe <> 2015-01-13brd: Fix all partitions BUGsBoaz Harrosh1-62/+38 This patch fixes up brd's partitions scheme, now enjoying all worlds. The MAIN fix here is that currently, if one fdisks some partitions, a BAD bug will make all partitions point to the same start-end sector ie: 0 - brd_size And an mkfs of any partition would trash the partition table and the other partition. Another fix is that "mount -U uuid" will not work if show_part was not specified, because of the GENHD_FL_SUPPRESS_PARTITION_INFO flag. We now always load without it and remove the show_part parameter. [We remove Dmitry's new module-param part_show it is now always show] So NOW the logic goes like this: * max_part - Just says how many minors to reserve between ramX devices. In any way, there can be as many partition as requested. If minors between devices ends, then dynamic 259-major ids will be allocated on the fly. The default is now max_part=1, which means all partitions devt(s) will be from the dynamic (259) major-range. (If persistent partition minors is needed use max_part=X) For example with /dev/sdX max_part is hard coded 16. * Creation of new devices on the fly still/always work: mknod /path/devnod b 1 X fdisk -l /path/devnod Will create a new device if [X / max_part] was not already created before. (Just as before) partitions on the dynamically created device will work as well Same logic applies with minors as with the pre-created ones. TODO: dynamic grow of device size. So each device can have it's own size. CC: Dmitry Monakhov <> Tested-by: Ross Zwisler <> Signed-off-by: Boaz Harrosh <> Signed-off-by: Jens Axboe <> 2015-01-13block: Change direct_access calling conventionMatthew Wilcox1-7/+7 In order to support accesses to larger chunks of memory, pass in a 'size' parameter (counted in bytes), and return the amount available at that address. Add a new helper function, bdev_direct_access(), to handle common functionality including partition handling, checking the length requested is positive, checking for the sector being page-aligned, and checking the length of the request does not pass the end of the partition. Signed-off-by: Matthew Wilcox <> Reviewed-by: Jan Kara <> Reviewed-by: Boaz Harrosh <> Signed-off-by: Jens Axboe <> 2014-08-21brd: add ram disk visibility optionDmitry Monakhov1-1/+5 Currenly ram disk is not visiable inside /proc/partitions. This was done for compatibility reasons here: 53978d0a7a27. But some utilities expect disk presents in /proc/partitions. Let's add module's option and let's administrator chose visibility behaviour. By default, old behaviour preserved. Signed-off-by: Dmitry Monakhov <> Signed-off-by: Jens Axboe <> 2014-06-04brd: return -ENOSPC rather than -ENOMEM on page allocation failureMatthew Wilcox1-3/+3 brd is effectively a thinly provisioned device. Thinly provisioned devices return -ENOSPC when they can't write a new block. -ENOMEM is an implementation detail that callers shouldn't know. Signed-off-by: Matthew Wilcox <> Acked-by: Dave Chinner <> Cc: Dheeraj Reddy <> Cc: Hugh Dickins <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <> 2014-06-04brd: add support for rw_page()Matthew Wilcox1-0/+10 Signed-off-by: Matthew Wilcox <> Cc: Dave Chinner <> Cc: Dheeraj Reddy <> Cc: Hugh Dickins <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <> 2013-11-23block: Convert bio_for_each_segment() to bvec_iterKent Overstreet1-6/+6 More prep work for immutable biovecs - with immutable bvecs drivers won't be able to use the biovec directly, they'll need to use helpers that take into account bio->bi_iter.bi_bvec_done. This updates callers for the new usage without changing the implementation yet. Signed-off-by: Kent Overstreet <> Cc: Jens Axboe <> Cc: Geert Uytterhoeven <> Cc: Benjamin Herrenschmidt <> Cc: Paul Mackerras <> Cc: "Ed L. Cashin" <> Cc: Nick Piggin <> Cc: Lars Ellenberg <> Cc: Jiri Kosina <> Cc: Paul Clements <> Cc: Jim Paris <> Cc: Geoff Levand <> Cc: Yehuda Sadeh <> Cc: Sage Weil <> Cc: Alex Elder <> Cc: Cc: Joshua Morris <> Cc: Philip Kelleher <> Cc: Konrad Rzeszutek Wilk <> Cc: Jeremy Fitzhardinge <> Cc: Neil Brown <> Cc: Martin Schwidefsky <> Cc: Heiko Carstens <> Cc: Cc: Nagalakshmi Nandigama <> Cc: Sreekanth Reddy <> Cc: Cc: "James E.J. Bottomley" <> Cc: Greg Kroah-Hartman <> Cc: Alexander Viro <> Cc: Steven Whitehouse <> Cc: Herton Ronaldo Krzesinski <> Cc: Tejun Heo <> Cc: Andrew Morton <> Cc: Guo Chao <> Cc: Asai Thambi S P <> Cc: Selvan Mani <> Cc: Sam Bradshaw <> Cc: Matthew Wilcox <> Cc: Keith Busch <> Cc: Stephen Hemminger <> Cc: Quoc-Son Anh <> Cc: Sebastian Ott <> Cc: Nitin Gupta <> Cc: Minchan Kim <> Cc: Jerome Marchand <> Cc: Seth Jennings <> Cc: "Martin K. Petersen" <> Cc: Mike Snitzer <> Cc: Vivek Goyal <> Cc: "Darrick J. Wong" <> Cc: Chris Metcalf <> Cc: Jan Kara <> Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Acked-by: Geoff Levand <> 2013-11-23block: Abstract out bvec iteratorKent Overstreet1-2/+2 Immutable biovecs are going to require an explicit iterator. To implement immutable bvecs, a later patch is going to add a bi_bvec_done member to this struct; for now, this patch effectively just renames things. Signed-off-by: Kent Overstreet <> Cc: Jens Axboe <> Cc: Geert Uytterhoeven <> Cc: Benjamin Herrenschmidt <> Cc: Paul Mackerras <> Cc: "Ed L. Cashin" <> Cc: Nick Piggin <> Cc: Lars Ellenberg <> Cc: Jiri Kosina <> Cc: Matthew Wilcox <> Cc: Geoff Levand <> Cc: Yehuda Sadeh <> Cc: Sage Weil <> Cc: Alex Elder <> Cc: Cc: Joshua Morris <> Cc: Philip Kelleher <> Cc: Rusty Russell <> Cc: "Michael S. Tsirkin" <> Cc: Konrad Rzeszutek Wilk <> Cc: Jeremy Fitzhardinge <> Cc: Neil Brown <> Cc: Alasdair Kergon <> Cc: Mike Snitzer <> Cc: Cc: Martin Schwidefsky <> Cc: Heiko Carstens <> Cc: Cc: Boaz Harrosh <> Cc: Benny Halevy <> Cc: "James E.J. Bottomley" <> Cc: Greg Kroah-Hartman <> Cc: "Nicholas A. Bellinger" <> Cc: Alexander Viro <> Cc: Chris Mason <> Cc: "Theodore Ts'o" <> Cc: Andreas Dilger <> Cc: Jaegeuk Kim <> Cc: Steven Whitehouse <> Cc: Dave Kleikamp <> Cc: Joern Engel <> Cc: Prasad Joshi <> Cc: Trond Myklebust <> Cc: KONISHI Ryusuke <> Cc: Mark Fasheh <> Cc: Joel Becker <> Cc: Ben Myers <> Cc: Cc: Steven Rostedt <> Cc: Frederic Weisbecker <> Cc: Ingo Molnar <> Cc: Len Brown <> Cc: Pavel Machek <> Cc: "Rafael J. Wysocki" <> Cc: Herton Ronaldo Krzesinski <> Cc: Ben Hutchings <> Cc: Andrew Morton <> Cc: Guo Chao <> Cc: Tejun Heo <> Cc: Asai Thambi S P <> Cc: Selvan Mani <> Cc: Sam Bradshaw <> Cc: Wei Yongjun <> Cc: "Roger Pau Monné" <> Cc: Jan Beulich <> Cc: Stefano Stabellini <> Cc: Ian Campbell <> Cc: Sebastian Ott <> Cc: Christian Borntraeger <> Cc: Minchan Kim <> Cc: Jiang Liu <> Cc: Nitin Gupta <> Cc: Jerome Marchand <> Cc: Joe Perches <> Cc: Peng Tao <> Cc: Andy Adamson <> Cc: fanchaoting <> Cc: Jie Liu <> Cc: Sunil Mushran <> Cc: "Martin K. Petersen" <> Cc: Namjae Jeon <> Cc: Pankaj Kumar <> Cc: Dan Magenheimer <> Cc: Mel Gorman <>6 2013-11-08block: fix a probe argument to blk_register_regionMikulas Patocka1-1/+1 The probe function is supposed to return NULL on failure (as we can see in kobj_lookup: kobj = probe(dev, index, data); ... if (kobj) return kobj; However, in loop and brd, it returns negative error from ERR_PTR. This causes a crash if we simulate disk allocation failure and run less -f /dev/loop0 because the negative number is interpreted as a pointer: BUG: unable to handle kernel NULL pointer dereference at 00000000000002b4 IP: [<ffffffff8118b188>] __blkdev_get+0x28/0x450 PGD 23c677067 PUD 23d6d1067 PMD 0 Oops: 0000 [#1] PREEMPT SMP Modules linked in: loop hpfs nvidia(PO) ip6table_filter ip6_tables uvesafb cfbcopyarea cfbimgblt cfbfillrect fbcon font bitblit fbcon_rotate fbcon_cw fbcon_ud fbcon_ccw softcursor fb fbdev msr ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_conntrack_ipv4 nf_defrag_ipv4 xt_state ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc tun ipv6 cpufreq_stats cpufreq_ondemand cpufreq_userspace cpufreq_powersave cpufreq_conservative hid_generic spadfs usbhid hid fuse raid0 snd_usb_audio snd_pcm_oss snd_mixer_oss md_mod snd_pcm snd_timer snd_page_alloc snd_hwdep snd_usbmidi_lib dmi_sysfs snd_rawmidi nf_nat_ftp nf_nat nf_conntrack_ftp nf_conntrack snd soundcore lm85 hwmon_vid ohci_hcd ehci_pci ehci_hcd serverworks sata_svw libata acpi_cpufreq freq_table mperf ide_core usbcore kvm_amd kvm tg3 i2c_piix4 libphy microcode e100 usb_common ptp skge i2c_core pcspkr k10temp evdev floppy hwmon pps_core mii rtc_cmos button processor unix [last unloaded: nvidia] CPU: 1 PID: 6831 Comm: less Tainted: P W O 3.10.15-devel #18 Hardware name: empty empty/S3992-E, BIOS 'V1.06 ' 06/09/2009 task: ffff880203cc6bc0 ti: ffff88023e47c000 task.ti: ffff88023e47c000 RIP: 0010:[<ffffffff8118b188>] [<ffffffff8118b188>] __blkdev_get+0x28/0x450 RSP: 0018:ffff88023e47dbd8 EFLAGS: 00010286 RAX: ffffffffffffff74 RBX: ffffffffffffff74 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: ffff88023e47dc18 R08: 0000000000000002 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff88023f519658 R13: ffffffff8118c300 R14: 0000000000000000 R15: ffff88023f519640 FS: 00007f2070bf7700(0000) GS:ffff880247400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000002b4 CR3: 000000023da1d000 CR4: 00000000000007e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Stack: 0000000000000002 0000001d00000000 000000003e47dc50 ffff88023f519640 ffff88043d5bb668 ffffffff8118c300 ffff88023d683550 ffff88023e47de60 ffff88023e47dc98 ffffffff8118c10d 0000001d81605698 0000000000000292 Call Trace: [<ffffffff8118c300>] ? blkdev_get_by_dev+0x60/0x60 [<ffffffff8118c10d>] blkdev_get+0x1dd/0x370 [<ffffffff8118c300>] ? blkdev_get_by_dev+0x60/0x60 [<ffffffff813cea6c>] ? _raw_spin_unlock+0x2c/0x50 [<ffffffff8118c300>] ? blkdev_get_by_dev+0x60/0x60 [<ffffffff8118c365>] blkdev_open+0x65/0x80 [<ffffffff8114d12e>] do_dentry_open.isra.18+0x23e/0x2f0 [<ffffffff8114d214>] finish_open+0x34/0x50 [<ffffffff8115e122>] do_last.isra.62+0x2d2/0xc50 [<ffffffff8115eb58>] path_openat.isra.63+0xb8/0x4d0 [<ffffffff81115a8e>] ? might_fault+0x4e/0xa0 [<ffffffff8115f4f0>] do_filp_open+0x40/0x90 [<ffffffff813cea6c>] ? _raw_spin_unlock+0x2c/0x50 [<ffffffff8116db85>] ? __alloc_fd+0xa5/0x1f0 [<ffffffff8114e45f>] do_sys_open+0xef/0x1d0 [<ffffffff8114e559>] SyS_open+0x19/0x20 [<ffffffff813cff16>] system_call_fastpath+0x1a/0x1f Code: 44 00 00 55 48 89 e5 41 57 49 89 ff 41 56 41 89 d6 41 55 41 54 4c 8d 67 18 53 48 83 ec 18 89 75 cc e9 f2 00 00 00 0f 1f 44 00 00 <48> 8b 80 40 03 00 00 48 89 df 4c 8b 68 58 e8 d5 a4 07 00 44 89 RIP [<ffffffff8118b188>] __blkdev_get+0x28/0x450 RSP <ffff88023e47dbd8> CR2: 00000000000002b4 ---[ end trace bb7f32dbf02398dc ]--- The brd change should be backported to stable kernels starting with 2.6.25. The loop change should be backported to stable kernels starting with 2.6.22. Signed-off-by: Mikulas Patocka <> Acked-by: Tejun Heo <> Cc: # 2.6.22+ Signed-off-by: Jens Axboe <> 2013-05-24drivers/block/brd.c: fix brd_lookup_page() raceBrian Behlendorf1-2/+2 The index on the page must be set before it is inserted in the radix tree. Otherwise there is a small race which can occur during lookup where the page can be found with the incorrect index. This will trigger the BUG_ON() in brd_lookup_page(). Signed-off-by: Brian Behlendorf <> Reported-by: Chris Wedgwood <> Cc: Jens Axboe <> Cc: <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <> 2013-03-23block: Add bio_end_sector()Kent Overstreet1-2/+1 Just a little convenience macro - main reason to add it now is preparing for immutable bio vecs, it'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet <> CC: Jens Axboe <> CC: Lars Ellenberg <> CC: Jiri Kosina <> CC: Alasdair Kergon <> CC: CC: Neil Brown <> CC: Martin Schwidefsky <> CC: Heiko Carstens <> CC: CC: Chris Mason <> CC: Steven Whitehouse <> Acked-by: Steven Whitehouse <> 2012-03-20block: remove the second argument of k[un]map_atomic()Cong Wang1-10/+10 Signed-off-by: Cong Wang <> 2012-01-03fs: move code out of buffer.cAl Viro1-5/+4 Move invalidate_bdev, block_sync_page into fs/block_dev.c. Export kill_bdev as well, so brd doesn't have to open code it. Reduce buffer_head.h requirement accordingly. Removed a rather large comment from invalidate_bdev, as it looked a bit obsolete to bother moving. The small comment replacing it says enough. Signed-off-by: Nick Piggin <> Cc: Al Viro <> Cc: Christoph Hellwig <> Signed-off-by: Andrew Morton <> Signed-off-by: Al Viro <> 2011-09-12block: remove support for bio remapping from ->make_requestChristoph Hellwig1-3/+1 There is very little benefit in allowing to let a ->make_request instance update the bios device and sector and loop around it in __generic_make_request when we can archive the same through calling generic_make_request from the driver and letting the loop in generic_make_request handle it. Note that various drivers got the return value from ->make_request and returned non-zero values for errors. Signed-off-by: Christoph Hellwig <> Acked-by: NeilBrown <> Signed-off-by: Jens Axboe <> 2011-05-26brd: export module parametersNamhyung Kim1-4/+15 Export 'rd_nr', 'rd_size' and 'max_part' parameters to sysfs so user can know that how many devices are allowed, how big each device is and how many partitions are supported. If 'max_part' is 0, it means simply the device doesn't support partitioning. Also note that 'max_part' can be adjusted to power of 2 minus 1 form if needed. User should check this value after the module loading if he/she want to use that number correctly (i.e. fdisk, mknod, etc.). Signed-off-by: Namhyung Kim <> Cc: Laurent Vivier <> Signed-off-by: Jens Axboe <> 2011-05-26brd: fix comment on initial device creationNamhyung Kim1-4/+4 If 'rd_nr' param was not specified, 16 (can be adjusted via CONFIG_BLK_DEV_RAM_COUNT) devices would be created by default but comment said 1. Fix it. Signed-off-by: Namhyung Kim <> Signed-off-by: Jens Axboe <> 2011-05-26brd: handle on-demand devices correctlyNamhyung Kim1-4/+4 When finding or allocating a ram disk device, brd_probe() did not take partition numbers into account so that it can result to a different device. Consider following example (I set CONFIG_BLK_DEV_RAM_COUNT=4 for simplicity) : $ sudo modprobe brd max_part=15 $ ls -l /dev/ram* brw-rw---- 1 root disk 1, 0 2011-05-25 15:41 /dev/ram0 brw-rw---- 1 root disk 1, 16 2011-05-25 15:41 /dev/ram1 brw-rw---- 1 root disk 1, 32 2011-05-25 15:41 /dev/ram2 brw-rw---- 1 root disk 1, 48 2011-05-25 15:41 /dev/ram3 $ sudo mknod /dev/ram4 b 1 64 $ sudo dd if=/dev/zero of=/dev/ram4 bs=4k count=256 256+0 records in 256+0 records out 1048576 bytes (1.0 MB) copied, 0.00215578 s, 486 MB/s namhyung@leonhard:linux$ ls -l /dev/ram* brw-rw---- 1 root disk 1, 0 2011-05-25 15:41 /dev/ram0 brw-rw---- 1 root disk 1, 16 2011-05-25 15:41 /dev/ram1 brw-rw---- 1 root disk 1, 32 2011-05-25 15:41 /dev/ram2 brw-rw---- 1 root disk 1, 48 2011-05-25 15:41 /dev/ram3 brw-r--r-- 1 root root 1, 64 2011-05-25 15:45 /dev/ram4 brw-rw---- 1 root disk 1, 1024 2011-05-25 15:44 /dev/ram64 After this patch, /dev/ram4 - instead of /dev/ram64 - was accessed correctly. In addition, 'range' passed to blk_register_region() should include all range of dev_t that RAMDISK_MAJOR can address. It does not need to be limited by partition numbers unless 'rd_nr' param was specified. Signed-off-by: Namhyung Kim <> Cc: Laurent Vivier <> Cc: Signed-off-by: Jens Axboe <> 2011-05-26brd: limit 'max_part' module param to DISK_MAX_PARTSNamhyung Kim1-0/+3 The 'max_part' parameter controls the number of maximum partition a brd device can have. However if a user specifies very large value it would exceed the limitation of device minor number and can cause a kernel panic (or, at least, produce invalid device nodes in some cases). On my desktop system, following command kills the kernel. On qemu, it triggers similar oops but the kernel was alive: $ sudo modprobe brd max_part=100000 BUG: unable to handle kernel NULL pointer dereference at 0000000000000058 IP: [<ffffffff81110a9a>] sysfs_create_dir+0x2d/0xae PGD 7af1067 PUD 7b19067 PMD 0 Oops: 0000 [#1] SMP last sysfs file: CPU 0 Modules linked in: brd(+) Pid: 44, comm: insmod Tainted: G W 2.6.39-qemu+ #158 Bochs Bochs RIP: 0010:[<ffffffff81110a9a>] [<ffffffff81110a9a>] sysfs_create_dir+0x2d/0xae RSP: 0018:ffff880007b15d78 EFLAGS: 00000286 RAX: ffff880007b05478 RBX: ffff880007a52760 RCX: ffff880007b15dc8 RDX: ffff880007a4f900 RSI: ffff880007b15e48 RDI: ffff880007a52760 RBP: ffff880007b15da8 R08: 0000000000000002 R09: 0000000000000000 R10: ffff880007b15e48 R11: ffff880007b05478 R12: 0000000000000000 R13: ffff880007b05478 R14: 0000000000400920 R15: 0000000000000063 FS: 0000000002160880(0063) GS:ffff880007c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000058 CR3: 0000000007b1c000 CR4: 00000000000006b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 0000000000000000 DR7: 0000000000000000 Process insmod (pid: 44, threadinfo ffff880007b14000, task ffff880007acb980) Stack: ffff880007b15dc8 ffff880007b05478 ffff880007b15da8 00000000fffffffe ffff880007a52760 ffff880007b05478 ffff880007b15de8 ffffffff81143c0a 0000000000400920 ffff880007a52760 ffff880007b05478 0000000000000000 Call Trace: [<ffffffff81143c0a>] kobject_add_internal+0xdf/0x1a0 [<ffffffff81143da1>] kobject_add_varg+0x41/0x50 [<ffffffff81143e6b>] kobject_add+0x64/0x66 [<ffffffff8113bbe7>] blk_register_queue+0x5f/0xb8 [<ffffffff81140f72>] add_disk+0xdf/0x289 [<ffffffffa00040df>] brd_init+0xdf/0x1aa [brd] [<ffffffffa0004000>] ? 0xffffffffa0003fff [<ffffffffa0004000>] ? 0xffffffffa0003fff [<ffffffff8100020a>] do_one_initcall+0x7a/0x12e [<ffffffff8108516c>] sys_init_module+0x9c/0x1dc [<ffffffff812ff4bb>] system_call_fastpath+0x16/0x1b Code: 89 e5 41 55 41 54 53 48 89 fb 48 83 ec 18 48 85 ff 75 04 0f 0b eb fe 48 8b 47 18 49 c7 c4 70 1e 4d 81 48 85 c0 74 04 4c 8b 60 30 8b 44 24 58 45 31 ed 0f b6 c4 85 c0 74 0d 48 8b 43 28 48 89 RIP [<ffffffff81110a9a>] sysfs_create_dir+0x2d/0xae RSP <ffff880007b15d78> CR2: 0000000000000058 ---[ end trace aebb1175ce1f6739 ]--- Signed-off-by: Namhyung Kim <> Cc: Laurent Vivier <> Cc: Signed-off-by: Jens Axboe <> 2011-05-26brd: get rid of unused members from struct brd_deviceNamhyung Kim1-4/+0 brd_refcnt, brd_offset, brd_sizelimit and brd_blocksize in struct brd_device seem to be copied from struct loop_device but they're not used anywhere. Let get rid of them. Signed-off-by: Namhyung Kim <> Signed-off-by: Jens Axboe <> 2010-10-22Merge branch 'for-2.6.37/barrier' of git:// Torvalds1-1/+0 * 'for-2.6.37/barrier' of git:// (46 commits) xen-blkfront: disable barrier/flush write support Added blk-lib.c and blk-barrier.c was renamed to blk-flush.c block: remove BLKDEV_IFL_WAIT aic7xxx_old: removed unused 'req' variable block: remove the BH_Eopnotsupp flag block: remove the BLKDEV_IFL_BARRIER flag block: remove the WRITE_BARRIER flag swap: do not send discards as barriers fat: do not send discards as barriers ext4: do not send discards as barriers jbd2: replace barriers with explicit flush / FUA usage jbd2: Modify ASYNC_COMMIT code to not rely on queue draining on barrier jbd: replace barriers with explicit flush / FUA usage nilfs2: replace barriers with explicit flush / FUA usage reiserfs: replace barriers with explicit flush / FUA usage gfs2: replace barriers with explicit flush / FUA usage btrfs: replace barriers with explicit flush / FUA usage xfs: replace barriers with explicit flush / FUA usage block: pass gfp_mask and flags to sb_issue_discard dm: convey that all flushes are processed as empty ... 2010-10-05block: autoconvert trivial BKL users to private mutexArnd Bergmann1-3/+4 The block device drivers have all gained new lock_kernel calls from a recent pushdown, and some of the drivers were already using the BKL before. This turns the BKL into a set of per-driver mutexes. Still need to check whether this is safe to do. file=$1 name=$2 if grep -q lock_kernel ${file} ; then if grep -q 'include.*linux.mutex.h' ${file} ; then sed -i '/include.*<linux\/smp_lock.h>/d' ${file} else sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file} fi sed -i ${file} \ -e "/^#include.*linux.mutex.h/,$ { 1,/^\(static\|int\|long\)/ { /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex); } }" \ -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \ -e '/[ ]*cycle_kernel_lock();/d' else sed -i -e '/include.*\<smp_lock.h\>/d' ${file} \ -e '/cycle_kernel_lock()/d' fi Signed-off-by: Arnd Bergmann <> 2010-09-10block: deprecate barrier and replace blk_queue_ordered() with blk_queue_flush()Tejun Heo1-1/+0 Barrier is deemed too heavy and will soon be replaced by FLUSH/FUA requests. Deprecate barrier. All REQ_HARDBARRIERs are failed with -EOPNOTSUPP and blk_queue_ordered() is replaced with simpler blk_queue_flush(). blk_queue_flush() takes combinations of REQ_FLUSH and FUA. If a device has write cache and can flush it, it should set REQ_FLUSH. If the device can handle FUA writes, it should also set REQ_FUA. All blk_queue_ordered() users are converted. * ORDERED_DRAIN is mapped to 0 which is the default value. * ORDERED_DRAIN_FLUSH is mapped to REQ_FLUSH. * ORDERED_DRAIN_FLUSH_FUA is mapped to REQ_FLUSH | REQ_FUA. Signed-off-by: Tejun Heo <> Acked-by: Boaz Harrosh <> Cc: Christoph Hellwig <> Cc: Nick Piggin <> Cc: Michael S. Tsirkin <> Cc: Jeremy Fitzhardinge <> Cc: Chris Wright <> Cc: FUJITA Tomonori <> Cc: Geert Uytterhoeven <> Cc: David S. Miller <> Cc: Alasdair G Kergon <> Cc: Pierre Ossman <> Cc: Stefan Weinhuber <> Signed-off-by: Jens Axboe <> 2010-09-10block: kill QUEUE_ORDERED_BY_TAGTejun Heo1-1/+1 Nobody is making meaningful use of ORDERED_BY_TAG now and queue draining for barrier requests will be removed soon which will render the advantage of tag ordering moot. Kill ORDERED_BY_TAG. The following users are affected. * brd: converted to ORDERED_DRAIN. * virtio_blk: ORDERED_TAG path was already marked deprecated. Removed. * xen-blkfront: ORDERED_TAG case dropped. Signed-off-by: Tejun Heo <> Cc: Christoph Hellwig <> Cc: Nick Piggin <> Cc: Michael S. Tsirkin <> Cc: Jeremy Fitzhardinge <> Cc: Chris Wright <> Signed-off-by: Jens Axboe <> 2010-08-07block: push down BKL into .locked_ioctlArnd Bergmann1-1/+4 As a preparation for the removal of the big kernel lock in the block layer, this removes the BKL from the common ioctl handling code, moving it into every single driver still using it. Signed-off-by: Arnd Bergmann <> Acked-by: Christoph Hellwig <> Signed-off-by: Jens Axboe <> 2010-08-07block: remove q->prepare_flush_fn completelyFUJITA Tomonori1-1/+1 This removes q->prepare_flush_fn completely (changes the blk_queue_ordered API). Signed-off-by: FUJITA Tomonori <> Reviewed-by: Christoph Hellwig <> Signed-off-by: Jens Axboe <> 2010-08-07block: unify flags for struct bio and struct requestChristoph Hellwig1-1/+1 Remove the current bio flags and reuse the request flags for the bio, too. This allows to more easily trace the type of I/O from the filesystem down to the block driver. There were two flags in the bio that were missing in the requests: BIO_RW_UNPLUG and BIO_RW_AHEAD. Also I've renamed two request flags that had a superflous RW in them. Note that the flags are in bio.h despite having the REQ_ name - as blkdev.h includes bio.h that is the only way to go for now. Signed-off-by: Christoph Hellwig <> Signed-off-by: Jens Axboe <> 2010-06-01brd: support discardNick Piggin1-1/+52 Support discard requests in brd by zeroing or deleting the underlying backing pages. This is simply to help with testing and documentation nature of brd code. Signed-off-by: Nick Piggin <> Signed-off-by: Jens Axboe <>