From patchwork Tue Jun 1 09:56:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 103486 X-Patchwork-Delegate: jbrassow@redhat.com Received: from mx01.colomx.prod.int.phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o51C66IL000555 for ; Tue, 1 Jun 2010 12:06:41 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.colomx.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o51C3j0X006041; Tue, 1 Jun 2010 08:03:45 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o519xEte002094 for ; Tue, 1 Jun 2010 05:59:14 -0400 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.11]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o519x81p022765; Tue, 1 Jun 2010 05:59:09 -0400 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o519x19Z024095; Tue, 1 Jun 2010 05:59:02 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id A86B28A908; Tue, 1 Jun 2010 11:59:01 +0200 (CEST) From: NeilBrown To: Heinz Mauelshagen , Alasdair G Kergon Date: Tue, 01 Jun 2010 19:56:19 +1000 Message-ID: <20100601095618.565.67698.stgit@notabene.brown> In-Reply-To: <20100601094414.565.3638.stgit@notabene.brown> References: <20100601094414.565.3638.stgit@notabene.brown> User-Agent: StGit/0.15 MIME-Version: 1.0 X-RedHat-Spam-Score: -2.31 (RCVD_IN_DNSWL_MED,T_RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.11 X-loop: dm-devel@redhat.com Cc: linux-raid@vger.kernel.org, dm-devel@redhat.com Subject: [dm-devel] [PATCH 04/24] md: be more careful setting MD_CHANGE_CLEAN X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 01 Jun 2010 12:06:41 +0000 (UTC) diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 1742435..4518994 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -1526,7 +1526,8 @@ void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector) atomic_read(&bitmap->mddev->recovery_active) == 0); bitmap->mddev->curr_resync_completed = bitmap->mddev->curr_resync; - set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags); + if (bitmap->mddev->persistent) + set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags); sector &= ~((1ULL << CHUNK_BLOCK_SHIFT(bitmap)) - 1); s = 0; while (s < sector && s < bitmap->mddev->resync_max_sectors) { diff --git a/drivers/md/md.c b/drivers/md/md.c index 6fbd1c7..2337cb2 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6726,7 +6726,8 @@ void md_do_sync(mddev_t *mddev) atomic_read(&mddev->recovery_active) == 0); mddev->curr_resync_completed = mddev->curr_resync; - set_bit(MD_CHANGE_CLEAN, &mddev->flags); + if (mddev->persistent) + set_bit(MD_CHANGE_CLEAN, &mddev->flags); sysfs_notify(&mddev->kobj, NULL, "sync_completed"); }