GIT c2c6fa8e1ae907d677bcf4eb822edc640ef79fe8 git+ssh://master.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git#for-linus commit c2c6fa8e1ae907d677bcf4eb822edc640ef79fe8 Author: Jens Axboe Date: Fri Jan 27 10:53:18 2006 +0100 [LIBATA] FUA blacklist patch had a typo, should compare firmware in fw Thanks to Bart for spotting this. Signed-off-by: Jens Axboe commit 72c7b47d7abe05f8ed13224c947809f66b914f7f Author: Jens Axboe Date: Fri Jan 27 10:33:34 2006 +0100 [LIBATA] Blacklist a certain Maxtor revision for FUA support The drive id says it supports FUA, but it corrupts or discards FUA writes at will. Clearly a firmware bug. Signed-off-by: Jens Axboe commit dfcd77d16b5745fbfea7d5636f15fc80cc05fef8 Author: Tetsuo Takata Date: Wed Jan 25 11:12:40 2006 +0100 [SCSI] Remove host template ordered_flush variable After the recent overhaul of the block layer the variable "ordered_flush" is no longer used. Signed-off-by: Tetsuo Takata Signed-off-by: Jens Axboe commit 60481b12b8816d431308c3d974e341ab8c8c0bcf Author: Tetsuo Takata Date: Tue Jan 24 10:34:36 2006 +0100 [BLOCK] ll_rw_blk: fix setting of ->ordered on init This makes XFS barrier mounts succeed on my SCSI system. Signed-off-by: Tetsuo Takata Signed-off-by: Jens Axboe commit 248d5ca5ed5feb7f1a68d213c0ff89c604a97179 Author: Nate Diller Date: Tue Jan 24 10:09:14 2006 +0100 [BLOCK] elevator: allow default scheduler to potentially be modular Jens has decided that allowing the default scheduler to be a module is a bug, and should not be allowed under kconfig. However, I find that scenario useful for debugging, and wish for the kernel to be able to handle this situation without OOPSing, if I enable such an option in the .config directly. This patch dynamically checks for the presence of the compiled-in default, and falls back to no-op, emitting a suitable error message, when the default is not available Tested for a range of boot options on 2.6.16-rc1-mm2. Signed-off-by: Nate Diller Signed-off-by: Jens Axboe commit 5f00397644e01adfbebafb5d0ebc01eba522709d Author: Nate Diller Date: Tue Jan 24 10:07:58 2006 +0100 [BLOCK] elevator: default choice selection My previous default iosched patch did a poor job dealing with the 'elevator=' boot-time option. The old behavior falls back to the compiled-in default if the requested one is not registered at boot time. This patch dynamically evaluates which default to use, and emits a suitable error message when the requested scheduler is not available. It also does the 'as' -> 'anticipatory' conversion before elevator registration, which along with a modified registration function, allows it to correctly indicate which default scheduler is in use. Tested for a range of boot options on 2.6.16-rc1-mm2. Signed-off-by: Nate Diller Signed-off-by: Jens Axboe commit 53e86061b5bd4aece9bbb6b00b30720200596ecb Author: Jens Axboe Date: Tue Jan 17 11:09:27 2006 +0100 [BLOCK] ll_rw_blk: use preempt-disabling disk_stat_add() in completion It can legally be called with interrupts/preemption enabled. Signed-off-by: Jens Axboe commit 2cb2e147a6d20bffd1d6b7a79be7301560f751c3 Author: Jens Axboe Date: Tue Jan 17 09:04:32 2006 +0100 [BLOCK] ll_rw_blk: make max_sectors and max_hw_sectors unsigned ints IDE lba48 can support full 64k request size, which overflows the max_hw_sectors variable. Signed-off-by: Jens Axboe --- Signed-off-by: Andrew Morton --- block/elevator.c | 45 +++++++++++------------------------ block/ll_rw_blk.c | 5 ++- drivers/scsi/libata-scsi.c | 24 +++++++++++++++++- include/linux/blkdev.h | 6 ++-- include/scsi/scsi_host.h | 1 5 files changed, 44 insertions(+), 37 deletions(-) diff -puN block/elevator.c~git-block block/elevator.c --- devel/block/elevator.c~git-block 2006-01-28 14:54:13.000000000 -0800 +++ devel-akpm/block/elevator.c 2006-01-28 14:54:13.000000000 -0800 @@ -140,35 +140,16 @@ static int elevator_attach(request_queue static char chosen_elevator[16]; -static void elevator_setup_default(void) +static int __init elevator_setup(char *str) { - struct elevator_type *e; - - /* - * If default has not been set, use the compiled-in selection. - */ - if (!chosen_elevator[0]) - strcpy(chosen_elevator, CONFIG_DEFAULT_IOSCHED); - /* * Be backwards-compatible with previous kernels, so users * won't get the wrong elevator. */ - if (!strcmp(chosen_elevator, "as")) + if (!strcmp(str, "as")) strcpy(chosen_elevator, "anticipatory"); - - /* - * If the given scheduler is not available, fall back to the default - */ - if ((e = elevator_find(chosen_elevator))) - elevator_put(e); else - strcpy(chosen_elevator, CONFIG_DEFAULT_IOSCHED); -} - -static int __init elevator_setup(char *str) -{ - strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1); + strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1); return 0; } @@ -185,14 +166,16 @@ int elevator_init(request_queue_t *q, ch q->end_sector = 0; q->boundary_rq = NULL; - elevator_setup_default(); + if (name && !(e = elevator_get(name))) + return -EINVAL; - if (!name) - name = chosen_elevator; + if (!e && *chosen_elevator && !(e = elevator_get(chosen_elevator))) + printk("I/O scheduler %s not found\n", chosen_elevator); - e = elevator_get(name); - if (!e) - return -EINVAL; + if (!e && !(e = elevator_get(CONFIG_DEFAULT_IOSCHED))) { + printk("Default I/O scheduler not found, using no-op\n"); + e = elevator_get("noop"); + } eq = kmalloc(sizeof(struct elevator_queue), GFP_KERNEL); if (!eq) { @@ -673,8 +656,10 @@ int elv_register(struct elevator_type *e spin_unlock_irq(&elv_list_lock); printk(KERN_INFO "io scheduler %s registered", e->elevator_name); - if (!strcmp(e->elevator_name, chosen_elevator)) - printk(" (default)"); + if (!strcmp(e->elevator_name, chosen_elevator) || + (!*chosen_elevator && + !strcmp(e->elevator_name, CONFIG_DEFAULT_IOSCHED))) + printk(" (default)"); printk("\n"); return 0; } diff -puN block/ll_rw_blk.c~git-block block/ll_rw_blk.c --- devel/block/ll_rw_blk.c~git-block 2006-01-28 14:54:13.000000000 -0800 +++ devel-akpm/block/ll_rw_blk.c 2006-01-28 14:54:13.000000000 -0800 @@ -333,6 +333,7 @@ int blk_queue_ordered(request_queue_t *q return -EINVAL; } + q->ordered = ordered; q->next_ordered = ordered; q->prepare_flush_fn = prepare_flush_fn; @@ -663,7 +664,7 @@ EXPORT_SYMBOL(blk_queue_bounce_limit); * Enables a low level driver to set an upper limit on the size of * received requests. **/ -void blk_queue_max_sectors(request_queue_t *q, unsigned short max_sectors) +void blk_queue_max_sectors(request_queue_t *q, unsigned int max_sectors) { if ((max_sectors << 9) < PAGE_CACHE_SIZE) { max_sectors = 1 << (PAGE_CACHE_SHIFT - 9); @@ -3197,7 +3198,7 @@ static int __end_that_request_first(stru if (blk_fs_request(req) && req->rq_disk) { const int rw = rq_data_dir(req); - __disk_stat_add(req->rq_disk, sectors[rw], nr_bytes >> 9); + disk_stat_add(req->rq_disk, sectors[rw], nr_bytes >> 9); } total_bytes = bio_nbytes = 0; diff -puN drivers/scsi/libata-scsi.c~git-block drivers/scsi/libata-scsi.c --- devel/drivers/scsi/libata-scsi.c~git-block 2006-01-28 14:54:13.000000000 -0800 +++ devel-akpm/drivers/scsi/libata-scsi.c 2006-01-28 15:13:28.000000000 -0800 @@ -1700,6 +1700,28 @@ static unsigned int ata_msense_rw_recove return sizeof(def_rw_recovery_mpage); } +/* + * We can turn this into a real blacklist if it's needed, for now just + * blacklist any Maxtor BANC1G10 revision firmware + */ +static int ata_dev_supports_fua(u16 *id) +{ + unsigned char model[41], fw[9]; + + if (!ata_id_has_fua(id)) + return 0; + + ata_dev_id_string(id, model, ATA_ID_PROD_OFS, sizeof(model)); + ata_dev_id_string(id, fw, ATA_ID_FW_REV_OFS, sizeof(fw)); + + if (strncmp(model, "Maxtor", 6)) + return 1; + if (strncmp(fw, "BANC1G10", 8)) + return 1; + + return 0; /* blacklisted */ +} + /** * ata_scsiop_mode_sense - Simulate MODE SENSE 6, 10 commands * @args: device IDENTIFY data / SCSI command of interest. @@ -1797,7 +1819,7 @@ unsigned int ata_scsiop_mode_sense(struc return 0; dpofua = 0; - if (ata_id_has_fua(args->id) && dev->flags & ATA_DFLAG_LBA48 && + if (ata_dev_supports_fua(args->id) && dev->flags & ATA_DFLAG_LBA48 && (!(dev->flags & ATA_DFLAG_PIO) || dev->multi_count)) dpofua = 1 << 4; diff -puN include/linux/blkdev.h~git-block include/linux/blkdev.h --- devel/include/linux/blkdev.h~git-block 2006-01-28 14:54:13.000000000 -0800 +++ devel-akpm/include/linux/blkdev.h 2006-01-28 14:54:13.000000000 -0800 @@ -393,8 +393,8 @@ struct request_queue unsigned int nr_congestion_off; unsigned int nr_batching; - unsigned short max_sectors; - unsigned short max_hw_sectors; + unsigned int max_sectors; + unsigned int max_hw_sectors; unsigned short max_phys_segments; unsigned short max_hw_segments; unsigned short hardsect_size; @@ -700,7 +700,7 @@ extern request_queue_t *blk_init_queue(r extern void blk_cleanup_queue(request_queue_t *); extern void blk_queue_make_request(request_queue_t *, make_request_fn *); extern void blk_queue_bounce_limit(request_queue_t *, u64); -extern void blk_queue_max_sectors(request_queue_t *, unsigned short); +extern void blk_queue_max_sectors(request_queue_t *, unsigned int); extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short); extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short); extern void blk_queue_max_segment_size(request_queue_t *, unsigned int); diff -puN include/scsi/scsi_host.h~git-block include/scsi/scsi_host.h --- devel/include/scsi/scsi_host.h~git-block 2006-01-28 14:54:13.000000000 -0800 +++ devel-akpm/include/scsi/scsi_host.h 2006-01-28 14:54:13.000000000 -0800 @@ -554,7 +554,6 @@ struct Scsi_Host { /* * ordered write support */ - unsigned ordered_flush:1; unsigned ordered_tag:1; /* _