Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-5.8/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm into master

Pull device mapper fix from Mike Snitzer:
"A stable fix for DM integrity target's integrity recalculation that
gets skipped when resuming a device. This is a fix for a previous
stable@ fix"

* tag 'for-5.8/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm integrity: fix integrity recalculation that is improperly skipped

+20 -2
+2 -2
drivers/md/dm-integrity.c
··· 2420 2420 unsigned prev_free_sectors; 2421 2421 2422 2422 /* the following test is not needed, but it tests the replay code */ 2423 - if (unlikely(dm_suspended(ic->ti)) && !ic->meta_dev) 2423 + if (unlikely(dm_post_suspending(ic->ti)) && !ic->meta_dev) 2424 2424 return; 2425 2425 2426 2426 spin_lock_irq(&ic->endio_wait.lock); ··· 2481 2481 2482 2482 next_chunk: 2483 2483 2484 - if (unlikely(dm_suspended(ic->ti))) 2484 + if (unlikely(dm_post_suspending(ic->ti))) 2485 2485 goto unlock_ret; 2486 2486 2487 2487 range.logical_sector = le64_to_cpu(ic->sb->recalc_sector);
+17
drivers/md/dm.c
··· 143 143 #define DMF_NOFLUSH_SUSPENDING 5 144 144 #define DMF_DEFERRED_REMOVE 6 145 145 #define DMF_SUSPENDED_INTERNALLY 7 146 + #define DMF_POST_SUSPENDING 8 146 147 147 148 #define DM_NUMA_NODE NUMA_NO_NODE 148 149 static int dm_numa_node = DM_NUMA_NODE; ··· 2409 2408 if (!dm_suspended_md(md)) { 2410 2409 dm_table_presuspend_targets(map); 2411 2410 set_bit(DMF_SUSPENDED, &md->flags); 2411 + set_bit(DMF_POST_SUSPENDING, &md->flags); 2412 2412 dm_table_postsuspend_targets(map); 2413 2413 } 2414 2414 /* dm_put_live_table must be before msleep, otherwise deadlock is possible */ ··· 2768 2766 if (r) 2769 2767 goto out_unlock; 2770 2768 2769 + set_bit(DMF_POST_SUSPENDING, &md->flags); 2771 2770 dm_table_postsuspend_targets(map); 2771 + clear_bit(DMF_POST_SUSPENDING, &md->flags); 2772 2772 2773 2773 out_unlock: 2774 2774 mutex_unlock(&md->suspend_lock); ··· 2867 2863 (void) __dm_suspend(md, map, suspend_flags, TASK_UNINTERRUPTIBLE, 2868 2864 DMF_SUSPENDED_INTERNALLY); 2869 2865 2866 + set_bit(DMF_POST_SUSPENDING, &md->flags); 2870 2867 dm_table_postsuspend_targets(map); 2868 + clear_bit(DMF_POST_SUSPENDING, &md->flags); 2871 2869 } 2872 2870 2873 2871 static void __dm_internal_resume(struct mapped_device *md) ··· 3030 3024 return test_bit(DMF_SUSPENDED, &md->flags); 3031 3025 } 3032 3026 3027 + static int dm_post_suspending_md(struct mapped_device *md) 3028 + { 3029 + return test_bit(DMF_POST_SUSPENDING, &md->flags); 3030 + } 3031 + 3033 3032 int dm_suspended_internally_md(struct mapped_device *md) 3034 3033 { 3035 3034 return test_bit(DMF_SUSPENDED_INTERNALLY, &md->flags); ··· 3050 3039 return dm_suspended_md(dm_table_get_md(ti->table)); 3051 3040 } 3052 3041 EXPORT_SYMBOL_GPL(dm_suspended); 3042 + 3043 + int dm_post_suspending(struct dm_target *ti) 3044 + { 3045 + return dm_post_suspending_md(dm_table_get_md(ti->table)); 3046 + } 3047 + EXPORT_SYMBOL_GPL(dm_post_suspending); 3053 3048 3054 3049 int dm_noflush_suspending(struct dm_target *ti) 3055 3050 {
+1
include/linux/device-mapper.h
··· 426 426 int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid); 427 427 struct gendisk *dm_disk(struct mapped_device *md); 428 428 int dm_suspended(struct dm_target *ti); 429 + int dm_post_suspending(struct dm_target *ti); 429 430 int dm_noflush_suspending(struct dm_target *ti); 430 431 void dm_accept_partial_bio(struct bio *bio, unsigned n_sectors); 431 432 union map_info *dm_get_rq_mapinfo(struct request *rq);