Skip to content

Commit 7e0a973

Browse files
committed
[dm-cache] The CLEAN_SHUTDOWN flag was not being set
or rather, it was being set on the disk, then immediately cleared again. If the CLEAN_SHUTDOWN flag is not set when a cache is loaded then all cache blocks are marked as dirty and a full writeback occurs.
1 parent 05ce4ed commit 7e0a973

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/md/dm-cache-metadata.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,11 @@ static int __commit_transaction(struct dm_cache_metadata *cmd,
634634

635635
disk_super = dm_block_data(sblock);
636636

637+
disk_super->flags = cpu_to_le32(cmd->flags);
638+
637639
if (mutator)
638640
update_flags(disk_super, mutator);
639641

640-
disk_super->flags = cpu_to_le32(cmd->flags);
641642
disk_super->mapping_root = cpu_to_le64(cmd->root);
642643
disk_super->hint_root = cpu_to_le64(cmd->hint_root);
643644
disk_super->discard_root = cpu_to_le64(cmd->discard_root);

0 commit comments

Comments
 (0)