https://github.com/torvalds/linux
Revision 3201ac452e84a8a368197d648c9b7011e061804a authored by Joe Thornber on 22 October 2015, 17:10:55 UTC, committed by Mike Snitzer on 23 October 2015, 18:02:56 UTC
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.

__commit_transaction() is responsible for setting/clearing
CLEAN_SHUTDOWN (based the flags_mutator that is passed in).

Fix this issue, of the cache's on-disk flags being wrong, by making sure
__commit_transaction() does not reset the flags after the mutator has
altered the flags in preparation for them being serialized to disk.

before:

sb_flags = mutator(le32_to_cpu(disk_super->flags));
disk_super->flags = cpu_to_le32(sb_flags);
disk_super->flags = cpu_to_le32(cmd->flags);

after:

disk_super->flags = cpu_to_le32(cmd->flags);
sb_flags = mutator(le32_to_cpu(disk_super->flags));
disk_super->flags = cpu_to_le32(sb_flags);

Reported-by: Bogdan Vasiliev <bogdan.vasiliev@gmail.com>
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
1 parent 4dcb8b5
History
Tip revision: 3201ac452e84a8a368197d648c9b7011e061804a authored by Joe Thornber on 22 October 2015, 17:10:55 UTC
dm cache: the CLEAN_SHUTDOWN flag was not being set
Tip revision: 3201ac4
File Mode Size
Kconfig -rw-r--r-- 65.5 KB
Makefile -rw-r--r-- 1.1 KB
calibrate.c -rw-r--r-- 8.5 KB
do_mounts.c -rw-r--r-- 14.6 KB
do_mounts.h -rw-r--r-- 1.4 KB
do_mounts_initrd.c -rw-r--r-- 3.4 KB
do_mounts_md.c -rw-r--r-- 8.2 KB
do_mounts_rd.c -rw-r--r-- 8.7 KB
init_task.c -rw-r--r-- 728 bytes
initramfs.c -rw-r--r-- 13.8 KB
main.c -rw-r--r-- 24.7 KB
noinitramfs.c -rw-r--r-- 1.5 KB
version.c -rw-r--r-- 1.2 KB

back to top