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 layer fixes from Jens Axboe:
"A few small, but important fixes. Most of them are marked for stable
as well

- Fix failure to release a semaphore on error path in mtip32xx.
- Fix crashable condition in bio_get_nr_vecs().
- Don't mark end-of-disk buffers as mapped, limit it to i_size.
- Fix for build problem with CONFIG_BLOCK=n on arm at least.
- Fix for a buffer overlow on UUID partition printing.
- Trivial removal of unused variables in dac960."

* 'for-linus' of git://git.kernel.dk/linux-block:
block: fix buffer overflow when printing partition UUIDs
Fix blkdev.h build errors when BLOCK=n
bio allocation failure due to bio_get_nr_vecs()
block: don't mark buffers beyond end of disk as mapped
mtip32xx: release the semaphore on an error path
dac960: Remove unused variables from DAC960_CreateProcEntries()

+34 -30
+6 -4
block/genhd.c
··· 743 743 struct hd_struct *part; 744 744 char name_buf[BDEVNAME_SIZE]; 745 745 char devt_buf[BDEVT_SIZE]; 746 - u8 uuid[PARTITION_META_INFO_UUIDLTH * 2 + 1]; 746 + char uuid_buf[PARTITION_META_INFO_UUIDLTH * 2 + 5]; 747 747 748 748 /* 749 749 * Don't show empty devices or things that have been ··· 762 762 while ((part = disk_part_iter_next(&piter))) { 763 763 bool is_part0 = part == &disk->part0; 764 764 765 - uuid[0] = 0; 765 + uuid_buf[0] = '\0'; 766 766 if (part->info) 767 - part_unpack_uuid(part->info->uuid, uuid); 767 + snprintf(uuid_buf, sizeof(uuid_buf), "%pU", 768 + part->info->uuid); 768 769 769 770 printk("%s%s %10llu %s %s", is_part0 ? "" : " ", 770 771 bdevt_str(part_devt(part), devt_buf), 771 772 (unsigned long long)part->nr_sects >> 1, 772 - disk_name(disk, part->partno, name_buf), uuid); 773 + disk_name(disk, part->partno, name_buf), 774 + uuid_buf); 773 775 if (is_part0) { 774 776 if (disk->driverfs_dev != NULL && 775 777 disk->driverfs_dev->driver != NULL)
+10 -13
drivers/block/DAC960.c
··· 6580 6580 6581 6581 static void DAC960_CreateProcEntries(DAC960_Controller_T *Controller) 6582 6582 { 6583 - struct proc_dir_entry *StatusProcEntry; 6584 6583 struct proc_dir_entry *ControllerProcEntry; 6585 - struct proc_dir_entry *UserCommandProcEntry; 6586 6584 6587 6585 if (DAC960_ProcDirectoryEntry == NULL) { 6588 - DAC960_ProcDirectoryEntry = proc_mkdir("rd", NULL); 6589 - StatusProcEntry = proc_create("status", 0, 6590 - DAC960_ProcDirectoryEntry, 6591 - &dac960_proc_fops); 6586 + DAC960_ProcDirectoryEntry = proc_mkdir("rd", NULL); 6587 + proc_create("status", 0, DAC960_ProcDirectoryEntry, 6588 + &dac960_proc_fops); 6592 6589 } 6593 6590 6594 - sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber); 6595 - ControllerProcEntry = proc_mkdir(Controller->ControllerName, 6596 - DAC960_ProcDirectoryEntry); 6597 - proc_create_data("initial_status", 0, ControllerProcEntry, &dac960_initial_status_proc_fops, Controller); 6598 - proc_create_data("current_status", 0, ControllerProcEntry, &dac960_current_status_proc_fops, Controller); 6599 - UserCommandProcEntry = proc_create_data("user_command", S_IWUSR | S_IRUSR, ControllerProcEntry, &dac960_user_command_proc_fops, Controller); 6600 - Controller->ControllerProcEntry = ControllerProcEntry; 6591 + sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber); 6592 + ControllerProcEntry = proc_mkdir(Controller->ControllerName, 6593 + DAC960_ProcDirectoryEntry); 6594 + proc_create_data("initial_status", 0, ControllerProcEntry, &dac960_initial_status_proc_fops, Controller); 6595 + proc_create_data("current_status", 0, ControllerProcEntry, &dac960_current_status_proc_fops, Controller); 6596 + proc_create_data("user_command", S_IWUSR | S_IRUSR, ControllerProcEntry, &dac960_user_command_proc_fops, Controller); 6597 + Controller->ControllerProcEntry = ControllerProcEntry; 6601 6598 } 6602 6599 6603 6600
+3 -1
drivers/block/mtip32xx/mtip32xx.c
··· 2510 2510 up(&dd->port->cmd_slot); 2511 2511 return NULL; 2512 2512 } 2513 - if (unlikely(*tag < 0)) 2513 + if (unlikely(*tag < 0)) { 2514 + up(&dd->port->cmd_slot); 2514 2515 return NULL; 2516 + } 2515 2517 2516 2518 return dd->port->commands[*tag].sg; 2517 2519 }
+6 -1
fs/bio.c
··· 505 505 int bio_get_nr_vecs(struct block_device *bdev) 506 506 { 507 507 struct request_queue *q = bdev_get_queue(bdev); 508 - return min_t(unsigned, 508 + int nr_pages; 509 + 510 + nr_pages = min_t(unsigned, 509 511 queue_max_segments(q), 510 512 queue_max_sectors(q) / (PAGE_SIZE >> 9) + 1); 513 + 514 + return min_t(unsigned, nr_pages, BIO_MAX_PAGES); 515 + 511 516 } 512 517 EXPORT_SYMBOL(bio_get_nr_vecs); 513 518
+3 -3
fs/block_dev.c
··· 70 70 spin_unlock(&dst->wb.list_lock); 71 71 } 72 72 73 - static sector_t max_block(struct block_device *bdev) 73 + sector_t blkdev_max_block(struct block_device *bdev) 74 74 { 75 75 sector_t retval = ~((sector_t)0); 76 76 loff_t sz = i_size_read(bdev->bd_inode); ··· 163 163 blkdev_get_block(struct inode *inode, sector_t iblock, 164 164 struct buffer_head *bh, int create) 165 165 { 166 - if (iblock >= max_block(I_BDEV(inode))) { 166 + if (iblock >= blkdev_max_block(I_BDEV(inode))) { 167 167 if (create) 168 168 return -EIO; 169 169 ··· 185 185 blkdev_get_blocks(struct inode *inode, sector_t iblock, 186 186 struct buffer_head *bh, int create) 187 187 { 188 - sector_t end_block = max_block(I_BDEV(inode)); 188 + sector_t end_block = blkdev_max_block(I_BDEV(inode)); 189 189 unsigned long max_blocks = bh->b_size >> inode->i_blkbits; 190 190 191 191 if ((iblock + max_blocks) > end_block) {
+3 -1
fs/buffer.c
··· 921 921 struct buffer_head *head = page_buffers(page); 922 922 struct buffer_head *bh = head; 923 923 int uptodate = PageUptodate(page); 924 + sector_t end_block = blkdev_max_block(I_BDEV(bdev->bd_inode)); 924 925 925 926 do { 926 927 if (!buffer_mapped(bh)) { ··· 930 929 bh->b_blocknr = block; 931 930 if (uptodate) 932 931 set_buffer_uptodate(bh); 933 - set_buffer_mapped(bh); 932 + if (block < end_block) 933 + set_buffer_mapped(bh); 934 934 } 935 935 block++; 936 936 bh = bh->b_this_page;
+2 -1
include/linux/blkdev.h
··· 1 1 #ifndef _LINUX_BLKDEV_H 2 2 #define _LINUX_BLKDEV_H 3 3 4 + #include <linux/sched.h> 5 + 4 6 #ifdef CONFIG_BLOCK 5 7 6 - #include <linux/sched.h> 7 8 #include <linux/major.h> 8 9 #include <linux/genhd.h> 9 10 #include <linux/list.h>
+1
include/linux/fs.h
··· 2051 2051 extern struct block_device *bdget(dev_t); 2052 2052 extern struct block_device *bdgrab(struct block_device *bdev); 2053 2053 extern void bd_set_size(struct block_device *, loff_t size); 2054 + extern sector_t blkdev_max_block(struct block_device *bdev); 2054 2055 extern void bd_forget(struct inode *inode); 2055 2056 extern void bdput(struct block_device *); 2056 2057 extern void invalidate_bdev(struct block_device *);
-6
include/linux/genhd.h
··· 222 222 } 223 223 } 224 224 225 - static inline char *part_unpack_uuid(const u8 *uuid, char *out) 226 - { 227 - sprintf(out, "%pU", uuid); 228 - return out; 229 - } 230 - 231 225 static inline int disk_max_parts(struct gendisk *disk) 232 226 { 233 227 if (disk->flags & GENHD_FL_EXT_DEVT)