Skip to content

Commit 53d8ab2

Browse files
committed
Merge branch 'for-3.14/drivers' of git://git.kernel.dk/linux-block
Pull block IO driver changes from Jens Axboe: - bcache update from Kent Overstreet. - two bcache fixes from Nicholas Swenson. - cciss pci init error fix from Andrew. - underflow fix in the parallel IDE pg_write code from Dan Carpenter. I'm sure the 1 (or 0) users of that are now happy. - two PCI related fixes for sx8 from Jingoo Han. - floppy init fix for first block read from Jiri Kosina. - pktcdvd error return miss fix from Julia Lawall. - removal of IRQF_SHARED from the SEGA Dreamcast CD-ROM code from Michael Opdenacker. - comment typo fix for the loop driver from Olaf Hering. - potential oops fix for null_blk from Raghavendra K T. - two fixes from Sam Bradshaw (Micron) for the mtip32xx driver, fixing an OOM problem and a problem with handling security locked conditions * 'for-3.14/drivers' of git://git.kernel.dk/linux-block: (47 commits) mg_disk: Spelling s/finised/finished/ null_blk: Null pointer deference problem in alloc_page_buffers mtip32xx: Correctly handle security locked condition mtip32xx: Make SGL container per-command to eliminate high order dma allocation drivers/block/loop.c: fix comment typo in loop_config_discard drivers/block/cciss.c:cciss_init_one(): use proper errnos drivers/block/paride/pg.c: underflow bug in pg_write() drivers/block/sx8.c: remove unnecessary pci_set_drvdata() drivers/block/sx8.c: use module_pci_driver() floppy: bail out in open() if drive is not responding to block0 read bcache: Fix auxiliary search trees for key size > cacheline size bcache: Don't return -EINTR when insert finished bcache: Improve bucket_prio() calculation bcache: Add bch_bkey_equal_header() bcache: update bch_bkey_try_merge bcache: Move insert_fixup() to btree_keys_ops bcache: Convert sorting to btree_keys bcache: Convert debug code to btree_keys bcache: Convert btree_iter to struct btree_keys bcache: Refactor bset_tree sysfs stats ...
2 parents f568849 + 14424be commit 53d8ab2

39 files changed

+2435
-1895
lines changed

block/blk-settings.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,10 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
592592
ret = -1;
593593
}
594594

595+
t->raid_partial_stripes_expensive =
596+
max(t->raid_partial_stripes_expensive,
597+
b->raid_partial_stripes_expensive);
598+
595599
/* Find lowest common alignment_offset */
596600
t->alignment_offset = lcm(t->alignment_offset, alignment)
597601
& (max(t->physical_block_size, t->io_min) - 1);

drivers/block/cciss.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5004,7 +5004,7 @@ static int cciss_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
50045004

50055005
i = alloc_cciss_hba(pdev);
50065006
if (i < 0)
5007-
return -1;
5007+
return -ENOMEM;
50085008

50095009
h = hba[i];
50105010
h->pdev = pdev;
@@ -5205,7 +5205,7 @@ static int cciss_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
52055205
*/
52065206
pci_set_drvdata(pdev, NULL);
52075207
free_hba(h);
5208-
return -1;
5208+
return -ENODEV;
52095209
}
52105210

52115211
static void cciss_shutdown(struct pci_dev *pdev)

drivers/block/floppy.c

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3691,9 +3691,12 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
36913691
if (!(mode & FMODE_NDELAY)) {
36923692
if (mode & (FMODE_READ|FMODE_WRITE)) {
36933693
UDRS->last_checked = 0;
3694+
clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
36943695
check_disk_change(bdev);
36953696
if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags))
36963697
goto out;
3698+
if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
3699+
goto out;
36973700
}
36983701
res = -EROFS;
36993702
if ((mode & FMODE_WRITE) &&
@@ -3746,17 +3749,29 @@ static unsigned int floppy_check_events(struct gendisk *disk,
37463749
* a disk in the drive, and whether that disk is writable.
37473750
*/
37483751

3749-
static void floppy_rb0_complete(struct bio *bio, int err)
3752+
struct rb0_cbdata {
3753+
int drive;
3754+
struct completion complete;
3755+
};
3756+
3757+
static void floppy_rb0_cb(struct bio *bio, int err)
37503758
{
3751-
complete((struct completion *)bio->bi_private);
3759+
struct rb0_cbdata *cbdata = (struct rb0_cbdata *)bio->bi_private;
3760+
int drive = cbdata->drive;
3761+
3762+
if (err) {
3763+
pr_info("floppy: error %d while reading block 0", err);
3764+
set_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
3765+
}
3766+
complete(&cbdata->complete);
37523767
}
37533768

3754-
static int __floppy_read_block_0(struct block_device *bdev)
3769+
static int __floppy_read_block_0(struct block_device *bdev, int drive)
37553770
{
37563771
struct bio bio;
37573772
struct bio_vec bio_vec;
3758-
struct completion complete;
37593773
struct page *page;
3774+
struct rb0_cbdata cbdata;
37603775
size_t size;
37613776

37623777
page = alloc_page(GFP_NOIO);
@@ -3769,6 +3784,8 @@ static int __floppy_read_block_0(struct block_device *bdev)
37693784
if (!size)
37703785
size = 1024;
37713786

3787+
cbdata.drive = drive;
3788+
37723789
bio_init(&bio);
37733790
bio.bi_io_vec = &bio_vec;
37743791
bio_vec.bv_page = page;
@@ -3779,13 +3796,14 @@ static int __floppy_read_block_0(struct block_device *bdev)
37793796
bio.bi_bdev = bdev;
37803797
bio.bi_iter.bi_sector = 0;
37813798
bio.bi_flags = (1 << BIO_QUIET);
3782-
init_completion(&complete);
3783-
bio.bi_private = &complete;
3784-
bio.bi_end_io = floppy_rb0_complete;
3799+
bio.bi_private = &cbdata;
3800+
bio.bi_end_io = floppy_rb0_cb;
37853801

37863802
submit_bio(READ, &bio);
37873803
process_fd_request();
3788-
wait_for_completion(&complete);
3804+
3805+
init_completion(&cbdata.complete);
3806+
wait_for_completion(&cbdata.complete);
37893807

37903808
__free_page(page);
37913809

@@ -3827,7 +3845,7 @@ static int floppy_revalidate(struct gendisk *disk)
38273845
UDRS->generation++;
38283846
if (drive_no_geom(drive)) {
38293847
/* auto-sensing */
3830-
res = __floppy_read_block_0(opened_bdev[drive]);
3848+
res = __floppy_read_block_0(opened_bdev[drive], drive);
38313849
} else {
38323850
if (cf)
38333851
poll_drive(false, FD_RAW_NEED_DISK);

drivers/block/loop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ static void loop_config_discard(struct loop_device *lo)
799799

800800
/*
801801
* We use punch hole to reclaim the free space used by the
802-
* image a.k.a. discard. However we do support discard if
802+
* image a.k.a. discard. However we do not support discard if
803803
* encryption is enabled, because it may give an attacker
804804
* useful information.
805805
*/

drivers/block/mg_disk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ static int mg_probe(struct platform_device *plat_dev)
915915

916916
/* disk reset */
917917
if (prv_data->dev_attr == MG_STORAGE_DEV) {
918-
/* If POR seq. not yet finised, wait */
918+
/* If POR seq. not yet finished, wait */
919919
err = mg_wait_rstout(host->rstout, MG_TMAX_RSTOUT);
920920
if (err)
921921
goto probe_err_3b;

0 commit comments

Comments
 (0)