Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block driver update from Jens Axboe:
"Distilled down variant, the rest will pass over to 3.8. I pulled it
into the for-linus branch I had waiting for a pull request as well, in
case you are wondering why there are new entries in here too. This
also got rid of two reverts and the ones of the mtip32xx patches that
went in later in the 3.6 cycle, so the series looks a bit cleaner."

* 'for-linus' of git://git.kernel.dk/linux-block:
loop: Make explicit loop device destruction lazy
mtip32xx:Added appropriate timeout value for secure erase
xen/blkback: Change xen_vbd's flush_support and discard_secure to have type unsigned int, rather than bool
cciss: select CONFIG_CHECK_SIGNATURE
cciss: remove unneeded memset()
xen/blkback: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
pktcdvd: update MAINTAINERS
floppy: remove dr, reuse drive on do_floppy_init
floppy: use common function to check if floppies can be registered
floppy: properly handle failure on add_disk loop
floppy: do put_disk on current dr if blk_init_queue fails
floppy: don't call alloc_ordered_workqueue inside the alloc_disk loop
xen/blkback: Fix compile warning
block: Add blk_rq_pos(rq) to sort rq when plushing
drivers/block: remove CONFIG_EXPERIMENTAL
block: remove CONFIG_EXPERIMENTAL
vfs: fix: don't increase bio_slab_max if krealloc() fails
blkcg: stop iteration early if root_rl is the only request list
blkcg: Fix use-after-free of q->root_blkg and q->root_rl.blkg

