dm cache: dirty flag was mistakenly being cleared when promoting via overwrite
authorJoe Thornber <ejt@redhat.com>
Thu, 27 Nov 2014 12:26:46 +0000 (12:26 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2015 18:00:48 +0000 (10:00 -0800)
commit4623687667875ce12fbce95b8f6ec89494e2fb52
tree8c6e4f2b3ca9bcbe5cc2129fedd9267184fdce9b
parent624f917e5a7123e794486df12ed779f50b0e2706
dm cache: dirty flag was mistakenly being cleared when promoting via overwrite

commit 1e32134a5a404e80bfb47fad8a94e9bbfcbdacc5 upstream.

If the incoming bio is a WRITE and completely covers a block then we
don't bother to do any copying for a promotion operation.  Once this is
done the cache block and origin block will be different, so we need to
set it to 'dirty'.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-cache-target.c