Skip to content

Commit

Permalink
dm cache: metadata clear dirty bits on clean shutdown
Browse files Browse the repository at this point in the history
When writing the dirty bitset to the metadata device on a clean
shutdown, clear the dirty bits.  Previously they were left indicating
the cache was dirty. This led to confusion about whether there really
was dirty data in the cache or not.  (This was a harmless bug.)

Reported-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Joe Thornber authored and Alasdair G Kergon committed Mar 20, 2013
1 parent b978440 commit 79ed9ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-cache-metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ static int __dirty(struct dm_cache_metadata *cmd, dm_cblock_t cblock, bool dirty
/* nothing to be done */
return 0;

value = pack_value(oblock, flags | (dirty ? M_DIRTY : 0));
value = pack_value(oblock, (flags & ~M_DIRTY) | (dirty ? M_DIRTY : 0));
__dm_bless_for_disk(&value);

r = dm_array_set_value(&cmd->info, cmd->root, from_cblock(cblock),
Expand Down

0 comments on commit 79ed9ca

Please sign in to comment.