diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-18 06:34:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-18 06:34:35 -0500 |
commit | 15bd1cfb3055d866614cdaf38e43201936264e50 (patch) | |
tree | 020261b5a984684201a39e661934aa5dcdf82f83 | |
parent | 9545eb61e5bb70055fd9358f25f95387f7398cba (diff) | |
parent | 019ceb7d5d252ce71001a157cf29f4ac28501b72 (diff) |
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"
-rw-r--r-- | Documentation/ABI/testing/sysfs-block | 13 | ||||
-rw-r--r-- | Documentation/blockdev/cciss.txt | 14 | ||||
-rw-r--r-- | block/blk-core.c | 18 | ||||
-rw-r--r-- | block/blk-map.c | 7 | ||||
-rw-r--r-- | block/genhd.c | 71 | ||||
-rw-r--r-- | drivers/block/cciss.c | 6 | ||||
-rw-r--r-- | drivers/block/cciss_scsi.c | 1 | ||||
-rw-r--r-- | drivers/block/loop.c | 47 | ||||
-rw-r--r-- | drivers/block/paride/pg.c | 1 | ||||
-rw-r--r-- | fs/bio.c | 7 | ||||
-rw-r--r-- | include/linux/bio.h | 10 | ||||
-rw-r--r-- | include/linux/genhd.h | 4 | ||||
-rw-r--r-- | mm/backing-dev.c | 8 |
13 files changed, 79 insertions, 128 deletions
diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block index 2b5d56127fce..c1eb41cb9876 100644 --- a/Documentation/ABI/testing/sysfs-block +++ b/Documentation/ABI/testing/sysfs-block | |||
@@ -206,16 +206,3 @@ Description: | |||
206 | when a discarded area is read the discard_zeroes_data | 206 | when a discarded area is read the discard_zeroes_data |
207 | parameter will be set to one. Otherwise it will be 0 and | 207 | parameter will be set to one. Otherwise it will be 0 and |
208 | the result of reading a discarded area is undefined. | 208 | the result of reading a discarded area is undefined. |
209 | What: /sys/block/<disk>/alias | ||
210 | Date: Aug 2011 | ||
211 | Contact: Nao Nishijima <nao.nishijima.xt@hitachi.com> | ||
212 | Description: | ||
213 | A raw device name of a disk does not always point a same disk | ||
214 | each boot-up time. Therefore, users have to use persistent | ||
215 | device names, which udev creates when the kernel finds a disk, | ||
216 | instead of raw device name. However, kernel doesn't show those | ||
217 | persistent names on its messages (e.g. dmesg). | ||
218 | This file can store an alias of the disk and it would be | ||
219 | appeared in kernel messages if it is set. A disk can have an | ||
220 | alias which length is up to 255bytes. Users can use alphabets, | ||
221 | numbers, "-" and "_" in alias name. This file is writeonce. | ||
diff --git a/Documentation/blockdev/cciss.txt b/Documentation/blockdev/cciss.txt index 71464e09ec18..b79d0a13e7cd 100644 --- a/Documentation/blockdev/cciss.txt +++ b/Documentation/blockdev/cciss.txt | |||
@@ -98,14 +98,12 @@ You must enable "SCSI tape drive support for Smart Array 5xxx" and | |||
98 | "SCSI support" in your kernel configuration to be able to use SCSI | 98 | "SCSI support" in your kernel configuration to be able to use SCSI |
99 | tape drives with your Smart Array 5xxx controller. | 99 | tape drives with your Smart Array 5xxx controller. |
100 | 100 | ||
101 | Additionally, note that the driver will not engage the SCSI core at init | 101 | Additionally, note that the driver will engage the SCSI core at init |
102 | time. The driver must be directed to dynamically engage the SCSI core via | 102 | time if any tape drives or medium changers are detected. The driver may |
103 | the /proc filesystem entry which the "block" side of the driver creates as | 103 | also be directed to dynamically engage the SCSI core via the /proc filesystem |
104 | /proc/driver/cciss/cciss* at runtime. This is because at driver init time, | 104 | entry which the "block" side of the driver creates as |
105 | the SCSI core may not yet be initialized (because the driver is a block | 105 | /proc/driver/cciss/cciss* at runtime. This is best done via a script. |
106 | driver) and attempting to register it with the SCSI core in such a case | 106 | |
107 | would cause a hang. This is best done via an initialization script | ||
108 | (typically in /etc/init.d, but could vary depending on distribution). | ||
109 | For example: | 107 | For example: |
110 | 108 | ||
111 | for x in /proc/driver/cciss/cciss[0-9]* | 109 | for x in /proc/driver/cciss/cciss[0-9]* |
diff --git a/block/blk-core.c b/block/blk-core.c index f43c8a5840ae..ea70e6c80cd3 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1379,15 +1379,19 @@ get_rq: | |||
1379 | */ | 1379 | */ |
1380 | if (list_empty(&plug->list)) | 1380 | if (list_empty(&plug->list)) |
1381 | trace_block_plug(q); | 1381 | trace_block_plug(q); |
1382 | else if (!plug->should_sort) { | 1382 | else { |
1383 | struct request *__rq; | 1383 | if (!plug->should_sort) { |
1384 | struct request *__rq; | ||
1384 | 1385 | ||
1385 | __rq = list_entry_rq(plug->list.prev); | 1386 | __rq = list_entry_rq(plug->list.prev); |
1386 | if (__rq->q != q) | 1387 | if (__rq->q != q) |
1387 | plug->should_sort = 1; | 1388 | plug->should_sort = 1; |
1389 | } | ||
1390 | if (request_count >= BLK_MAX_REQUEST_COUNT) { | ||
1391 | blk_flush_plug_list(plug, false); | ||
1392 | trace_block_plug(q); | ||
1393 | } | ||
1388 | } | 1394 | } |
1389 | if (request_count >= BLK_MAX_REQUEST_COUNT) | ||
1390 | blk_flush_plug_list(plug, false); | ||
1391 | list_add_tail(&req->queuelist, &plug->list); | 1395 | list_add_tail(&req->queuelist, &plug->list); |
1392 | drive_stat_acct(req, 1); | 1396 | drive_stat_acct(req, 1); |
1393 | } else { | 1397 | } else { |
diff --git a/block/blk-map.c b/block/blk-map.c index e663ac2d8e68..164cd0059706 100644 --- a/block/blk-map.c +++ b/block/blk-map.c | |||
@@ -204,10 +204,11 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, | |||
204 | if (!iov[i].iov_len) | 204 | if (!iov[i].iov_len) |
205 | return -EINVAL; | 205 | return -EINVAL; |
206 | 206 | ||
207 | if (uaddr & queue_dma_alignment(q)) { | 207 | /* |
208 | * Keep going so we check length of all segments | ||
209 | */ | ||
210 | if (uaddr & queue_dma_alignment(q)) | ||
208 | unaligned = 1; | 211 | unaligned = 1; |
209 | break; | ||
210 | } | ||
211 | } | 212 | } |
212 | 213 | ||
213 | if (unaligned || (q->dma_pad_mask & len) || map_data) | 214 | if (unaligned || (q->dma_pad_mask & len) || map_data) |
diff --git a/block/genhd.c b/block/genhd.c index 9253839714ff..02e9fca80825 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/mutex.h> | 19 | #include <linux/mutex.h> |
20 | #include <linux/idr.h> | 20 | #include <linux/idr.h> |
21 | #include <linux/log2.h> | 21 | #include <linux/log2.h> |
22 | #include <linux/ctype.h> | ||
23 | 22 | ||
24 | #include "blk.h" | 23 | #include "blk.h" |
25 | 24 | ||
@@ -916,74 +915,6 @@ static int __init genhd_device_init(void) | |||
916 | 915 | ||
917 | subsys_initcall(genhd_device_init); | 916 | subsys_initcall(genhd_device_init); |
918 | 917 | ||
919 | static ssize_t alias_show(struct device *dev, | ||
920 | struct device_attribute *attr, char *buf) | ||
921 | { | ||
922 | struct gendisk *disk = dev_to_disk(dev); | ||
923 | ssize_t ret = 0; | ||
924 | |||
925 | if (disk->alias) | ||
926 | ret = snprintf(buf, ALIAS_LEN, "%s\n", disk->alias); | ||
927 | return ret; | ||
928 | } | ||
929 | |||
930 | static ssize_t alias_store(struct device *dev, struct device_attribute *attr, | ||
931 | const char *buf, size_t count) | ||
932 | { | ||
933 | struct gendisk *disk = dev_to_disk(dev); | ||
934 | char *alias; | ||
935 | char *envp[] = { NULL, NULL }; | ||
936 | unsigned char c; | ||
937 | int i; | ||
938 | ssize_t ret = count; | ||
939 | |||
940 | if (!count) | ||
941 | return -EINVAL; | ||
942 | |||
943 | if (count >= ALIAS_LEN) { | ||
944 | printk(KERN_ERR "alias: alias is too long\n"); | ||
945 | return -EINVAL; | ||
946 | } | ||
947 | |||
948 | /* Validation check */ | ||
949 | for (i = 0; i < count; i++) { | ||
950 | c = buf[i]; | ||
951 | if (i == count - 1 && c == '\n') | ||
952 | break; | ||
953 | if (!isalnum(c) && c != '_' && c != '-') { | ||
954 | printk(KERN_ERR "alias: invalid alias\n"); | ||
955 | return -EINVAL; | ||
956 | } | ||
957 | } | ||
958 | |||
959 | if (disk->alias) { | ||
960 | printk(KERN_INFO "alias: %s is already assigned (%s)\n", | ||
961 | disk->disk_name, disk->alias); | ||
962 | return -EINVAL; | ||
963 | } | ||
964 | |||
965 | alias = kasprintf(GFP_KERNEL, "%s", buf); | ||
966 | if (!alias) | ||
967 | return -ENOMEM; | ||
968 | |||
969 | if (alias[count - 1] == '\n') | ||
970 | alias[count - 1] = '\0'; | ||
971 | |||
972 | envp[0] = kasprintf(GFP_KERNEL, "ALIAS=%s", alias); | ||
973 | if (!envp[0]) { | ||
974 | kfree(alias); | ||
975 | return -ENOMEM; | ||
976 | } | ||
977 | |||
978 | disk->alias = alias; | ||
979 | printk(KERN_INFO "alias: assigned %s to %s\n", alias, disk->disk_name); | ||
980 | |||
981 | kobject_uevent_env(&dev->kobj, KOBJ_ADD, envp); | ||
982 | |||
983 | kfree(envp[0]); | ||
984 | return ret; | ||
985 | } | ||
986 | |||
987 | static ssize_t disk_range_show(struct device *dev, | 918 | static ssize_t disk_range_show(struct device *dev, |
988 | struct device_attribute *attr, char *buf) | 919 | struct device_attribute *attr, char *buf) |
989 | { | 920 | { |
@@ -1043,7 +974,6 @@ static ssize_t disk_discard_alignment_show(struct device *dev, | |||
1043 | return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue)); | 974 | return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue)); |
1044 | } | 975 | } |
1045 | 976 | ||
1046 | static DEVICE_ATTR(alias, S_IRUGO|S_IWUSR, alias_show, alias_store); | ||
1047 | static DEVICE_ATTR(range, S_IRUGO, disk_range_show, NULL); | 977 | static DEVICE_ATTR(range, S_IRUGO, disk_range_show, NULL); |
1048 | static DEVICE_ATTR(ext_range, S_IRUGO, disk_ext_range_show, NULL); | 978 | static DEVICE_ATTR(ext_range, S_IRUGO, disk_ext_range_show, NULL); |
1049 | static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL); | 979 | static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL); |
@@ -1066,7 +996,6 @@ static struct device_attribute dev_attr_fail_timeout = | |||
1066 | #endif | 996 | #endif |
1067 | 997 | ||
1068 | static struct attribute *disk_attrs[] = { | 998 | static struct attribute *disk_attrs[] = { |
1069 | &dev_attr_alias.attr, | ||
1070 | &dev_attr_range.attr, | 999 | &dev_attr_range.attr, |
1071 | &dev_attr_ext_range.attr, | 1000 | &dev_attr_ext_range.attr, |
1072 | &dev_attr_removable.attr, | 1001 | &dev_attr_removable.attr, |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 486f94ef24d4..8004ac30a7a8 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/pci.h> | 26 | #include <linux/pci.h> |
27 | #include <linux/pci-aspm.h> | ||
27 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
28 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
29 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
@@ -4319,6 +4320,10 @@ static int __devinit cciss_pci_init(ctlr_info_t *h) | |||
4319 | dev_warn(&h->pdev->dev, "controller appears to be disabled\n"); | 4320 | dev_warn(&h->pdev->dev, "controller appears to be disabled\n"); |
4320 | return -ENODEV; | 4321 | return -ENODEV; |
4321 | } | 4322 | } |
4323 | |||
4324 | pci_disable_link_state(h->pdev, PCIE_LINK_STATE_L0S | | ||
4325 | PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_CLKPM); | ||
4326 | |||
4322 | err = pci_enable_device(h->pdev); | 4327 | err = pci_enable_device(h->pdev); |
4323 | if (err) { | 4328 | if (err) { |
4324 | dev_warn(&h->pdev->dev, "Unable to Enable PCI device\n"); | 4329 | dev_warn(&h->pdev->dev, "Unable to Enable PCI device\n"); |
@@ -5158,6 +5163,7 @@ reinit_after_soft_reset: | |||
5158 | h->cciss_max_sectors = 8192; | 5163 | h->cciss_max_sectors = 8192; |
5159 | 5164 | ||
5160 | rebuild_lun_table(h, 1, 0); | 5165 | rebuild_lun_table(h, 1, 0); |
5166 | cciss_engage_scsi(h); | ||
5161 | h->busy_initializing = 0; | 5167 | h->busy_initializing = 0; |
5162 | return 1; | 5168 | return 1; |
5163 | 5169 | ||
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 951a4e33b92b..e820b68d2f6c 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
@@ -1720,5 +1720,6 @@ static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd) | |||
1720 | /* If no tape support, then these become defined out of existence */ | 1720 | /* If no tape support, then these become defined out of existence */ |
1721 | 1721 | ||
1722 | #define cciss_scsi_setup(cntl_num) | 1722 | #define cciss_scsi_setup(cntl_num) |
1723 | #define cciss_engage_scsi(h) | ||
1723 | 1724 | ||
1724 | #endif /* CONFIG_CISS_SCSI_TAPE */ | 1725 | #endif /* CONFIG_CISS_SCSI_TAPE */ |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 3d806820280e..68b205a9338f 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -161,17 +161,19 @@ static struct loop_func_table *xfer_funcs[MAX_LO_CRYPT] = { | |||
161 | &xor_funcs | 161 | &xor_funcs |
162 | }; | 162 | }; |
163 | 163 | ||
164 | static loff_t get_loop_size(struct loop_device *lo, struct file *file) | 164 | static loff_t get_size(loff_t offset, loff_t sizelimit, struct file *file) |
165 | { | 165 | { |
166 | loff_t size, offset, loopsize; | 166 | loff_t size, loopsize; |
167 | 167 | ||
168 | /* Compute loopsize in bytes */ | 168 | /* Compute loopsize in bytes */ |
169 | size = i_size_read(file->f_mapping->host); | 169 | size = i_size_read(file->f_mapping->host); |
170 | offset = lo->lo_offset; | ||
171 | loopsize = size - offset; | 170 | loopsize = size - offset; |
172 | if (lo->lo_sizelimit > 0 && lo->lo_sizelimit < loopsize) | 171 | /* offset is beyond i_size, wierd but possible */ |
173 | loopsize = lo->lo_sizelimit; | 172 | if (loopsize < 0) |
173 | return 0; | ||
174 | 174 | ||
175 | if (sizelimit > 0 && sizelimit < loopsize) | ||
176 | loopsize = sizelimit; | ||
175 | /* | 177 | /* |
176 | * Unfortunately, if we want to do I/O on the device, | 178 | * Unfortunately, if we want to do I/O on the device, |
177 | * the number of 512-byte sectors has to fit into a sector_t. | 179 | * the number of 512-byte sectors has to fit into a sector_t. |
@@ -179,17 +181,25 @@ static loff_t get_loop_size(struct loop_device *lo, struct file *file) | |||
179 | return loopsize >> 9; | 181 | return loopsize >> 9; |
180 | } | 182 | } |
181 | 183 | ||
184 | static loff_t get_loop_size(struct loop_device *lo, struct file *file) | ||
185 | { | ||
186 | return get_size(lo->lo_offset, lo->lo_sizelimit, file); | ||
187 | } | ||
188 | |||
182 | static int | 189 | static int |
183 | figure_loop_size(struct loop_device *lo) | 190 | figure_loop_size(struct loop_device *lo, loff_t offset, loff_t sizelimit) |
184 | { | 191 | { |
185 | loff_t size = get_loop_size(lo, lo->lo_backing_file); | 192 | loff_t size = get_size(offset, sizelimit, lo->lo_backing_file); |
186 | sector_t x = (sector_t)size; | 193 | sector_t x = (sector_t)size; |
187 | 194 | ||
188 | if (unlikely((loff_t)x != size)) | 195 | if (unlikely((loff_t)x != size)) |
189 | return -EFBIG; | 196 | return -EFBIG; |
190 | 197 | if (lo->lo_offset != offset) | |
198 | lo->lo_offset = offset; | ||
199 | if (lo->lo_sizelimit != sizelimit) | ||
200 | lo->lo_sizelimit = sizelimit; | ||
191 | set_capacity(lo->lo_disk, x); | 201 | set_capacity(lo->lo_disk, x); |
192 | return 0; | 202 | return 0; |
193 | } | 203 | } |
194 | 204 | ||
195 | static inline int | 205 | static inline int |
@@ -372,7 +382,8 @@ do_lo_receive(struct loop_device *lo, | |||
372 | 382 | ||
373 | if (retval < 0) | 383 | if (retval < 0) |
374 | return retval; | 384 | return retval; |
375 | 385 | if (retval != bvec->bv_len) | |
386 | return -EIO; | ||
376 | return 0; | 387 | return 0; |
377 | } | 388 | } |
378 | 389 | ||
@@ -1058,9 +1069,7 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info) | |||
1058 | 1069 | ||
1059 | if (lo->lo_offset != info->lo_offset || | 1070 | if (lo->lo_offset != info->lo_offset || |
1060 | lo->lo_sizelimit != info->lo_sizelimit) { | 1071 | lo->lo_sizelimit != info->lo_sizelimit) { |
1061 | lo->lo_offset = info->lo_offset; | 1072 | if (figure_loop_size(lo, info->lo_offset, info->lo_sizelimit)) |
1062 | lo->lo_sizelimit = info->lo_sizelimit; | ||
1063 | if (figure_loop_size(lo)) | ||
1064 | return -EFBIG; | 1073 | return -EFBIG; |
1065 | } | 1074 | } |
1066 | loop_config_discard(lo); | 1075 | loop_config_discard(lo); |
@@ -1246,7 +1255,7 @@ static int loop_set_capacity(struct loop_device *lo, struct block_device *bdev) | |||
1246 | err = -ENXIO; | 1255 | err = -ENXIO; |
1247 | if (unlikely(lo->lo_state != Lo_bound)) | 1256 | if (unlikely(lo->lo_state != Lo_bound)) |
1248 | goto out; | 1257 | goto out; |
1249 | err = figure_loop_size(lo); | 1258 | err = figure_loop_size(lo, lo->lo_offset, lo->lo_sizelimit); |
1250 | if (unlikely(err)) | 1259 | if (unlikely(err)) |
1251 | goto out; | 1260 | goto out; |
1252 | sec = get_capacity(lo->lo_disk); | 1261 | sec = get_capacity(lo->lo_disk); |
@@ -1284,13 +1293,19 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode, | |||
1284 | goto out_unlocked; | 1293 | goto out_unlocked; |
1285 | break; | 1294 | break; |
1286 | case LOOP_SET_STATUS: | 1295 | case LOOP_SET_STATUS: |
1287 | err = loop_set_status_old(lo, (struct loop_info __user *) arg); | 1296 | err = -EPERM; |
1297 | if ((mode & FMODE_WRITE) || capable(CAP_SYS_ADMIN)) | ||
1298 | err = loop_set_status_old(lo, | ||
1299 | (struct loop_info __user *)arg); | ||
1288 | break; | 1300 | break; |
1289 | case LOOP_GET_STATUS: | 1301 | case LOOP_GET_STATUS: |
1290 | err = loop_get_status_old(lo, (struct loop_info __user *) arg); | 1302 | err = loop_get_status_old(lo, (struct loop_info __user *) arg); |
1291 | break; | 1303 | break; |
1292 | case LOOP_SET_STATUS64: | 1304 | case LOOP_SET_STATUS64: |
1293 | err = loop_set_status64(lo, (struct loop_info64 __user *) arg); | 1305 | err = -EPERM; |
1306 | if ((mode & FMODE_WRITE) || capable(CAP_SYS_ADMIN)) | ||
1307 | err = loop_set_status64(lo, | ||
1308 | (struct loop_info64 __user *) arg); | ||
1294 | break; | 1309 | break; |
1295 | case LOOP_GET_STATUS64: | 1310 | case LOOP_GET_STATUS64: |
1296 | err = loop_get_status64(lo, (struct loop_info64 __user *) arg); | 1311 | err = loop_get_status64(lo, (struct loop_info64 __user *) arg); |
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c index 6b9a2000d56a..a79fb4f7ff62 100644 --- a/drivers/block/paride/pg.c +++ b/drivers/block/paride/pg.c | |||
@@ -630,6 +630,7 @@ static ssize_t pg_read(struct file *filp, char __user *buf, size_t count, loff_t | |||
630 | if (dev->status & 0x10) | 630 | if (dev->status & 0x10) |
631 | return -ETIME; | 631 | return -ETIME; |
632 | 632 | ||
633 | memset(&hdr, 0, sizeof(hdr)); | ||
633 | hdr.magic = PG_MAGIC; | 634 | hdr.magic = PG_MAGIC; |
634 | hdr.dlen = dev->dlen; | 635 | hdr.dlen = dev->dlen; |
635 | copy = 0; | 636 | copy = 0; |
@@ -337,7 +337,7 @@ static void bio_fs_destructor(struct bio *bio) | |||
337 | * RETURNS: | 337 | * RETURNS: |
338 | * Pointer to new bio on success, NULL on failure. | 338 | * Pointer to new bio on success, NULL on failure. |
339 | */ | 339 | */ |
340 | struct bio *bio_alloc(gfp_t gfp_mask, int nr_iovecs) | 340 | struct bio *bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs) |
341 | { | 341 | { |
342 | struct bio *bio = bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set); | 342 | struct bio *bio = bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set); |
343 | 343 | ||
@@ -365,7 +365,7 @@ static void bio_kmalloc_destructor(struct bio *bio) | |||
365 | * %__GFP_WAIT, the allocation is guaranteed to succeed. | 365 | * %__GFP_WAIT, the allocation is guaranteed to succeed. |
366 | * | 366 | * |
367 | **/ | 367 | **/ |
368 | struct bio *bio_kmalloc(gfp_t gfp_mask, int nr_iovecs) | 368 | struct bio *bio_kmalloc(gfp_t gfp_mask, unsigned int nr_iovecs) |
369 | { | 369 | { |
370 | struct bio *bio; | 370 | struct bio *bio; |
371 | 371 | ||
@@ -696,7 +696,8 @@ static void bio_free_map_data(struct bio_map_data *bmd) | |||
696 | kfree(bmd); | 696 | kfree(bmd); |
697 | } | 697 | } |
698 | 698 | ||
699 | static struct bio_map_data *bio_alloc_map_data(int nr_segs, int iov_count, | 699 | static struct bio_map_data *bio_alloc_map_data(int nr_segs, |
700 | unsigned int iov_count, | ||
700 | gfp_t gfp_mask) | 701 | gfp_t gfp_mask) |
701 | { | 702 | { |
702 | struct bio_map_data *bmd; | 703 | struct bio_map_data *bmd; |
diff --git a/include/linux/bio.h b/include/linux/bio.h index a3c071c9e189..847994aef0e9 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -211,8 +211,8 @@ extern void bio_pair_release(struct bio_pair *dbio); | |||
211 | extern struct bio_set *bioset_create(unsigned int, unsigned int); | 211 | extern struct bio_set *bioset_create(unsigned int, unsigned int); |
212 | extern void bioset_free(struct bio_set *); | 212 | extern void bioset_free(struct bio_set *); |
213 | 213 | ||
214 | extern struct bio *bio_alloc(gfp_t, int); | 214 | extern struct bio *bio_alloc(gfp_t, unsigned int); |
215 | extern struct bio *bio_kmalloc(gfp_t, int); | 215 | extern struct bio *bio_kmalloc(gfp_t, unsigned int); |
216 | extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); | 216 | extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); |
217 | extern void bio_put(struct bio *); | 217 | extern void bio_put(struct bio *); |
218 | extern void bio_free(struct bio *, struct bio_set *); | 218 | extern void bio_free(struct bio *, struct bio_set *); |
@@ -519,7 +519,11 @@ extern void bio_integrity_init(void); | |||
519 | #define bioset_integrity_create(a, b) (0) | 519 | #define bioset_integrity_create(a, b) (0) |
520 | #define bio_integrity_prep(a) (0) | 520 | #define bio_integrity_prep(a) (0) |
521 | #define bio_integrity_enabled(a) (0) | 521 | #define bio_integrity_enabled(a) (0) |
522 | #define bio_integrity_clone(a, b, c, d) (0) | 522 | static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src, |
523 | gfp_t gfp_mask, struct bio_set *bs) | ||
524 | { | ||
525 | return 0; | ||
526 | } | ||
523 | #define bioset_integrity_free(a) do { } while (0) | 527 | #define bioset_integrity_free(a) do { } while (0) |
524 | #define bio_integrity_free(a, b) do { } while (0) | 528 | #define bio_integrity_free(a, b) do { } while (0) |
525 | #define bio_integrity_endio(a, b) do { } while (0) | 529 | #define bio_integrity_endio(a, b) do { } while (0) |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 9de31bc98c88..6d18f3531f18 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -21,8 +21,6 @@ | |||
21 | #define dev_to_part(device) container_of((device), struct hd_struct, __dev) | 21 | #define dev_to_part(device) container_of((device), struct hd_struct, __dev) |
22 | #define disk_to_dev(disk) (&(disk)->part0.__dev) | 22 | #define disk_to_dev(disk) (&(disk)->part0.__dev) |
23 | #define part_to_dev(part) (&((part)->__dev)) | 23 | #define part_to_dev(part) (&((part)->__dev)) |
24 | #define alias_name(disk) ((disk)->alias ? (disk)->alias : \ | ||
25 | (disk)->disk_name) | ||
26 | 24 | ||
27 | extern struct device_type part_type; | 25 | extern struct device_type part_type; |
28 | extern struct kobject *block_depr; | 26 | extern struct kobject *block_depr; |
@@ -60,7 +58,6 @@ enum { | |||
60 | 58 | ||
61 | #define DISK_MAX_PARTS 256 | 59 | #define DISK_MAX_PARTS 256 |
62 | #define DISK_NAME_LEN 32 | 60 | #define DISK_NAME_LEN 32 |
63 | #define ALIAS_LEN 256 | ||
64 | 61 | ||
65 | #include <linux/major.h> | 62 | #include <linux/major.h> |
66 | #include <linux/device.h> | 63 | #include <linux/device.h> |
@@ -166,7 +163,6 @@ struct gendisk { | |||
166 | * disks that can't be partitioned. */ | 163 | * disks that can't be partitioned. */ |
167 | 164 | ||
168 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ | 165 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
169 | char *alias; /* alias name of disk */ | ||
170 | char *(*devnode)(struct gendisk *gd, mode_t *mode); | 166 | char *(*devnode)(struct gendisk *gd, mode_t *mode); |
171 | 167 | ||
172 | unsigned int events; /* supported events */ | 168 | unsigned int events; /* supported events */ |
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index a0860640378d..71034f41a2ba 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -724,6 +724,14 @@ void bdi_destroy(struct backing_dev_info *bdi) | |||
724 | 724 | ||
725 | bdi_unregister(bdi); | 725 | bdi_unregister(bdi); |
726 | 726 | ||
727 | /* | ||
728 | * If bdi_unregister() had already been called earlier, the | ||
729 | * wakeup_timer could still be armed because bdi_prune_sb() | ||
730 | * can race with the bdi_wakeup_thread_delayed() calls from | ||
731 | * __mark_inode_dirty(). | ||
732 | */ | ||
733 | del_timer_sync(&bdi->wb.wakeup_timer); | ||
734 | |||
727 | for (i = 0; i < NR_BDI_STAT_ITEMS; i++) | 735 | for (i = 0; i < NR_BDI_STAT_ITEMS; i++) |
728 | percpu_counter_destroy(&bdi->bdi_stat[i]); | 736 | percpu_counter_destroy(&bdi->bdi_stat[i]); |
729 | 737 | ||