+113 -68
+1 -1
MAINTAINERS
··· 5647 5647 F: drivers/pinctrl/spear/ 5648 5648 5649 5649 PKTCDVD DRIVER 5650 - M: Peter Osterlund <petero2@telia.com> 5650 + M: Jiri Kosina <jkosina@suse.cz> 5651 5651 S: Maintained 5652 5652 F: drivers/block/pktcdvd.c 5653 5653 F: include/linux/pktcdvd.h
+1 -1
block/Kconfig
··· 89 89 90 90 config BLK_DEV_THROTTLING 91 91 bool "Block layer bio throttling support" 92 - depends on BLK_CGROUP=y && EXPERIMENTAL 92 + depends on BLK_CGROUP=y 93 93 default n 94 94 ---help--- 95 95 Block layer bio throttling support. It can be used to limit
+10
block/blk-cgroup.c
··· 285 285 blkg_destroy(blkg); 286 286 spin_unlock(&blkcg->lock); 287 287 } 288 + 289 + /* 290 + * root blkg is destroyed. Just clear the pointer since 291 + * root_rl does not take reference on root blkg. 292 + */ 293 + q->root_blkg = NULL; 294 + q->root_rl.blkg = NULL; 288 295 } 289 296 290 297 static void blkg_rcu_free(struct rcu_head *rcu_head) ··· 333 326 */ 334 327 if (rl == &q->root_rl) { 335 328 ent = &q->blkg_list; 329 + /* There are no more block groups, hence no request lists */ 330 + if (list_empty(ent)) 331 + return NULL; 336 332 } else { 337 333 blkg = container_of(rl, struct blkcg_gq, rl); 338 334 ent = &blkg->q_node;
+2 -1
block/blk-core.c
··· 2868 2868 struct request *rqa = container_of(a, struct request, queuelist); 2869 2869 struct request *rqb = container_of(b, struct request, queuelist); 2870 2870 2871 - return !(rqa->q <= rqb->q); 2871 + return !(rqa->q < rqb->q || 2872 + (rqa->q == rqb->q && blk_rq_pos(rqa) < blk_rq_pos(rqb))); 2872 2873 } 2873 2874 2874 2875 /*
+8 -7
drivers/block/Kconfig
··· 131 131 config BLK_CPQ_CISS_DA 132 132 tristate "Compaq Smart Array 5xxx support" 133 133 depends on PCI 134 + select CHECK_SIGNATURE 134 135 help 135 136 This is the driver for Compaq Smart Array 5xxx controllers. 136 137 Everyone using these boards should say Y here. ··· 167 166 module will be called DAC960. 168 167 169 168 config BLK_DEV_UMEM 170 - tristate "Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL)" 171 - depends on PCI && EXPERIMENTAL 169 + tristate "Micro Memory MM5415 Battery Backed RAM support" 170 + depends on PCI 172 171 ---help--- 173 172 Saying Y here will include support for the MM5415 family of 174 173 battery backed (Non-volatile) RAM cards. ··· 431 430 a disc is opened for writing. 432 431 433 432 config CDROM_PKTCDVD_WCACHE 434 - bool "Enable write caching (EXPERIMENTAL)" 435 - depends on CDROM_PKTCDVD && EXPERIMENTAL 433 + bool "Enable write caching" 434 + depends on CDROM_PKTCDVD 436 435 help 437 436 If enabled, write caching will be set for the CD-R/W device. For now 438 437 this option is dangerous unless the CD-RW media is known good, as we ··· 509 508 510 509 511 510 config VIRTIO_BLK 512 - tristate "Virtio block driver (EXPERIMENTAL)" 513 - depends on EXPERIMENTAL && VIRTIO 511 + tristate "Virtio block driver" 512 + depends on VIRTIO 514 513 ---help--- 515 514 This is the virtual block driver for virtio. It can be used with 516 515 lguest or QEMU based VMMs (like KVM or Xen). Say Y or M. ··· 529 528 530 529 config BLK_DEV_RBD 531 530 tristate "Rados block device (RBD)" 532 - depends on INET && EXPERIMENTAL && BLOCK 531 + depends on INET && BLOCK 533 532 select CEPH_LIB 534 533 select LIBCRC32C 535 534 select CRYPTO_AES
-1
drivers/block/cciss.c
··· 5205 5205 return; 5206 5206 } 5207 5207 /* write all data in the battery backed cache to disk */ 5208 - memset(flush_buf, 0, 4); 5209 5208 return_code = sendcmd_withirq(h, CCISS_CACHE_FLUSH, flush_buf, 5210 5209 4, 0, CTLR_LUNID, TYPE_CMD); 5211 5210 kfree(flush_buf);
+48 -42
drivers/block/floppy.c
··· 4109 4109 4110 4110 static struct platform_device floppy_device[N_DRIVE]; 4111 4111 4112 + static bool floppy_available(int drive) 4113 + { 4114 + if (!(allowed_drive_mask & (1 << drive))) 4115 + return false; 4116 + if (fdc_state[FDC(drive)].version == FDC_NONE) 4117 + return false; 4118 + return true; 4119 + } 4120 + 4112 4121 static struct kobject *floppy_find(dev_t dev, int *part, void *data) 4113 4122 { 4114 4123 int drive = (*part & 3) | ((*part & 0x80) >> 5); 4115 - if (drive >= N_DRIVE || 4116 - !(allowed_drive_mask & (1 << drive)) || 4117 - fdc_state[FDC(drive)].version == FDC_NONE) 4124 + if (drive >= N_DRIVE || !floppy_available(drive)) 4118 4125 return NULL; 4119 4126 if (((*part >> 2) & 0x1f) >= ARRAY_SIZE(floppy_type)) 4120 4127 return NULL; ··· 4131 4124 4132 4125 static int __init do_floppy_init(void) 4133 4126 { 4134 - int i, unit, drive; 4135 - int err, dr; 4127 + int i, unit, drive, err; 4136 4128 4137 4129 set_debugt(); 4138 4130 interruptjiffies = resultjiffies = jiffies; ··· 4143 4137 4144 4138 raw_cmd = NULL; 4145 4139 4146 - for (dr = 0; dr < N_DRIVE; dr++) { 4147 - disks[dr] = alloc_disk(1); 4148 - if (!disks[dr]) { 4140 + floppy_wq = alloc_ordered_workqueue("floppy", 0); 4141 + if (!floppy_wq) 4142 + return -ENOMEM; 4143 + 4144 + for (drive = 0; drive < N_DRIVE; drive++) { 4145 + disks[drive] = alloc_disk(1); 4146 + if (!disks[drive]) { 4149 4147 err = -ENOMEM; 4150 4148 goto out_put_disk; 4151 4149 } 4152 4150 4153 - floppy_wq = alloc_ordered_workqueue("floppy", 0); 4154 - if (!floppy_wq) { 4151 + disks[drive]->queue = blk_init_queue(do_fd_request, &floppy_lock); 4152 + if (!disks[drive]->queue) { 4155 4153 err = -ENOMEM; 4156 4154 goto out_put_disk; 4157 4155 } 4158 4156 4159 - disks[dr]->queue = blk_init_queue(do_fd_request, &floppy_lock); 4160 - if (!disks[dr]->queue) { 4161 - err = -ENOMEM; 4162 - goto out_destroy_workq; 4163 - } 4157 + blk_queue_max_hw_sectors(disks[drive]->queue, 64); 4158 + disks[drive]->major = FLOPPY_MAJOR; 4159 + disks[drive]->first_minor = TOMINOR(drive); 4160 + disks[drive]->fops = &floppy_fops; 4161 + sprintf(disks[drive]->disk_name, "fd%d", drive); 4164 4162 4165 - blk_queue_max_hw_sectors(disks[dr]->queue, 64); 4166 - disks[dr]->major = FLOPPY_MAJOR; 4167 - disks[dr]->first_minor = TOMINOR(dr); 4168 - disks[dr]->fops = &floppy_fops; 4169 - sprintf(disks[dr]->disk_name, "fd%d", dr); 4170 - 4171 - init_timer(&motor_off_timer[dr]); 4172 - motor_off_timer[dr].data = dr; 4173 - motor_off_timer[dr].function = motor_off_callback; 4163 + init_timer(&motor_off_timer[drive]); 4164 + motor_off_timer[drive].data = drive; 4165 + motor_off_timer[drive].function = motor_off_callback; 4174 4166 } 4175 4167 4176 4168 err = register_blkdev(FLOPPY_MAJOR, "fd"); ··· 4286 4282 } 4287 4283 4288 4284 for (drive = 0; drive < N_DRIVE; drive++) { 4289 - if (!(allowed_drive_mask & (1 << drive))) 4290 - continue; 4291 - if (fdc_state[FDC(drive)].version == FDC_NONE) 4285 + if (!floppy_available(drive)) 4292 4286 continue; 4293 4287 4294 4288 floppy_device[drive].name = floppy_device_name; ··· 4295 4293 4296 4294 err = platform_device_register(&floppy_device[drive]); 4297 4295 if (err) 4298 - goto out_release_dma; 4296 + goto out_remove_drives; 4299 4297 4300 4298 err = device_create_file(&floppy_device[drive].dev, 4301 4299 &dev_attr_cmos); ··· 4313 4311 4314 4312 out_unreg_platform_dev: 4315 4313 platform_device_unregister(&floppy_device[drive]); 4314 + out_remove_drives: 4315 + while (drive--) { 4316 + if (floppy_available(drive)) { 4317 + del_gendisk(disks[drive]); 4318 + device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos); 4319 + platform_device_unregister(&floppy_device[drive]); 4320 + } 4321 + } 4316 4322 out_release_dma: 4317 4323 if (atomic_read(&usage_count)) 4318 4324 floppy_release_irq_and_dma(); 4319 4325 out_unreg_region: 4320 4326 blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); 4321 4327 platform_driver_unregister(&floppy_driver); 4322 - out_destroy_workq: 4323 - destroy_workqueue(floppy_wq); 4324 4328 out_unreg_blkdev: 4325 4329 unregister_blkdev(FLOPPY_MAJOR, "fd"); 4326 4330 out_put_disk: 4327 - while (dr--) { 4328 - del_timer_sync(&motor_off_timer[dr]); 4329 - if (disks[dr]->queue) { 4330 - blk_cleanup_queue(disks[dr]->queue); 4331 - /* 4332 - * put_disk() is not paired with add_disk() and 4333 - * will put queue reference one extra time. fix it. 4334 - */ 4335 - disks[dr]->queue = NULL; 4331 + for (drive = 0; drive < N_DRIVE; drive++) { 4332 + if (!disks[drive]) 4333 + break; 4334 + if (disks[drive]->queue) { 4335 + del_timer_sync(&motor_off_timer[drive]); 4336 + blk_cleanup_queue(disks[drive]->queue); 4337 + disks[drive]->queue = NULL; 4336 4338 } 4337 - put_disk(disks[dr]); 4339 + put_disk(disks[drive]); 4338 4340 } 4341 + destroy_workqueue(floppy_wq); 4339 4342 return err; 4340 4343 } 4341 4344 ··· 4558 4551 for (drive = 0; drive < N_DRIVE; drive++) { 4559 4552 del_timer_sync(&motor_off_timer[drive]); 4560 4553 4561 - if ((allowed_drive_mask & (1 << drive)) && 4562 - fdc_state[FDC(drive)].version != FDC_NONE) { 4554 + if (floppy_available(drive)) { 4563 4555 del_gendisk(disks[drive]); 4564 4556 device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos); 4565 4557 platform_device_unregister(&floppy_device[drive]);
+15 -2
drivers/block/loop.c
··· 976 976 if (lo->lo_state != Lo_bound) 977 977 return -ENXIO; 978 978 979 - if (lo->lo_refcnt > 1) /* we needed one fd for the ioctl */ 980 - return -EBUSY; 979 + /* 980 + * If we've explicitly asked to tear down the loop device, 981 + * and it has an elevated reference count, set it for auto-teardown when 982 + * the last reference goes away. This stops $!~#$@ udev from 983 + * preventing teardown because it decided that it needs to run blkid on 984 + * the loopback device whenever they appear. xfstests is notorious for 985 + * failing tests because blkid via udev races with a losetup 986 + * <dev>/do something like mkfs/losetup -d <dev> causing the losetup -d 987 + * command to fail with EBUSY. 988 + */ 989 + if (lo->lo_refcnt > 1) { 990 + lo->lo_flags |= LO_FLAGS_AUTOCLEAR; 991 + mutex_unlock(&lo->lo_ctl_mutex); 992 + return 0; 993 + } 981 994 982 995 if (filp == NULL) 983 996 return -EINVAL;
+15 -4
drivers/block/mtip32xx/mtip32xx.c
··· 2035 2035 } 2036 2036 return rv; 2037 2037 } 2038 - 2039 - static void mtip_set_timeout(struct host_to_dev_fis *fis, unsigned int *timeout) 2038 + static void mtip_set_timeout(struct driver_data *dd, 2039 + struct host_to_dev_fis *fis, 2040 + unsigned int *timeout, u8 erasemode) 2040 2041 { 2041 2042 switch (fis->command) { 2042 2043 case ATA_CMD_DOWNLOAD_MICRO: ··· 2045 2044 break; 2046 2045 case ATA_CMD_SEC_ERASE_UNIT: 2047 2046 case 0xFC: 2048 - *timeout = 240000; /* 4 minutes */ 2047 + if (erasemode) 2048 + *timeout = ((*(dd->port->identify + 90) * 2) * 60000); 2049 + else 2050 + *timeout = ((*(dd->port->identify + 89) * 2) * 60000); 2049 2051 break; 2050 2052 case ATA_CMD_STANDBYNOW1: 2051 2053 *timeout = 120000; /* 2 minutes */ ··· 2091 2087 unsigned int transfer_size; 2092 2088 unsigned long task_file_data; 2093 2089 int intotal = outtotal + req_task->out_size; 2090 + int erasemode = 0; 2094 2091 2095 2092 taskout = req_task->out_size; 2096 2093 taskin = req_task->in_size; ··· 2217 2212 fis.lba_hi, 2218 2213 fis.device); 2219 2214 2220 - mtip_set_timeout(&fis, &timeout); 2215 + /* check for erase mode support during secure erase.*/ 2216 + if ((fis.command == ATA_CMD_SEC_ERASE_UNIT) 2217 + && (outbuf[0] & MTIP_SEC_ERASE_MODE)) { 2218 + erasemode = 1; 2219 + } 2220 + 2221 + mtip_set_timeout(dd, &fis, &timeout, erasemode); 2221 2222 2222 2223 /* Determine the correct transfer size.*/ 2223 2224 if (force_single_sector)
+3
drivers/block/mtip32xx/mtip32xx.h
··· 33 33 /* offset of Device Control register in PCIe extended capabilites space */ 34 34 #define PCIE_CONFIG_EXT_DEVICE_CONTROL_OFFSET 0x48 35 35 36 + /* check for erase mode support during secure erase */ 37 + #define MTIP_SEC_ERASE_MODE 0x3 38 + 36 39 /* # of times to retry timed out/failed IOs */ 37 40 #define MTIP_MAX_RETRIES 2 38 41
+2 -2
drivers/block/xen-blkback/common.h
··· 158 158 struct block_device *bdev; 159 159 /* Cached size parameter. */ 160 160 sector_t size; 161 - bool flush_support; 162 - bool discard_secure; 161 + unsigned int flush_support:1; 162 + unsigned int discard_secure:1; 163 163 }; 164 164 165 165 struct backend_info;
+4 -5
drivers/block/xen-blkback/xenbus.c
··· 105 105 { 106 106 struct xen_blkif *blkif; 107 107 108 - blkif = kmem_cache_alloc(xen_blkif_cachep, GFP_KERNEL); 108 + blkif = kmem_cache_zalloc(xen_blkif_cachep, GFP_KERNEL); 109 109 if (!blkif) 110 110 return ERR_PTR(-ENOMEM); 111 111 112 - memset(blkif, 0, sizeof(*blkif)); 113 112 blkif->domid = domid; 114 113 spin_lock_init(&blkif->blk_ring_lock); 115 114 atomic_set(&blkif->refcnt, 1); ··· 195 196 } 196 197 } 197 198 198 - void xen_blkif_free(struct xen_blkif *blkif) 199 + static void xen_blkif_free(struct xen_blkif *blkif) 199 200 { 200 201 if (!atomic_dec_and_test(&blkif->refcnt)) 201 202 BUG(); ··· 256 257 VBD_SHOW(physical_device, "%x:%x\n", be->major, be->minor); 257 258 VBD_SHOW(mode, "%s\n", be->mode); 258 259 259 - int xenvbd_sysfs_addif(struct xenbus_device *dev) 260 + static int xenvbd_sysfs_addif(struct xenbus_device *dev) 260 261 { 261 262 int error; 262 263 ··· 280 281 return error; 281 282 } 282 283 283 - void xenvbd_sysfs_delif(struct xenbus_device *dev) 284 + static void xenvbd_sysfs_delif(struct xenbus_device *dev) 284 285 { 285 286 sysfs_remove_group(&dev->dev.kobj, &xen_vbdstat_group); 286 287 device_remove_file(&dev->dev, &dev_attr_mode);
+4 -2
fs/bio.c
··· 75 75 unsigned int sz = sizeof(struct bio) + extra_size; 76 76 struct kmem_cache *slab = NULL; 77 77 struct bio_slab *bslab, *new_bio_slabs; 78 + unsigned int new_bio_slab_max; 78 79 unsigned int i, entry = -1; 79 80 80 81 mutex_lock(&bio_slab_lock); ··· 98 97 goto out_unlock; 99 98 100 99 if (bio_slab_nr == bio_slab_max && entry == -1) { 101 - bio_slab_max <<= 1; 100 + new_bio_slab_max = bio_slab_max << 1; 102 101 new_bio_slabs = krealloc(bio_slabs, 103 - bio_slab_max * sizeof(struct bio_slab), 102 + new_bio_slab_max * sizeof(struct bio_slab), 104 103 GFP_KERNEL); 105 104 if (!new_bio_slabs) 106 105 goto out_unlock; 106 + bio_slab_max = new_bio_slab_max; 107 107 bio_slabs = new_bio_slabs; 108 108 } 109 109 if (entry == -1)