Skip to content

Commit f042fea

Browse files
committed
Merge branch 'for-3.9/drivers' of git://git.kernel.dk/linux-block
Pull block driver bits from Jens Axboe: "After the block IO core bits are in, please grab the driver updates from below as well. It contains: - Fix ancient regression in dac960. Nobody must be using that anymore... - Some good fixes from Guo Ghao for loop, fixing both potential oopses and deadlocks. - Improve mtip32xx for NUMA systems, by being a bit more clever in distributing work. - Add IBM RamSan 70/80 driver. A second round of fixes for that is pending, that will come in through for-linus during the 3.9 cycle as per usual. - A few xen-blk{back,front} fixes from Konrad and Roger. - Other minor fixes and improvements." * 'for-3.9/drivers' of git://git.kernel.dk/linux-block: loopdev: ignore negative offset when calculate loop device size loopdev: remove an user triggerable oops loopdev: move common code into loop_figure_size() loopdev: update block device size in loop_set_status() loopdev: fix a deadlock xen-blkback: use balloon pages for persistent grants xen-blkfront: drop the use of llist_for_each_entry_safe xen/blkback: Don't trust the handle from the frontend. xen-blkback: do not leak mode property block: IBM RamSan 70/80 driver fixes rsxx: add slab.h include to dma.c drivers/block/mtip32xx: add missing GENERIC_HARDIRQS dependency block: remove new __devinit/exit annotations on ramsam driver block: IBM RamSan 70/80 device driver drivers/block/mtip32xx/mtip32xx.c:1726:5: sparse: symbol 'mtip_send_trim' was not declared. Should it be static? drivers/block/mtip32xx/mtip32xx.c:4029:1: sparse: symbol 'mtip_workq_sdbf0' was not declared. Should it be static? dac960: return success instead of -ENOTTY mtip32xx: add trim support mtip32xx: Add workqueue and NUMA support block: delete super ancient PC-XT driver for 1980's hardware
2 parents ee89f81 + b7a1da6 commit f042fea

23 files changed

Lines changed: 3986 additions & 1443 deletions

File tree

‎MAINTAINERS‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6515,6 +6515,12 @@ S: Maintained
65156515
F: Documentation/blockdev/ramdisk.txt
65166516
F: drivers/block/brd.c
65176517

6518+
RAMSAM DRIVER (IBM RamSan 70/80 PCI SSD Flash Card)
6519+
M: Joshua Morris <josh.h.morris@us.ibm.com>
6520+
M: Philip Kelleher <pjk1939@linux.vnet.ibm.com>
6521+
S: Maintained
6522+
F: drivers/block/rsxx/
6523+
65186524
RANDOM NUMBER DRIVER
65196525
M: Theodore Ts'o" <tytso@mit.edu>
65206526
S: Maintained

‎drivers/block/DAC960.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7054,6 +7054,7 @@ static long DAC960_gam_ioctl(struct file *file, unsigned int Request,
70547054
else
70557055
ErrorCode = 0;
70567056
}
7057+
break;
70577058
default:
70587059
ErrorCode = -ENOTTY;
70597060
}

‎drivers/block/Kconfig‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,6 @@ config AMIGA_Z2RAM
6363
To compile this driver as a module, choose M here: the
6464
module will be called z2ram.
6565

66-
config BLK_DEV_XD
67-
tristate "XT hard disk support"
68-
depends on ISA && ISA_DMA_API
69-
select CHECK_SIGNATURE
70-
help
71-
Very old 8 bit hard disk controllers used in the IBM XT computer
72-
will be supported if you say Y here.
73-
74-
To compile this driver as a module, choose M here: the
75-
module will be called xd.
76-
77-
It's pretty unlikely that you have one of these: say N.
78-
7966
config GDROM
8067
tristate "SEGA Dreamcast GD-ROM drive"
8168
depends on SH_DREAMCAST
@@ -544,4 +531,14 @@ config BLK_DEV_RBD
544531

545532
If unsure, say N.
546533

534+
config BLK_DEV_RSXX
535+
tristate "RamSam PCIe Flash SSD Device Driver"
536+
depends on PCI
537+
help
538+
Device driver for IBM's high speed PCIe SSD
539+
storage devices: RamSan-70 and RamSan-80.
540+
541+
To compile this driver as a module, choose M here: the
542+
module will be called rsxx.
543+
547544
endif # BLK_DEV

‎drivers/block/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ obj-$(CONFIG_ATARI_FLOPPY) += ataflop.o
1515
obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o
1616
obj-$(CONFIG_BLK_DEV_RAM) += brd.o
1717
obj-$(CONFIG_BLK_DEV_LOOP) += loop.o
18-
obj-$(CONFIG_BLK_DEV_XD) += xd.o
1918
obj-$(CONFIG_BLK_CPQ_DA) += cpqarray.o
2019
obj-$(CONFIG_BLK_CPQ_CISS_DA) += cciss.o
2120
obj-$(CONFIG_BLK_DEV_DAC960) += DAC960.o
@@ -41,4 +40,6 @@ obj-$(CONFIG_BLK_DEV_DRBD) += drbd/
4140
obj-$(CONFIG_BLK_DEV_RBD) += rbd.o
4241
obj-$(CONFIG_BLK_DEV_PCIESSD_MTIP32XX) += mtip32xx/
4342

43+
obj-$(CONFIG_BLK_DEV_RSXX) += rsxx/
44+
4445
swim_mod-y := swim.o swim_asm.o

