From eb97b73d75d5c9af7c78c05106de9e3fdc4455ab Mon Sep 17 00:00:00 2001 From: Coywolf Qi Hunt Date: Wed, 16 Nov 2005 15:27:24 +0100 Subject: [BLOCK] new block/ directory comment tidy Some leftover comments referring to drivers/block that are now block/. They don't add any information we don't already have, so kill them. Signed-off-by: Coywolf Qi Hunt Signed-off-by: Jens Axboe diff --git a/block/as-iosched.c b/block/as-iosched.c index a78e160..fbe0501 100644 --- a/block/as-iosched.c +++ b/block/as-iosched.c @@ -1,6 +1,4 @@ /* - * linux/drivers/block/as-iosched.c - * * Anticipatory & deadline i/o scheduler. * * Copyright (C) 2002 Jens Axboe diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 2b64f58..ee0bb41 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -1,6 +1,4 @@ /* - * linux/drivers/block/cfq-iosched.c - * * CFQ, or complete fairness queueing, disk scheduler. * * Based on ideas from a previously unfinished io diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c index 7929471..9cbec09 100644 --- a/block/deadline-iosched.c +++ b/block/deadline-iosched.c @@ -1,6 +1,4 @@ /* - * linux/drivers/block/deadline-iosched.c - * * Deadline i/o scheduler. * * Copyright (C) 2002 Jens Axboe diff --git a/block/elevator.c b/block/elevator.c index e4c5882..6c3fc8a 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -1,6 +1,4 @@ /* - * linux/drivers/block/elevator.c - * * Block device elevator/IO-scheduler. * * Copyright (C) 2000 Andrea Arcangeli SuSE diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 5f52e30..99c9ca6 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -1,6 +1,4 @@ /* - * linux/drivers/block/ll_rw_blk.c - * * Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1994, Karl Keyte: Added support for disk statistics * Elevator latency, (C) 2000 Andrea Arcangeli SuSE -- cgit v0.10.2 From 7f0d50391adf371a0e66da0a1a44ba5cc6744ee8 Mon Sep 17 00:00:00 2001 From: mikem Date: Fri, 18 Nov 2005 22:00:17 +0100 Subject: [PATCH 1/3] cciss: bug fix for hpacucli This patch fixes a bug that breaks hpacucli, a command line interface for the HP Array Config Utility. Without this fix the utility will not detect any controllers in the system. I thought I had already fixed this, but I guess not. Thanks to all who reported the issue. Please consider this this inclusion. Signed-off-by: Mike Miller Signed-off-by: Jens Axboe diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h index 424d5e6..6e27f42 100644 --- a/include/linux/cciss_ioctl.h +++ b/include/linux/cciss_ioctl.h @@ -10,8 +10,8 @@ typedef struct _cciss_pci_info_struct { unsigned char bus; - unsigned short domain; unsigned char dev_fn; + unsigned short domain; __u32 board_id; } cciss_pci_info_struct; -- cgit v0.10.2 From 15534d3803993345d8db32246ec329d8f83502e1 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 18 Nov 2005 22:02:44 +0100 Subject: [PATCH 2/3] cciss: bug fix for BIG_PASS_THRU Applications using CCISS_BIG_PASSTHRU complained that the data written was zeros. The problem is that the buffer is being cleared after the user copy, unless the user copy has failed... Correct that logic. Signed-off-by: Mike Miller Signed-off-by: Jens Axboe diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index e239a6c..33f8341 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -1017,10 +1017,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, status = -ENOMEM; goto cleanup1; } - if (ioc->Request.Type.Direction == XFER_WRITE && - copy_from_user(buff[sg_used], data_ptr, sz)) { + if (ioc->Request.Type.Direction == XFER_WRITE) { + if (copy_from_user(buff[sg_used], data_ptr, sz)) { status = -ENOMEM; - goto cleanup1; + goto cleanup1; + } } else { memset(buff[sg_used], 0, sz); } -- cgit v0.10.2 From 6f5a0f7c955d3567f800fa36f978758cb5b99aa2 Mon Sep 17 00:00:00 2001 From: mikem Date: Fri, 18 Nov 2005 22:05:36 +0100 Subject: [PATCH 3/3] cciss: add put_disk into cleanup routines Jeff Garzik pointed me to his code to see how to remove a disk from the system _properly_. Well, here it is... Every place we remove disks we are now testing before calling del_gendisk or blk_cleanup_queue and then call put_disk. Signed-off-by: Mike Miller Signed-off-by: Jens Axboe diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 33f8341..a9e33db 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -1139,8 +1139,15 @@ static int revalidate_allvol(ctlr_info_t *host) for(i=0; i< NWD; i++) { struct gendisk *disk = host->gendisk[i]; - if (disk->flags & GENHD_FL_UP) - del_gendisk(disk); + if (disk) { + request_queue_t *q = disk->queue; + + if (disk->flags & GENHD_FL_UP) + del_gendisk(disk); + if (q) + blk_cleanup_queue(q); + put_disk(disk); + } } /* @@ -1454,10 +1461,13 @@ static int deregister_disk(struct gendisk *disk, drive_info_struct *drv, * allows us to delete disk zero but keep the controller registered. */ if (h->gendisk[0] != disk){ - if (disk->flags & GENHD_FL_UP){ - blk_cleanup_queue(disk->queue); - del_gendisk(disk); - drv->queue = NULL; + if (disk) { + request_queue_t *q = disk->queue; + if (disk->flags & GENHD_FL_UP) + del_gendisk(disk); + if (q) + blk_cleanup_queue(q); + put_disk(disk); } } @@ -3226,9 +3236,14 @@ static void __devexit cciss_remove_one (struct pci_dev *pdev) /* remove it from the disk list */ for (j = 0; j < NWD; j++) { struct gendisk *disk = hba[i]->gendisk[j]; - if (disk->flags & GENHD_FL_UP) { - del_gendisk(disk); - blk_cleanup_queue(disk->queue); + if (disk) { + request_queue_t *q = disk->queue; + + if (disk->flags & GENHD_FL_UP) + del_gendisk(disk); + if (q) + blk_cleanup_queue(q); + put_disk(disk); } } -- cgit v0.10.2