From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:56428 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754602AbbKFG0Q (ORCPT ); Fri, 6 Nov 2015 01:26:16 -0500 Subject: Patch "dm cache: the CLEAN_SHUTDOWN flag was not being set" has been added to the 4.2-stable tree To: ejt@redhat.com, bogdan.vasiliev@gmail.com, gregkh@linuxfoundation.org, snitzer@redhat.com Cc: , From: Date: Thu, 05 Nov 2015 22:26:12 -0800 Message-ID: <1446791172145189@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled dm cache: the CLEAN_SHUTDOWN flag was not being set to the 4.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: dm-cache-the-clean_shutdown-flag-was-not-being-set.patch and it can be found in the queue-4.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 3201ac452e84a8a368197d648c9b7011e061804a Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Thu, 22 Oct 2015 18:10:55 +0100 Subject: dm cache: the CLEAN_SHUTDOWN flag was not being set From: Joe Thornber commit 3201ac452e84a8a368197d648c9b7011e061804a upstream. 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 Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-cache-metadata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/md/dm-cache-metadata.c +++ b/drivers/md/dm-cache-metadata.c @@ -634,10 +634,10 @@ static int __commit_transaction(struct d disk_super = dm_block_data(sblock); + disk_super->flags = cpu_to_le32(cmd->flags); if (mutator) update_flags(disk_super, mutator); - disk_super->flags = cpu_to_le32(cmd->flags); disk_super->mapping_root = cpu_to_le64(cmd->root); disk_super->hint_root = cpu_to_le64(cmd->hint_root); disk_super->discard_root = cpu_to_le64(cmd->discard_root); Patches currently in stable-queue which might be from ejt@redhat.com are queue-4.2/dm-btree-remove-fix-a-bug-when-rebalancing-nodes-after-removal.patch queue-4.2/dm-cache-the-clean_shutdown-flag-was-not-being-set.patch