Revision 1: mm1 Revision 2: -mm2 Revision 3: Experimental version of the snapshot and mirror targets for 2.6. Revision 4: Take a space out of a slab name. Revision 5: take note of the tio->io field before freeing tio. Revision 6: A blk_put_queue() was missing on the error path of alloc_dev(). Revision 7: whitespace Revision 8: Set the split io size for the snapshot target. Revision 9: Enable the new code that checks that an exception isn't already being copied. Revision 10: Recheck that the exception hasn't entered the pending table by another thread. Revision 11: Set the ti->split_io field for the origin to the smallest chunk-size of its snapshots. This is done each time the origin is resumed, since new snapshots (with smaller chunk-sizes) could have been added. [Kevin Corry] Revision 12: In the "else" section of __clone_and_map(), we're splitting a page from the bio into two pages and mapping each part separately. Therefore, we need another tio structure to track the second part of the page. [Kevin Corry] Revision 13: In order to properly build snapshot as its own kernel module, dm-snapshot.c and dm-snapshot.h must be renamed to dm-snap.c and dm-snap.h. The dm_vcalloc function must also be exported from dm-table.c so the snapshot module can find it. [Kevin Corry] Revision 14: Export dm_io_async_bvec so dm-raid1 can find it when built as a module. Revision 15: dm-raid1.c:recover() was assuming that DEFAULT_MIRROR was 0. Revision 16: dm-raid1.c: correct region_shift calculation, ffs defines the least-significant bit as 1, not 0. Revision 17: Use s->chunk_size in snapshot ctr rather than the (modified) chunk_size var. Revision 18: Use ffs to calculate chunk_shift. Revision 19: Import the 2.4 multipath code (no porting as yet). Revision 20: Mainly looking at the null selector. Revision 21: Change multipath daemon to use dm-daemon.c. Declare a jiffy_t type in dm.h. Let daemon work functions return a sleep duration hint (interface change only, hint not acted upon yet). Revision 22: Knock out the underscore prefix to static fns. Revision 23: Minor pottering Revision 24: mpath porting Revision 25: Delete null selector. Add a round robin selector to dm-path-selector.c Revision 26: Change dm-daemon.c to use completions rather than semaphores. [Mike Christie] Revision 27: Add in the BIO_RW_FAILFAST flag to the multipath target. [Mike Christie] Revision 28: Bug fixes Revision 29: Change the multipath target interface yet again. Revision 30: List targets ioctl. [Patrick Caulfield] Revision 31: background path testing Revision 32: mpath bug fixes Revision 33: Persistent log for mirroring. Compiles but not run yet. Revision 34: When adding a new ioctl (DM_LIST_VERSIONS), the MINOR version number of the ioctl interface should be incremented. Revision 35: No need to recheck the condition when promoting the write lock in multipath_map(). Revision 36: Change m->path_lock from a rw semaphore to spinlock, since it sometimes needs to be locked from irq context. NOTE: test_path() is safe to be called from within a spinlock since it uses down_trylock() rather than down(). Revision 37: Fix broken parameter count checking. [AJ Lewis] Revision 38: Correct typo in dm-log.c:disk_read() [AJ Lewis] Revision 39: For some reason dm_table_create() was allocating GFP_NOIO rather than GFP_KERNEL. Revision 40: multipath_endio(): the call to __resubmit_io() wasn't within the lock. Renamed __resubmit_io() -> __remap_io() Lifted the submit code into multipath_endio() after a successful remap. [Mike Christie] Revision 41: in __bind(), set the md->map _after_ the zero size dev check. [Christophe Saout] Revision 42: Add sanity check to dm_table_add_target() against zero length targets. [Christophe Saout] Revision 43: We can get rid of dm_deferred_io in dm.c. We are doing it elsewhere, others are doing it, so let's also do it. We can save a call to kmalloc (which can even fail). The bio->bi_next field can be used by us as long as we own it, it is set NULL before it is passed down to the next request queue. [Chripstophe Saout] Revision 44: Store deferred ios in a queue so that we preserve ordering and hence don't break write barriers. dm_request is now blocked while deferred ios are resubmitted. [Christophe Saout] Revision 45: Remove redundant spin lock in dec_pending() Revision 46: refridgerator() is indeed needed in dm-daemon.c. [Christophe Saout] Revision 47: This is the dm-crypt target. It uses cryptoapi to achive the same goal as cryptoloop. It uses mempools to ensure not to ever run out of memory and can split large IOs into smaller ones under memory pressure. Tested by some people, also works on a swap device. [Christophe Saout] Revision 48: Coding style changes using suggestions from LKML, no functionality changes. [Christophe Saout] Revision 49: simplify crypt_decode_key using simple_strotul as suggested by Andrew Morton [Christophe Saout] Revision 50: Increase throughput by telling the VM to not be too eager trying to allocate memory and possibly start swapping or flushing just because we need to allocate temporary buffers by dropping PF_MEMALLOC. We've got an emergency pool via mempool for this. [Christophe Saout] Revision 51: Split out the IV generation function so that we can add other ones in the future. The cryptoloop compatible one is too predictable. The -cbc cipher suffix is therefore changed to -plain. [Christophe Saout] Revision 52: o Don't free incomplete pages in crypt_free_buffer_pages o Make sure every encountered error gets seen. o Fix hard to trigger bug in the read path where bi_next was not cleared. [Christophe Saout] Revision 53: Small annotation improvements... [Christophe Saout] Revision 54: Replace problematic bi_idx usage in crypt_free_buffer_pages with a bi_vcnt and bi_size based solution until issues in the kernel code are sorted out. [Christophe Saout] Revision 55: here is a small and stupid bugfix for the flakey target. :) A down interval of one second didn't work. [Christophe Saout] Revision 56: Remove the failure target. Revision 57: Fix a bug in the multipath_map() logic meant that a new path was being chosen for every io. [Mike Christie] Revision 58: dm-log.c:disk_log() was freeing the log by calling core_dtr(), then using it. [AJ Lewis] Revision 59: Add a suspend method to the log that flushes to disk, in case the mirror has been recovering without any io. Revision 60: Make log->disk_header 1 sector in size rather than the actual size of the struct, since we can't read less than a sector. Revision 61: When doing multiregion writes in dm-io.c the dpages struct wasn't being rewound for each region. Revision 62: With 32 bit sector_t the block device size _in bytes_ is also cut to 32 bit in __set_size when the block device is mount (a filesystem mounted). The argument should be cast to loff_t before expanding the sector count to a byte count and calling i_size_write. [Christophe Saout] Revision 63: Misc snapshot updates: o Minumum hash size of 64 instead of setting hash size to 64 if the calculated size would be smaller than 1. o Only use list_entry if we are working on a list. o Check for drop_snapshot function before calling it (transient snapshots don't have one). o Use correct size prefix in status sprintf for chunk size. o Use C99 initializers. [Christophe Saout] Revision 64: Lift the bio_list code from dm-raid1.c into dm-bio-list.h [Christophe Saout] Revision 65: Modify dm.c, dm-raid1.c, dm-snap.c and dm-crypt.c to use the functions in dm-bio-list.h. [Christophe Saout] Revision 66: path->fail_count needs to be initialized to non-zero, or a failed path will never actually be failed. Set to 1 for now, but this number can be increased if we don't want to fail the path on the very first I/O error. [Kevin Corry] Revision 67: Make a #define for the minimum-io value. [Kevin Corry] Revision 68: We can't depend on the test_bio being the same every time it is submitted. Need to reset some of the fields in the bio each time. [Kevin Corry] Revision 69: Add a pointer from the priority-group back to the multipath context. [Kevin Corry] Revision 70: Change the failed_ios list in the multipath structure from a stack to a queue using the new bio_list services. [Kevin Corry] Revision 71: In test_path, instead of driving the test I/O, queue it on a list. When all test I/Os have been queued, they can then be driven down without having to hold the path_lock. [Kevin Corry] Revision 72: m->path_lock needs to be locked with spin_lock_irqsave() and unlocked with spin_lock_irqrestore(). [Kevin Corry] Revision 73: If a test bio completes successfully and the path is currently invalid, reactivate the path. [Kevin Corry] Revision 74: Add the number of priority groups to the dm-multipath constructor string. This should make parsing the string a bit simpler. [Kevin Corry] Revision 75: Add code for the multipath_status() routine. The table string format is identical to the constructor string format. test_interval num_groups [priority selector-name num_paths num_selector_args [path_dev [selector_args]* ]+ ]+ The info string format is: num_groups [num_paths num_selector_args [path_dev A|F fail_count fail_total [selector_args]* ]+ ]+ where "A" means the path is active and "F" means the path has failed, fail_count is the number of I/O errors remaining before the path fails, and fail_total is the number of times the path has failed. Obviously the table string must match the constructor string, but the info string can be modified if we'd like to add more information. This format should provide a good starting point. [Kevin Corry] Revision 76: Remove the left-over status code at the end of dm-mpath.c. [Kevin Corry] Revision 77: dm-deamon now take note of the timeout hint returned from the work function. [Kevn Corry] Revision 78: When a bio is submitted to the block-layer, several of the fields in that bio will have changed by the time it completes. In particular, the bi_sector field will be different, the bi_size field will be zero, and the bi_bdev and bi_idx fields may have changed as well. This creates a problem for some of the Device-Mapper modules (like dm-multipath) that may want to redrive a bio. Save the necessary bio fields in the target_io structure just before calling generic_make_request(), and restore those bio fields just before calling the target's end_io() routine. This ensures that the target module sees the bio exactly as it was following the map() routine. [Kevin Corry] Revision 79: Get event notification working in multipath. Revision 80: Add in the qlogic drivers for 2.6.0 from http://sourceforge.net/projects/linux-qla2xxx/ Revision 81: I just noticed that bio_clone copies the BIO_SEG_VALID bit from the original bio when it was set. When we modify bi_idx or bi_vcnt afterwards the segment counts are invalid and the bit must be dropped (though it is fairly unlikely that it has already been set). [Christophe Saout] Revision 82: Copy the restrictions from the request queue into a temporary local variable and use combine_restrictions_low() instead of duplicating the code. [Christoph Saout] Revision 83: Move the sync count from the mirror set to the log. Newly synced regions weren't being marked clean. [AJ Lewis] Revision 84: Lift min_not_zero to dm.h Revision 85: Change dm-mpath.c:do_work() return a wakeup hint. Revision 86: path->test_sector is unused. Remove it. [Kevin Corry] Revision 87: Remove unnecessary log messages. [Kevin Corry] Revision 88: dm-ioctl-v4.c: No need to check the parameters for DM_LIST_VERSIONS_CMD Revision 89: drop HZ back to 100 (for qemu) Revision 90: A huge patch, this started out as Kevin Corrys patch to merge the valid/invalid path lists. But I kept seeing things I wanted to change. Use with care. Revision 91: Defer erroring an io until we know that all the paths have been tested *since* the last path failed. Large patch because some functions moved around.