Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14e931a2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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()
parents a2ae9787 05c69d29
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -743,7 +743,7 @@ void __init printk_all_partitions(void)
		struct hd_struct *part;
		char name_buf[BDEVNAME_SIZE];
		char devt_buf[BDEVT_SIZE];
		u8 uuid[PARTITION_META_INFO_UUIDLTH * 2 + 1];
		char uuid_buf[PARTITION_META_INFO_UUIDLTH * 2 + 5];

		/*
		 * Don't show empty devices or things that have been
@@ -762,14 +762,16 @@ void __init printk_all_partitions(void)
		while ((part = disk_part_iter_next(&piter))) {
			bool is_part0 = part == &disk->part0;

			uuid[0] = 0;
			uuid_buf[0] = '\0';
			if (part->info)
				part_unpack_uuid(part->info->uuid, uuid);
				snprintf(uuid_buf, sizeof(uuid_buf), "%pU",
					 part->info->uuid);

			printk("%s%s %10llu %s %s", is_part0 ? "" : "  ",
			       bdevt_str(part_devt(part), devt_buf),
			       (unsigned long long)part->nr_sects >> 1,
			       disk_name(disk, part->partno, name_buf), uuid);
			       disk_name(disk, part->partno, name_buf),
			       uuid_buf);
			if (is_part0) {
				if (disk->driverfs_dev != NULL &&
				    disk->driverfs_dev->driver != NULL)
+10 −13
Original line number Diff line number Diff line
@@ -6580,14 +6580,11 @@ static const struct file_operations dac960_user_command_proc_fops = {

static void DAC960_CreateProcEntries(DAC960_Controller_T *Controller)
{
	struct proc_dir_entry *StatusProcEntry;
	struct proc_dir_entry *ControllerProcEntry;
	struct proc_dir_entry *UserCommandProcEntry;

	if (DAC960_ProcDirectoryEntry == NULL) {
		DAC960_ProcDirectoryEntry = proc_mkdir("rd", NULL);
  		StatusProcEntry = proc_create("status", 0,
					   DAC960_ProcDirectoryEntry,
		proc_create("status", 0, DAC960_ProcDirectoryEntry,
			    &dac960_proc_fops);
	}

@@ -6596,7 +6593,7 @@ static void DAC960_CreateProcEntries(DAC960_Controller_T *Controller)
					 DAC960_ProcDirectoryEntry);
	proc_create_data("initial_status", 0, ControllerProcEntry, &dac960_initial_status_proc_fops, Controller);
	proc_create_data("current_status", 0, ControllerProcEntry, &dac960_current_status_proc_fops, Controller);
      UserCommandProcEntry = proc_create_data("user_command", S_IWUSR | S_IRUSR, ControllerProcEntry, &dac960_user_command_proc_fops, Controller);
	proc_create_data("user_command", S_IWUSR | S_IRUSR, ControllerProcEntry, &dac960_user_command_proc_fops, Controller);
	Controller->ControllerProcEntry = ControllerProcEntry;
}

+3 −1
Original line number Diff line number Diff line
@@ -2510,8 +2510,10 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd,
		up(&dd->port->cmd_slot);
		return NULL;
	}
	if (unlikely(*tag < 0))
	if (unlikely(*tag < 0)) {
		up(&dd->port->cmd_slot);
		return NULL;
	}

	return dd->port->commands[*tag].sg;
}
+6 −1
Original line number Diff line number Diff line
@@ -505,9 +505,14 @@ EXPORT_SYMBOL(bio_clone);
int bio_get_nr_vecs(struct block_device *bdev)
{
	struct request_queue *q = bdev_get_queue(bdev);
	return min_t(unsigned,
	int nr_pages;

	nr_pages = min_t(unsigned,
		     queue_max_segments(q),
		     queue_max_sectors(q) / (PAGE_SIZE >> 9) + 1);

	return min_t(unsigned, nr_pages, BIO_MAX_PAGES);

}
EXPORT_SYMBOL(bio_get_nr_vecs);

+3 −3
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ static void bdev_inode_switch_bdi(struct inode *inode,
	spin_unlock(&dst->wb.list_lock);
}

static sector_t max_block(struct block_device *bdev)
sector_t blkdev_max_block(struct block_device *bdev)
{
	sector_t retval = ~((sector_t)0);
	loff_t sz = i_size_read(bdev->bd_inode);
@@ -163,7 +163,7 @@ static int
blkdev_get_block(struct inode *inode, sector_t iblock,
		struct buffer_head *bh, int create)
{
	if (iblock >= max_block(I_BDEV(inode))) {
	if (iblock >= blkdev_max_block(I_BDEV(inode))) {
		if (create)
			return -EIO;

@@ -185,7 +185,7 @@ static int
blkdev_get_blocks(struct inode *inode, sector_t iblock,
		struct buffer_head *bh, int create)
{
	sector_t end_block = max_block(I_BDEV(inode));
	sector_t end_block = blkdev_max_block(I_BDEV(inode));
	unsigned long max_blocks = bh->b_size >> inode->i_blkbits;

	if ((iblock + max_blocks) > end_block) {
Loading