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

Commit 15bd1cfb authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

* 'for-linus' of git://git.kernel.dk/linux-block:
  block: add missed trace_block_plug
  paride: fix potential information leak in pg_read()
  bio: change some signed vars to unsigned
  block: avoid unnecessary plug list flush
  cciss: auto engage SCSI mid layer at driver load time
  loop: cleanup set_status interface
  include/linux/bio.h: use a static inline function for bio_integrity_clone()
  loop: prevent information leak after failed read
  block: Always check length of all iov entries in blk_rq_map_user_iov()
  The Windows driver .inf disables ASPM on all cciss devices. Do the same.
  backing-dev: ensure wakeup_timer is deleted
  block: Revert "[SCSI] genhd: add a new attribute "alias" in gendisk"
parents 9545eb61 019ceb7d
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -206,16 +206,3 @@ Description:
		when a discarded area is read the discard_zeroes_data
		parameter will be set to one. Otherwise it will be 0 and
		the result of reading a discarded area is undefined.
What:		/sys/block/<disk>/alias
Date:		Aug 2011
Contact:	Nao Nishijima <nao.nishijima.xt@hitachi.com>
Description:
		A raw device name of a disk does not always point a same disk
		each boot-up time. Therefore, users have to use persistent
		device names, which udev creates when the kernel finds a disk,
		instead of raw device name. However, kernel doesn't show those
		persistent names on its messages (e.g. dmesg).
		This file can store an alias of the disk and it would be
		appeared in kernel messages if it is set. A disk can have an
		alias which length is up to 255bytes. Users can use alphabets,
		numbers, "-" and "_" in alias name. This file is writeonce.
+6 −8
Original line number Diff line number Diff line
@@ -98,14 +98,12 @@ You must enable "SCSI tape drive support for Smart Array 5xxx" and
"SCSI support" in your kernel configuration to be able to use SCSI
tape drives with your Smart Array 5xxx controller.

Additionally, note that the driver will not engage the SCSI core at init 
time.  The driver must be directed to dynamically engage the SCSI core via 
the /proc filesystem entry which the "block" side of the driver creates as 
/proc/driver/cciss/cciss* at runtime.  This is because at driver init time, 
the SCSI core may not yet be initialized (because the driver is a block 
driver) and attempting to register it with the SCSI core in such a case 
would cause a hang.  This is best done via an initialization script 
(typically in /etc/init.d, but could vary depending on distribution). 
Additionally, note that the driver will engage the SCSI core at init
time if any tape drives or medium changers are detected.  The driver may
also be directed to dynamically engage the SCSI core via the /proc filesystem
entry which the "block" side of the driver creates as
/proc/driver/cciss/cciss* at runtime.  This is best done via a script.

For example:

	for x in /proc/driver/cciss/cciss[0-9]*
+11 −7
Original line number Diff line number Diff line
@@ -1379,15 +1379,19 @@ void blk_queue_bio(struct request_queue *q, struct bio *bio)
		 */
		if (list_empty(&plug->list))
			trace_block_plug(q);
		else if (!plug->should_sort) {
		else {
			if (!plug->should_sort) {
				struct request *__rq;

				__rq = list_entry_rq(plug->list.prev);
				if (__rq->q != q)
					plug->should_sort = 1;
			}
		if (request_count >= BLK_MAX_REQUEST_COUNT)
			if (request_count >= BLK_MAX_REQUEST_COUNT) {
				blk_flush_plug_list(plug, false);
				trace_block_plug(q);
			}
		}
		list_add_tail(&req->queuelist, &plug->list);
		drive_stat_acct(req, 1);
	} else {
+4 −3
Original line number Diff line number Diff line
@@ -204,10 +204,11 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
		if (!iov[i].iov_len)
			return -EINVAL;

		if (uaddr & queue_dma_alignment(q)) {
		/*
		 * Keep going so we check length of all segments
		 */
		if (uaddr & queue_dma_alignment(q))
			unaligned = 1;
			break;
		}
	}

	if (unaligned || (q->dma_pad_mask & len) || map_data)
+0 −71
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@
#include <linux/mutex.h>
#include <linux/idr.h>
#include <linux/log2.h>
#include <linux/ctype.h>

#include "blk.h"

@@ -916,74 +915,6 @@ static int __init genhd_device_init(void)

subsys_initcall(genhd_device_init);

static ssize_t alias_show(struct device *dev,
			       struct device_attribute *attr, char *buf)
{
	struct gendisk *disk = dev_to_disk(dev);
	ssize_t ret = 0;

	if (disk->alias)
		ret = snprintf(buf, ALIAS_LEN, "%s\n", disk->alias);
	return ret;
}

static ssize_t alias_store(struct device *dev, struct device_attribute *attr,
			   const char *buf, size_t count)
{
	struct gendisk *disk = dev_to_disk(dev);
	char *alias;
	char *envp[] = { NULL, NULL };
	unsigned char c;
	int i;
	ssize_t ret = count;

	if (!count)
		return -EINVAL;

	if (count >= ALIAS_LEN) {
		printk(KERN_ERR "alias: alias is too long\n");
		return -EINVAL;
	}

	/* Validation check */
	for (i = 0; i < count; i++) {
		c = buf[i];
		if (i == count - 1 && c == '\n')
			break;
		if (!isalnum(c) && c != '_' && c != '-') {
			printk(KERN_ERR "alias: invalid alias\n");
			return -EINVAL;
		}
	}

	if (disk->alias) {
		printk(KERN_INFO "alias: %s is already assigned (%s)\n",
		       disk->disk_name, disk->alias);
		return -EINVAL;
	}

	alias = kasprintf(GFP_KERNEL, "%s", buf);
	if (!alias)
		return -ENOMEM;

	if (alias[count - 1] == '\n')
		alias[count - 1] = '\0';

	envp[0] = kasprintf(GFP_KERNEL, "ALIAS=%s", alias);
	if (!envp[0]) {
		kfree(alias);
		return -ENOMEM;
	}

	disk->alias = alias;
	printk(KERN_INFO "alias: assigned %s to %s\n", alias, disk->disk_name);

	kobject_uevent_env(&dev->kobj, KOBJ_ADD, envp);

	kfree(envp[0]);
	return ret;
}

static ssize_t disk_range_show(struct device *dev,
			       struct device_attribute *attr, char *buf)
{
@@ -1043,7 +974,6 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
	return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
}

static DEVICE_ATTR(alias, S_IRUGO|S_IWUSR, alias_show, alias_store);
static DEVICE_ATTR(range, S_IRUGO, disk_range_show, NULL);
static DEVICE_ATTR(ext_range, S_IRUGO, disk_ext_range_show, NULL);
static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL);
@@ -1066,7 +996,6 @@ static struct device_attribute dev_attr_fail_timeout =
#endif

static struct attribute *disk_attrs[] = {
	&dev_attr_alias.attr,
	&dev_attr_range.attr,
	&dev_attr_ext_range.attr,
	&dev_attr_removable.attr,
Loading