‎drivers/block/loop.c‎

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,13 @@ static struct loop_func_table *xfer_funcs[MAX_LO_CRYPT] = {
162162

163163
static loff_t get_size(loff_t offset, loff_t sizelimit, struct file *file)
164164
{
165-
loff_t size, loopsize;
165+
loff_t loopsize;
166166

167167
/* Compute loopsize in bytes */
168-
size = i_size_read(file->f_mapping->host);
169-
loopsize = size - offset;
170-
/* offset is beyond i_size, wierd but possible */
168+
loopsize = i_size_read(file->f_mapping->host);
169+
if (offset > 0)
170+
loopsize -= offset;
171+
/* offset is beyond i_size, weird but possible */
171172
if (loopsize < 0)
172173
return 0;
173174

@@ -190,6 +191,7 @@ figure_loop_size(struct loop_device *lo, loff_t offset, loff_t sizelimit)
190191
{
191192
loff_t size = get_size(offset, sizelimit, lo->lo_backing_file);
192193
sector_t x = (sector_t)size;
194+
struct block_device *bdev = lo->lo_device;
193195

194196
if (unlikely((loff_t)x != size))
195197
return -EFBIG;
@@ -198,6 +200,9 @@ figure_loop_size(struct loop_device *lo, loff_t offset, loff_t sizelimit)
198200
if (lo->lo_sizelimit != sizelimit)
199201
lo->lo_sizelimit = sizelimit;
200202
set_capacity(lo->lo_disk, x);
203+
bd_set_size(bdev, (loff_t)get_capacity(bdev->bd_disk) << 9);
204+
/* let user-space know about the new size */
205+
kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE);
201206
return 0;
202207
}
203208

@@ -1091,10 +1096,10 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
10911096
return err;
10921097

10931098
if (lo->lo_offset != info->lo_offset ||
1094-
lo->lo_sizelimit != info->lo_sizelimit) {
1099+
lo->lo_sizelimit != info->lo_sizelimit)
10951100
if (figure_loop_size(lo, info->lo_offset, info->lo_sizelimit))
10961101
return -EFBIG;
1097-
}
1102+
10981103
loop_config_discard(lo);
10991104

11001105
memcpy(lo->lo_file_name, info->lo_file_name, LO_NAME_SIZE);
@@ -1271,28 +1276,10 @@ loop_get_status64(struct loop_device *lo, struct loop_info64 __user *arg) {
12711276

12721277
static int loop_set_capacity(struct loop_device *lo, struct block_device *bdev)
12731278
{
1274-
int err;
1275-
sector_t sec;
1276-
loff_t sz;
1277-
1278-
err = -ENXIO;
12791279
if (unlikely(lo->lo_state != Lo_bound))
1280-
goto out;
1281-
err = figure_loop_size(lo, lo->lo_offset, lo->lo_sizelimit);
1282-
if (unlikely(err))
1283-
goto out;
1284-
sec = get_capacity(lo->lo_disk);
1285-
/* the width of sector_t may be narrow for bit-shift */
1286-
sz = sec;
1287-
sz <<= 9;
1288-
mutex_lock(&bdev->bd_mutex);
1289-
bd_set_size(bdev, sz);
1290-
/* let user-space know about the new size */
1291-
kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE);
1292-
mutex_unlock(&bdev->bd_mutex);
1280+
return -ENXIO;
12931281

1294-
out:
1295-
return err;
1282+
return figure_loop_size(lo, lo->lo_offset, lo->lo_sizelimit);
12961283
}
12971284

12981285
static int lo_ioctl(struct block_device *bdev, fmode_t mode,
@@ -1845,11 +1832,15 @@ static int __init loop_init(void)
18451832
max_part = (1UL << part_shift) - 1;
18461833
}
18471834

1848-
if ((1UL << part_shift) > DISK_MAX_PARTS)
1849-
return -EINVAL;
1835+
if ((1UL << part_shift) > DISK_MAX_PARTS) {
1836+
err = -EINVAL;
1837+
goto misc_out;
1838+
}
18501839

1851-
if (max_loop > 1UL << (MINORBITS - part_shift))
1852-
return -EINVAL;
1840+
if (max_loop > 1UL << (MINORBITS - part_shift)) {
1841+
err = -EINVAL;
1842+
goto misc_out;
1843+
}
18531844

18541845
/*
18551846
* If max_loop is specified, create that many devices upfront.
@@ -1867,8 +1858,10 @@ static int __init loop_init(void)
18671858
range = 1UL << MINORBITS;
18681859
}
18691860

1870-
if (register_blkdev(LOOP_MAJOR, "loop"))
1871-
return -EIO;
1861+
if (register_blkdev(LOOP_MAJOR, "loop")) {
1862+
err = -EIO;
1863+
goto misc_out;
1864+
}
18721865

18731866
blk_register_region(MKDEV(LOOP_MAJOR, 0), range,
18741867
THIS_MODULE, loop_probe, NULL, NULL);
@@ -1881,6 +1874,10 @@ static int __init loop_init(void)
18811874

18821875
printk(KERN_INFO "loop: module loaded\n");
18831876
return 0;
1877+
1878+
misc_out:
1879+
misc_deregister(&loop_misc);
1880+
return err;
18841881
}
18851882

18861883
static int loop_exit_cb(int id, void *ptr, void *data)

‎drivers/block/mtip32xx/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
config BLK_DEV_PCIESSD_MTIP32XX
66
tristate "Block Device Driver for Micron PCIe SSDs"
7-
depends on PCI
7+
depends on PCI && GENERIC_HARDIRQS
88
help
99
This enables the block driver for Micron PCIe SSDs.

0 commit comments

Comments
 (0)