Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752322AbbGMIj6 (ORCPT ); Mon, 13 Jul 2015 04:39:58 -0400 Received: from victor.provo.novell.com ([137.65.250.26]:45756 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752042AbbGMIjy (ORCPT ); Mon, 13 Jul 2015 04:39:54 -0400 From: Nick Wang To: nwang@suse.com Cc: philipp.reisner@linbit.com, Lars Ellenberg , drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org Subject: [Patch v2 10/10] drbd: Handle new-current-uuid --zap-devices Date: Mon, 13 Jul 2015 16:39:04 +0800 Message-Id: <1436776744-3135-11-git-send-email-nwang@suse.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1436776744-3135-1-git-send-email-nwang@suse.com> References: <1436776744-3135-1-git-send-email-nwang@suse.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1762 Lines: 50 Zap devices for zeroing out device on both side instead of initial full sync. Signed-off-by: Nick Wang CC: Philipp Reisner CC: Lars Ellenberg CC: drbd-dev@lists.linbit.com CC: linux-kernel@vger.kernel.org --- drbd/drbd_nl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drbd/drbd_nl.c b/drbd/drbd_nl.c index 1d17663..131f112 100644 --- a/drbd/drbd_nl.c +++ b/drbd/drbd_nl.c @@ -4068,7 +4068,7 @@ int drbd_adm_new_c_uuid(struct sk_buff *skb, struct genl_info *info) drbd_uuid_set(device, UI_BITMAP, 0); /* Rotate UI_BITMAP to History 1, etc... */ drbd_uuid_new_current(device); /* New current, previous to UI_BITMAP */ - if (args.clear_bm) { + if (args.clear_bm || args.zap_devices) { err = drbd_bitmap_io(device, &drbd_bmio_clear_n_write, "clear_n_write from new_c_uuid", BM_LOCKED_MASK); if (err) { @@ -4084,6 +4084,16 @@ int drbd_adm_new_c_uuid(struct sk_buff *skb, struct genl_info *info) CS_VERBOSE, NULL); spin_unlock_irq(&device->resource->req_lock); } + if (zero_out_devices) { + drbd_send_zero_out_start(first_peer_device(device)); + _drbd_uuid_set(device, UI_BITMAP, 0); + drbd_print_uuids(device, "cleared bitmap UUID for zeroing device"); + + /* CLear bit flag of zero out */ + clear_bit(ZERO_DONE, &device->flags); + clear_bit(ZERO_FAIL, &device->flags); + drbd_device_post_work(device, P_ZERO_START); + } } drbd_md_sync(device); -- 1.8.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/