Revision 1: Use %llu not %Lu in sscanf/printf format strings. Signed-Off-By: Alasdair G Kergon Revision 2: Handle writes to a snapshot-origin device that has been extended since the snapshot was taken. [submitted to -mm] Revision 3: More snapshot metadata reading into separate function, in preparation for calling it from elsewhere. Signed-Off-By: Alasdair G Kergon Revision 4: Move snapshot metadata loading to happen when table is created instead of when device is resumed. Origin writes don't trigger exceptions until snapshot table becomes active (when resume() is called on snapshot). NB This patch may break some existing LVM2 and EVMS operations. Revision 5: dm multipath will report barriers as not supported with this patch. Signed-off-by: Lars Marowsky-Bree [submitted to -mm] Revision 6: Make the sense data available in the bio end_io path on request. Signed-off-by: Lars Marowsky-Bree Signed-off-by: Jens Axboe Revision 7: Use the sense data in the dm-mpath hardware handlers. Signed-off-by: Lars Marowsky-Bree Revision 8: DM multipath error messages were beyond useless. From: Lars Marowsky-Bree Revision 9: Invoke generic scsi error decoder if no alternative handler was specified. This is safe as dm_scsi_err_handler() will only act on SCSI errors with valid sense data. Signed-Off-By: Alasdair G Kergon Signed-off-by: Lars Marowsky-Bree Revision 10: Flakey. Revision 11: Set the target's split_io field when building a dm-mirror device so incoming bio's won't span the mirror's internal regions. From: Kevin Corry [upstream] Revision 12: Fix patch 11 (rh.region_size). [upstream] Revision 13: The multipath destructor must flush its workqueue. Otherwise items that reference the destroyed object could remain. [submitted to -mm] Revision 14: To avoid deadlock when suspending a multipath device when all its paths have failed, stop queueing any I/O that is about to fail *before* calling freeze_bdev instead of after. To facilitate this without adding a new 'resume' function corresponding to 'presuspend', instead of setting a multipath 'suspended' flag which must always be reset if an error occurs during the process, save the previous queueing state and leave userspace to restore if it wishes. [submitted to -mm] Revision 15: Prevent more than one priority group initialisation function from being outstanding at once. Otherwise the completion functions interfere with each other. Also, reloading the table could reference a freed pointer. Only reset queue_io in pg_init_complete if another pg_init isn't required. Skip process_queued_ios if the queue is empty so that we only trigger a pg_init if there's I/O. [submitted to -mm] Revision 16: mm kgdb Revision 17: Tidy-ups incl. using dm_suspended(). Revision 18: Remove bdget_disk from __set_size: we've already got it. Revision 19: Change dm_table_pre/postsuspend_targets to accept NULL. Revision 20: Tidy-up to merge with 17: Change 'error' to 'r' in dm_suspend. Revision 21: Fix dm_swap_table __bind error case - missing unlock! [submitted to -mm but without dm_suspended change] Revision 22: Rename md->lock to md->io_lock. Revision 23: Introduce suspend_lock to prevent concurrent instances of dm_swap_table, dm_suspend and dm_resume. Revision 24: Add to patch 23: missing lock release Revision 25: dm_suspend tidying Revision 26: Always use DMF_SUSPENDED instead of DMF_BLOCK_IO to detect suspension. More dm_suspend tidying. Revision 27: DMF_FS_LOCKED is no longer needed - remove it. Never call lock/unlock_fs with io_lock held. Revision 28: avoid harmless pgpath uninitialised compiler message [submitted to -mm with 15] Revision 29: Tidy error to r in lock_fs. Revision 30: suspend_lock doesn't need to be rw Revision 31: If anything is waiting on a device's table when the device is removed, we must first wake it up so it will release its reference. Otherwise the table's reference count will not drop to zero and the table will not get removed. From: "goggin, edward" Signed-Off-By: Alasdair G Kergon Revision 32: reverted Revision 33: reverted Revision 34: This patch removes an unused #define. From: Andrew Stribblehill Revision 35: When creating a multipath device with the queue_if_no_path option set, while the queue_if_no_path variable is correctly set to 1, the saved_queue_if_no_path gets set to 0. When the device is subsequently made live (resumed), the saved value (0) always overwrites the live value (1) so the option always gets turned off. The fix adds a parameter to the queue_if_no_path() function to indicate whether the previous value should be preserved or not - if not, as when the device is being set up, the saved value is set to the new value (1).