aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-03-12drivers/block/floppy.c: convert some #include <asm/ to #include <linux/Joe Perches1-2/+2
Signed-off-by: Joe Perches <joe@perches.com> Cc: Stephen Hemminger <shemminger@vyatta.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-03-12paride: fix off-by-one testRoel Kluin3-6/+6
With `while (j++ < PX_SPIN)' j reaches PX_SPIN + 1 after the loop. This is probably unlikely to produce a problem. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-03-11drbd: fix al-to-on-disk-bitmap for 4k logical_block_sizeLars Ellenberg1-4/+13
Up to now, applying the in-core activity-log to the on-disk bitmap did not care for logical_block_size. On logical_block_size != 512 byte, this very likely results in misalligned block access and spurious "io errors". We now simply always submit aligned whole 4k blocks, fixing this for logical block sizes of 512, 1024, 2048 and 4096. For even larger logical block sizes, this won't work. But I'm not aware of devices with such properties being available. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11drbd: Renamed overwrite_peer to primary_forcePhilipp Reisner1-1/+1
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11drbd: Forcing primary should also work for Consistent disks [Bugz 266]Philipp Reisner1-2/+2
Up to now this only worked for Outdated and Inconsistent disks, that it did not worked for Consistent disks was an inconsistent omission. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11drbd: Make sure we do not send state updates during an empty resync [Bugz 271]Philipp Reisner1-2/+1
This is a race condition that existed for ages. The previous commit reduces the window, this one closes it. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11drbd: Reduce the time an empty resync takes usuallyPhilipp Reisner3-3/+12
This mitigates changes introduced with commit: http://git.drbd.org/?p=drbd-8.3.git;a=commit;h=4b6803a3276652da3737 Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11drbd: add missing drbd command names to avoid <NULL> in error messagesLars Ellenberg1-0/+3
cmdname() should map command number to its human readable representation. The string table was incomplete, though. Maybe rather do a switch() block, and let the compiler help us to keep it complete? Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11drbd_disconnect: grab meta.socket mutex as wellLars Ellenberg2-3/+4
Fixes a race and potential kernel panic if e.g. the worker was just about to send a few P_RS_IS_IN_SYNC via the meta socket for checksum based resync, while the receiver destroys the sockets in drbd_disconnect. To make sure no-one is using the meta socket, it is not enough to stop the asender... Grab the meta socket mutex before destroying it. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11fix unit of rs_same_csums accountingLars Ellenberg1-1/+2
Depending on resync request size, we need to account for more than one bit. Impact: cosmetic If SyncTarget reported correctly 100% equal checksums, the SyncSource usually reported 12% equal checksums instead, because it only counted requests, we typically do 32k resync requests, and the bitmap granularity is still 4k. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11drbd: fix broken state change after split-brain attach while connectedLars Ellenberg1-1/+6
Situation: we have diverging data sets, i.e. we had a split brain somewhen, but currently are connected, one node diskless. Then we try to attach that disk, figure it is consistent, but has a diverging data set, we refuse to attach. This led to strange state changes: 22:18:35 bb drbd1: peer( Unknown -> Primary ) conn( WFReportParams -> Connected) pdsk( DUnknown -> UpToDate ) 22:19:30 bb drbd1: disk( Diskless -> Attaching ) 22:19:30 bb drbd1: disk( Attaching -> Negotiating ) 22:19:30 bb drbd1: drbd_sync_handshake: 22:19:30 bb drbd1: self 97BF25798B9D5222:F33D1F62ADE698DD:4269796F9D027C83:AC45D8B5C3C1BF93 bits:19449 flags:0 22:19:30 bb drbd1: peer 280DFB6E125465D3:F33D1F62ADE698DC:4269796F9D027C82:AC45D8B5C3C1BF93 bits:2575806 flags:0 22:19:30 bb drbd1: uuid_compare()=100 by rule 90 22:19:30 bb drbd1: Split-Brain detected, dropping connection! 22:19:30 bb drbd1: disk( Negotiating -> Diskless ) while the other side says: 22:19:30 aa drbd1: Split-Brain detected, dropping connection! 22:19:30 aa drbd1: Disk attach process on the peer node was aborted. 22:19:30 aa drbd1: conn( Connected -> TOO_LARGE ) pdsk( Diskless -> Consistent ) This should be fixed now. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11drbd: fix NULL pointer dereference on 4k hard sect sizeLars Ellenberg1-19/+19
we still don't support 4k 'physical' sectors 'natively', but use a read-modify-write workaround. And we even tried to use the extra page before we allocated it :( Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11drbd: --dry-run option for drbdsetup net ( drbdadm -- --dry-run connect <res> )Philipp Reisner3-5/+41
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-03-11block: drbd: Convert semaphore to mutexThomas Gleixner1-5/+5
The bm_change semaphore is semantically a mutex. Convert it to a real mutex. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
2010-03-08Merge branch 'for-next' into for-linusJiri Kosina2-3/+3
Conflicts: Documentation/filesystems/proc.txt arch/arm/mach-u300/include/mach/debug-macro.S drivers/net/qlge/qlge_ethtool.c drivers/net/qlge/qlge_main.c drivers/net/typhoon.c
2010-03-07Driver core: Constify struct sysfs_ops in struct kobj_typeEmese Revfy1-1/+1
Constify struct sysfs_ops. This is part of the ops structure constification effort started by Arjan van de Ven et al. Benefits of this constification: * prevents modification of data that is shared (referenced) by many other structure instances at runtime * detects/prevents accidental (but not intentional) modification attempts on archs that enforce read-only kernel data at runtime * potentially better optimized code as the compiler can assume that the const data cannot be changed * the compiler/linker move const data into .rodata and therefore exclude them from false sharing Signed-off-by: Emese Revfy <re.emese@gmail.com> Acked-by: David Teigland <teigland@redhat.com> Acked-by: Matt Domsch <Matt_Domsch@dell.com> Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com> Acked-by: Hans J. Koch <hjk@linutronix.de> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Acked-by: Jens Axboe <jens.axboe@oracle.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-07driver-core: Add attribute argument to class_attribute show/storeAndi Kleen2-6/+18
Passing the attribute to the low level IO functions allows all kinds of cleanups, by sharing low level IO code without requiring an own function for every piece of data. Also drivers can extend the attributes with own data fields and use that in the low level function. This makes the class attributes the same as sysdev_class attributes and plain attributes. This will allow further cleanups in drivers. Full tree sweep converting all users. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-01Merge branch 'for-2.6.34' of git://git.kernel.dk/linux-2.6-blockLinus Torvalds25-440/+299
* 'for-2.6.34' of git://git.kernel.dk/linux-2.6-block: (38 commits) block: don't access jiffies when initialising io_context cfq: remove 8 bytes of padding from cfq_rb_root on 64 bit builds block: fix for "Consolidate phys_segment and hw_segment limits" cfq-iosched: quantum check tweak blktrace: perform cleanup after setup error blkdev: fix merge_bvec_fn return value checks cfq-iosched: requests "in flight" vs "in driver" clarification cciss: Fix problem with scatter gather elements in the scsi half of the driver cciss: eliminate unnecessary pointer use in cciss scsi code cciss: do not use void pointer for scsi hba data cciss: factor out scatter gather chain block mapping code cciss: fix scatter gather chain block dma direction kludge cciss: simplify scatter gather code cciss: factor out scatter gather chain block allocation and freeing cciss: detect bad alignment of scsi commands at build time cciss: clarify command list padding calculation cfq-iosched: rethink seeky detection for SSDs cfq-iosched: rework seeky detection block: remove padding from io_context on 64bit builds block: Consolidate phys_segment and hw_segment limits ...
2010-03-01block: fix for "Consolidate phys_segment and hw_segment limits"Stephen Rothwell1-1/+1
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-28cciss: Fix problem with scatter gather elements in the scsi half of the driverStephen M. Cameron1-26/+59
cciss: Fix problem with scatter gather elements in the scsi half of the driver When support for more than 31 scatter gather elements was added to the block half of the driver, the SCSI half of the driver was not addressed, and the bump from 31 to 32 scatter gather elements in the command block itself (not chained) actually broke the SCSI half of the driver, so that any transfer requiring 32 scatter gather elements wouldn't work. This fix also increases the max transfer size and size of the scatter gather table to the limit supported by the controller Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-28cciss: eliminate unnecessary pointer use in cciss scsi codeStephen M. Cameron1-16/+15
cciss: eliminate unnecessary pointer use in cciss scsi code An extra level of indirection was being used in some places for no real reason. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-28cciss: do not use void pointer for scsi hba dataStephen M. Cameron2-16/+11
cciss: do not use void pointer for scsi hba data and get rid of related unnecessary type casting and delete some superfluous and misleading comments nearby. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-28cciss: factor out scatter gather chain block mapping codeStephen M. Cameron1-29/+34
cciss: factor out scatter gather chain block mapping code Rationale is I want to use this code from the scsi half of the driver. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-28cciss: fix scatter gather chain block dma direction kludgeStephen M. Cameron1-5/+3
cciss: fix scatter gather chain block dma direction kludge The data direction for the chained block of scatter gather elements should always be PCI_DMA_TODEVICE, but was mistakenly set to the direction of the data transfer, then a kludge to fix it was added, in which pci_dma_sync_single_for_device or pci_dma_sync_single_for_cpu was called. If the correct direction is used in the first place, the kludge isn't needed. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-28cciss: simplify scatter gather codeStephen M. Cameron2-35/+16
cciss: simplify scatter gather code. Instead of allocating an array of pointers to a structure containing an SGDescriptor structure, and two other elements that aren't really used, just allocate SGDescriptor structs. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-28cciss: factor out scatter gather chain block allocation and freeingStephen M. Cameron1-50/+58
cciss: factor out scatter gather chain block allocation and freeing Rationale is that I want to use this code from the scsi half of the driver. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-28cciss: detect bad alignment of scsi commands at build timeStephen M. Cameron3-8/+15
cciss: detect bad alignment of scsi commands at build time Incidentally fix some nearby c++ style comments. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-28cciss: clarify command list padding calculationStephen M. Cameron1-2/+7
cciss: clarify command list padding calculation Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-27Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68kLinus Torvalds2-4/+2
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: (24 commits) m68k: Define sigcontext ABI of ColdFire m68knommu: NPTL support for uClinux m68k: Add NPTL support m68k: Eliminate unused variable in page_to_phys() m68k: Switch to generic siginfo layout macfb: fix 24-bit visual and stuff macfb: cleanup fbdev: add some missing mac modes mac68k: start CUDA early valkyriefb: various fixes fbdev: mac_var_to_mode() fix mac68k: move macsonic and macmace platform devices mac68k: move mac_esp platform device mac68k: replace mac68k SCC code with platform device pmac-zilog: add platform driver pmac-zilog: cleanup mac68k: rework SWIM platform device mac68k: cleanup ataflop: Killl warning about unused variable flags m68k: Use DIV_ROUND_CLOSEST ...
2010-02-27mac68k: rework SWIM platform deviceFinn Thain1-2/+2
Adjust the platform device code to conform with the code style used in the rest of this patch series. No need to name resources nor to register devices which are not applicable. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2010-02-27ataflop: Killl warning about unused variable flagsGeert Uytterhoeven1-2/+0
After commit e0c0978699a83f26f2341f7eedc1463b79e31aff ("ataflop: remove buggy/commented-out IRQ disable from do_fd_request()") the `flags' variable became unused: drivers/block/ataflop.c:1473: warning: unused variable 'flags' Hence remove it. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2010-02-26block: Consolidate phys_segment and hw_segment limitsMartin K. Petersen13-29/+14
Except for SCSI no device drivers distinguish between physical and hardware segment limits. Consolidate the two into a single segment limit. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-26block: Rename blk_queue_max_sectors to blk_queue_max_hw_sectorsMartin K. Petersen16-17/+17
The block layer calling convention is blk_queue_<limit name>. blk_queue_max_sectors predates this practice, leading to some confusion. Rename the function to appropriately reflect that its intended use is to set max_hw_sectors. Also introduce a temporary wrapper for backwards compability. This can be removed after the merge window is closed. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-26block: Add BLK_ prefix to definitionsMartin K. Petersen1-2/+2
Add a BLK_ prefix to block layer constants. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-26Merge commit 'origin/master' into nextBenjamin Herrenschmidt1-15/+46
Manual merge of: drivers/char/hvc_console.c drivers/char/hvc_console.h
2010-02-24pktcdvd: use BIO list management functionsAkinobu Mita1-68/+21
Now that the bio list management stuff is generic, convert pktcdvd to use bio lists instead of its own private bio list implementation. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Peter Osterlund <petero2@telia.com> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-24virtio_blk: add block topology supportChristoph Hellwig1-15/+46
Allow reading various alignment values from the config page. This allows the guest to much better align I/O requests depending on the storage topology. Note that the formats for the config values appear a bit messed up, but we follow the formats used by ATA and SCSI so they are expected in the storage world. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-22Merge branch 'master' into for-2.6.34Jens Axboe6-25/+45
2010-02-22cciss: Consolidate duplicate bits in cciss_cmd.h & cciss_ioctl.hdann frazier1-110/+3
There are several duplicate definitions in cciss_cmd.h and cciss_ioctl.h. Consolidate these into the new cciss_defs.h file. This patch doesn't change the definitions exposed under include/linux, so userspace apps shouldn't be affected. Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: dann frazier <dannf@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-22cciss: remove C99-style commentsdann frazier4-64/+61
Some cleanup before the header file split-out so we don't propagate this style into new files. Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: dann frazier <dannf@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-17Merge commit 'origin/master' into nextBenjamin Herrenschmidt2-1/+4
2010-02-09tree-wide: Assorted spelling fixesDaniel Mack2-3/+3
In particular, several occurances of funny versions of 'success', 'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address', 'beginning', 'desirable', 'separate' and 'necessary' are fixed. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Joe Perches <joe@perches.com> Cc: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-05cciss: Make cciss_seq_show handle holes in the h->drv[] arrayStephen M. Cameron1-0/+3
It is possible (and expected) for there to be holes in the h->drv[] array, that is, some elements may be NULL pointers. cciss_seq_show needs to be made aware of this possibility to avoid an Oops. To reproduce the Oops which this fixes: 1) Create two "arrays" in the Array Configuratino Utility and several logical drives on each array. 2) cat /proc/driver/cciss/cciss* in an infinite loop 3) delete some of the logical drives in the first "array." Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Cc: stable@kernel.org Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-04ataflop: Killl warning about unused variable flagsGeert Uytterhoeven1-2/+0
After commit e0c0978699a83f26f2341f7eedc1463b79e31aff ("ataflop: remove buggy/commented-out IRQ disable from do_fd_request()") the `flags' variable became unused: drivers/block/ataflop.c:1473: warning: unused variable 'flags' Hence remove it. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-03powerpc/viodasd: Remove VIOD_KERN_<level> macros for printksJoe Perches1-50/+36
Use #define pr_fmt(fmt) "viod: " fmt Remove #define VIOD_KERN_WARNING and VIOD_KERN_INFO Convert printk(VIOD_KERN_<level> to pr_<level> Coalesce long format strings Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au> drivers/block/viodasd.c | 86 +++++++++++++++++++--------------------------- 1 files changed, 36 insertions(+), 50 deletions(-) Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-02-02pktcdvd: removing device does not remove its sysfs dirThadeu Lima de Souza Cascardo1-1/+1
This is the counterpart to cba767175becadc5c4016cceb7bfdd2c7fe722f4 ("pktcdvd: remove broken dev_t export of class devices"). Device is not registered using dev_t, so it should not be destroyed using device_destroy which looks up the device by dev_t. This will fail and adding the device again will fail with the "duplicate name" error. This is fixed using device_unregister instead of device_destroy. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Peter Osterlund <petero2@telia.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-01-25drbd: null dereference bugDan Carpenter1-1/+1
epoch is always NULL here. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
2010-01-22drbd: fix max_segment_size initializationLars Ellenberg1-1/+1
blk_queue_make_request() internally calls blk_set_default_limits(), so calling blk_queue_max_segment_size() before is useless. Ergo: move the call to blk_queue_max_segment_size() down a few lines. Impact: If, after a fresh modprobe, you first connect a Diskless drbd, then attach, this could result in a DRBD Protocol Error at first. The next connection attempt would then succeeded. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-01-12drbd: Allow online resizing of DRBD devices while peer not reachable (needs to be explicitly forced)Philipp Reisner3-11/+15
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-01-12drbd: Don't go into StandAlone mode when authentification failes because of network errorJohannes Thoma1-9/+22
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>