aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-04-17 20:44:17 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-17 20:44:17 -0400
commitde542925fbf179fb4b39bab2c3235b4525f96794 (patch)
tree11b0f8baf2469c52405ab9be9f82c414c3de64b4
parent5fdfd42e3a69e8a686fcfb6381616464945471e8 (diff)
parentb78b6af66a5fbaf17d7e6bfc32384df5e34408c8 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/stable-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/stable-2.6: [PATCH] shmat: stop mprotect from giving write permission to a readonly attachment (CVE-2006-1524) [PATCH] cciss: bug fix for crash when running hpacucli [PATCH] ext3: Fix missed mutex unlock [PATCH] Fix block device symlink name [PATCH] isd200: limit to BLK_DEV_IDE
-rw-r--r--drivers/block/cciss.c96
-rw-r--r--drivers/usb/storage/Kconfig3
-rw-r--r--fs/ext3/resize.c1
-rw-r--r--fs/partitions/check.c5
-rw-r--r--ipc/shm.c2
5 files changed, 59 insertions, 48 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 1b0fd31c57c3..1319d8f20640 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1180,6 +1180,53 @@ static int revalidate_allvol(ctlr_info_t *host)
1180 return 0; 1180 return 0;
1181} 1181}
1182 1182
1183static inline void complete_buffers(struct bio *bio, int status)
1184{
1185 while (bio) {
1186 struct bio *xbh = bio->bi_next;
1187 int nr_sectors = bio_sectors(bio);
1188
1189 bio->bi_next = NULL;
1190 blk_finished_io(len);
1191 bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO);
1192 bio = xbh;
1193 }
1194
1195}
1196
1197static void cciss_softirq_done(struct request *rq)
1198{
1199 CommandList_struct *cmd = rq->completion_data;
1200 ctlr_info_t *h = hba[cmd->ctlr];
1201 unsigned long flags;
1202 u64bit temp64;
1203 int i, ddir;
1204
1205 if (cmd->Request.Type.Direction == XFER_READ)
1206 ddir = PCI_DMA_FROMDEVICE;
1207 else
1208 ddir = PCI_DMA_TODEVICE;
1209
1210 /* command did not need to be retried */
1211 /* unmap the DMA mapping for all the scatter gather elements */
1212 for(i=0; i<cmd->Header.SGList; i++) {
1213 temp64.val32.lower = cmd->SG[i].Addr.lower;
1214 temp64.val32.upper = cmd->SG[i].Addr.upper;
1215 pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir);
1216 }
1217
1218 complete_buffers(rq->bio, rq->errors);
1219
1220#ifdef CCISS_DEBUG
1221 printk("Done with %p\n", rq);
1222#endif /* CCISS_DEBUG */
1223
1224 spin_lock_irqsave(&h->lock, flags);
1225 end_that_request_last(rq, rq->errors);
1226 cmd_free(h, cmd,1);
1227 spin_unlock_irqrestore(&h->lock, flags);
1228}
1229
1183/* This function will check the usage_count of the drive to be updated/added. 1230/* This function will check the usage_count of the drive to be updated/added.
1184 * If the usage_count is zero then the drive information will be updated and 1231 * If the usage_count is zero then the drive information will be updated and
1185 * the disk will be re-registered with the kernel. If not then it will be 1232 * the disk will be re-registered with the kernel. If not then it will be
@@ -1248,6 +1295,8 @@ static void cciss_update_drive_info(int ctlr, int drv_index)
1248 1295
1249 blk_queue_max_sectors(disk->queue, 512); 1296 blk_queue_max_sectors(disk->queue, 512);
1250 1297
1298 blk_queue_softirq_done(disk->queue, cciss_softirq_done);
1299
1251 disk->queue->queuedata = hba[ctlr]; 1300 disk->queue->queuedata = hba[ctlr];
1252 1301
1253 blk_queue_hardsect_size(disk->queue, 1302 blk_queue_hardsect_size(disk->queue,
@@ -2147,20 +2196,6 @@ static void start_io( ctlr_info_t *h)
2147 addQ (&(h->cmpQ), c); 2196 addQ (&(h->cmpQ), c);
2148 } 2197 }
2149} 2198}
2150
2151static inline void complete_buffers(struct bio *bio, int status)
2152{
2153 while (bio) {
2154 struct bio *xbh = bio->bi_next;
2155 int nr_sectors = bio_sectors(bio);
2156
2157 bio->bi_next = NULL;
2158 blk_finished_io(len);
2159 bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO);
2160 bio = xbh;
2161 }
2162
2163}
2164/* Assumes that CCISS_LOCK(h->ctlr) is held. */ 2199/* Assumes that CCISS_LOCK(h->ctlr) is held. */
2165/* Zeros out the error record and then resends the command back */ 2200/* Zeros out the error record and then resends the command back */
2166/* to the controller */ 2201/* to the controller */
@@ -2178,39 +2213,6 @@ static inline void resend_cciss_cmd( ctlr_info_t *h, CommandList_struct *c)
2178 start_io(h); 2213 start_io(h);
2179} 2214}
2180 2215
2181static void cciss_softirq_done(struct request *rq)
2182{
2183 CommandList_struct *cmd = rq->completion_data;
2184 ctlr_info_t *h = hba[cmd->ctlr];
2185 unsigned long flags;
2186 u64bit temp64;
2187 int i, ddir;
2188
2189 if (cmd->Request.Type.Direction == XFER_READ)
2190 ddir = PCI_DMA_FROMDEVICE;
2191 else
2192 ddir = PCI_DMA_TODEVICE;
2193
2194 /* command did not need to be retried */
2195 /* unmap the DMA mapping for all the scatter gather elements */
2196 for(i=0; i<cmd->Header.SGList; i++) {
2197 temp64.val32.lower = cmd->SG[i].Addr.lower;
2198 temp64.val32.upper = cmd->SG[i].Addr.upper;
2199 pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir);
2200 }
2201
2202 complete_buffers(rq->bio, rq->errors);
2203
2204#ifdef CCISS_DEBUG
2205 printk("Done with %p\n", rq);
2206#endif /* CCISS_DEBUG */
2207
2208 spin_lock_irqsave(&h->lock, flags);
2209 end_that_request_last(rq, rq->errors);
2210 cmd_free(h, cmd,1);
2211 spin_unlock_irqrestore(&h->lock, flags);
2212}
2213
2214/* checks the status of the job and calls complete buffers to mark all 2216/* checks the status of the job and calls complete buffers to mark all
2215 * buffers for the completed job. Note that this function does not need 2217 * buffers for the completed job. Note that this function does not need
2216 * to hold the hba/queue lock. 2218 * to hold the hba/queue lock.
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
index 92be101feba7..be9eec225743 100644
--- a/drivers/usb/storage/Kconfig
+++ b/drivers/usb/storage/Kconfig
@@ -48,7 +48,8 @@ config USB_STORAGE_FREECOM
48 48
49config USB_STORAGE_ISD200 49config USB_STORAGE_ISD200
50 bool "ISD-200 USB/ATA Bridge support" 50 bool "ISD-200 USB/ATA Bridge support"
51 depends on USB_STORAGE && BLK_DEV_IDE 51 depends on USB_STORAGE
52 depends on BLK_DEV_IDE=y || BLK_DEV_IDE=USB_STORAGE
52 ---help--- 53 ---help---
53 Say Y here if you want to use USB Mass Store devices based 54 Say Y here if you want to use USB Mass Store devices based
54 on the In-Systems Design ISD-200 USB/ATA bridge. 55 on the In-Systems Design ISD-200 USB/ATA bridge.
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c
index 14f5f6ea3e72..c5ffa8523968 100644
--- a/fs/ext3/resize.c
+++ b/fs/ext3/resize.c
@@ -767,6 +767,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
767 if (input->group != sbi->s_groups_count) { 767 if (input->group != sbi->s_groups_count) {
768 ext3_warning(sb, __FUNCTION__, 768 ext3_warning(sb, __FUNCTION__,
769 "multiple resizers run on filesystem!"); 769 "multiple resizers run on filesystem!");
770 unlock_super(sb);
770 err = -EBUSY; 771 err = -EBUSY;
771 goto exit_journal; 772 goto exit_journal;
772 } 773 }
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index f3b6af071722..45ae7dd3c650 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -372,6 +372,7 @@ static char *make_block_name(struct gendisk *disk)
372 char *name; 372 char *name;
373 static char *block_str = "block:"; 373 static char *block_str = "block:";
374 int size; 374 int size;
375 char *s;
375 376
376 size = strlen(block_str) + strlen(disk->disk_name) + 1; 377 size = strlen(block_str) + strlen(disk->disk_name) + 1;
377 name = kmalloc(size, GFP_KERNEL); 378 name = kmalloc(size, GFP_KERNEL);
@@ -379,6 +380,10 @@ static char *make_block_name(struct gendisk *disk)
379 return NULL; 380 return NULL;
380 strcpy(name, block_str); 381 strcpy(name, block_str);
381 strcat(name, disk->disk_name); 382 strcat(name, disk->disk_name);
383 /* ewww... some of these buggers have / in name... */
384 s = strchr(name, '/');
385 if (s)
386 *s = '!';
382 return name; 387 return name;
383} 388}
384 389
diff --git a/ipc/shm.c b/ipc/shm.c
index 6b0c9af5bbf7..1c2faf62bc73 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -162,6 +162,8 @@ static int shm_mmap(struct file * file, struct vm_area_struct * vma)
162 ret = shmem_mmap(file, vma); 162 ret = shmem_mmap(file, vma);
163 if (ret == 0) { 163 if (ret == 0) {
164 vma->vm_ops = &shm_vm_ops; 164 vma->vm_ops = &shm_vm_ops;
165 if (!(vma->vm_flags & VM_WRITE))
166 vma->vm_flags &= ~VM_MAYWRITE;
165 shm_inc(file->f_dentry->d_inode->i_ino); 167 shm_inc(file->f_dentry->d_inode->i_ino);
166 } 168 }
167 169