diff options
author | Joe Thornber <ejt@redhat.com> | 2013-03-20 13:21:27 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2013-03-20 13:21:27 -0400 |
commit | 79ed9caffc9fff67aa64fd683e791aa70f1bcb51 (patch) | |
tree | df0d78e16753fa399ce72a2fe0d28cb107ed3d98 /drivers/md/dm-cache-metadata.c | |
parent | b978440b8db901aba0c4cd38c7c841c9b5cd9a7e (diff) |
dm cache: metadata clear dirty bits on clean shutdown
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>
Diffstat (limited to 'drivers/md/dm-cache-metadata.c')
-rw-r--r-- | drivers/md/dm-cache-metadata.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c index fbd3625f2748..1bb91802b22a 100644 --- a/drivers/md/dm-cache-metadata.c +++ b/drivers/md/dm-cache-metadata.c | |||
@@ -979,7 +979,7 @@ static int __dirty(struct dm_cache_metadata *cmd, dm_cblock_t cblock, bool dirty | |||
979 | /* nothing to be done */ | 979 | /* nothing to be done */ |
980 | return 0; | 980 | return 0; |
981 | 981 | ||
982 | value = pack_value(oblock, flags | (dirty ? M_DIRTY : 0)); | 982 | value = pack_value(oblock, (flags & ~M_DIRTY) | (dirty ? M_DIRTY : 0)); |
983 | __dm_bless_for_disk(&value); | 983 | __dm_bless_for_disk(&value); |
984 | 984 | ||
985 | r = dm_array_set_value(&cmd->info, cmd->root, from_cblock(cblock), | 985 | r = dm_array_set_value(&cmd->info, cmd->root, from_cblock(cblock), |