From patchwork Thu Jan 31 02:29:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10790245 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D51B613B4 for ; Thu, 31 Jan 2019 09:48:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1C5830785 for ; Thu, 31 Jan 2019 09:48:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5657307B1; Thu, 31 Jan 2019 09:48:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5A67C306C7 for ; Thu, 31 Jan 2019 09:48:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A163C075BF5; Thu, 31 Jan 2019 09:48:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF6155C236; Thu, 31 Jan 2019 09:48:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3A777180BAAC; Thu, 31 Jan 2019 09:48:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0V2VciE008289 for ; Wed, 30 Jan 2019 21:31:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id CFD8C5C229; Thu, 31 Jan 2019 02:31:38 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA1985C207; Thu, 31 Jan 2019 02:31:38 +0000 (UTC) Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53971DC909; Thu, 31 Jan 2019 02:31:37 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1548901874; cv=none; d=zoho.com; s=zohoarc; b=KItj23Rod+L+xu2vSDR8+Z0gB7nU9DIXT6EbMNAwdqCExXD5XMY8CIH1w/R3XNaV/UXvBgAKbBZVz7FszJUNcZhOGwk0xrU2kJNsz6kdKy4upuJ3IwEm94ja8Yu2Pi35P/mXKfnAFn0Uc9CcLiPsRQrM1S9ucfuLRGmvTteS71g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1548901874; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=AaMjv5WPbSe3HlhnR3ynjCjoc6GHdluN4WYLbfJCURI=; b=H+E5hC8NJ0HDVgr8SYzvDNG5m29fBPL1XX7zCsdfExUXABOZ3aY7jb9VIy/TzZv2vawFPPgxQXm++uKgHk2FW4TNjqMeGSARhhGuMx44zC+k4NhhZC8KBxxcS3RkCSRfNaYu3ydXIbGweeQPykimbbJtYOxNbs6VSOWziiENJ6g= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=yehs2007@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; b=KIkK3Q2UEn7Zbo/CpQoaZ8B26f3BYv926tzy7SY0kb9rnW6ZENbF7P6rKeEwSXjvGH4WwV3E9IyV NR475HCWh+au2EFaSYcHxd3YkNwDHHIlrUOwifesfxmIZjGk2YEU DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1548901874; s=default; d=zoho.com; i=yehs2007@zoho.com; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=2630; bh=AaMjv5WPbSe3HlhnR3ynjCjoc6GHdluN4WYLbfJCURI=; b=VbGwc4RGbQ01FaQll2xPUhM+9Wdd16T3l8paRGsnLqtxdd6NZrJyYhKbSxfvn+lT Ni1fVbhPM0qB9wqiS3GKeVd9ND4tv0Oe6qd6qqCGp85P7RZq+16cdtyPi66W0kxS9n9 4qB2SE0pSd1X4FAwZYy8mjgKa6mo5R4ZopzlztgA= Received: from YEHS1XR956R00D1.lenovo.com (106.38.1.115 [106.38.1.115]) by mx.zohomail.com with SMTPS id 1548901872503396.530259071718; Wed, 30 Jan 2019 18:31:12 -0800 (PST) From: Huaisheng Ye To: mpatocka@redhat.com, snitzer@redhat.com, agk@redhat.com Date: Thu, 31 Jan 2019 10:29:51 +0800 Message-Id: <20190131022955.9920-2-yehs2007@zoho.com> In-Reply-To: <20190131022955.9920-1-yehs2007@zoho.com> References: <20190131022955.9920-1-yehs2007@zoho.com> X-ZohoMailClient: External X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 31 Jan 2019 02:31:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 31 Jan 2019 02:31:37 +0000 (UTC) for IP:'135.84.80.237' DOMAIN:'sender-pp-092.zoho.com' HELO:'sender-pp-092.zoho.com' FROM:'yehs2007@zoho.com' RCPT:'' X-RedHat-Spam-Score: 0.14 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 135.84.80.237 sender-pp-092.zoho.com 135.84.80.237 sender-pp-092.zoho.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Thu, 31 Jan 2019 04:47:37 -0500 Cc: jack@suse.cz, Huaisheng Ye , corbet@lwn.net, linux-nvdimm@lists.01.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, dan.j.williams@intel.com, hch@lst.de Subject: [dm-devel] [PATCH v3 1/5] dm-writecache: remove unused size to writecache_flush_region X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 31 Jan 2019 09:48:12 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP From: Huaisheng Ye writecache_flush_region doesn't use size to calculate flush region. That uses _set_bits to mark the region in dirty_bitmap directly. Signed-off-by: Huaisheng Ye --- drivers/md/dm-writecache.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 2d50eec..2d8e0c0 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -418,7 +418,7 @@ static void writecache_flush_all_metadata(struct dm_writecache *wc) memset(wc->dirty_bitmap, -1, wc->dirty_bitmap_size); } -static void writecache_flush_region(struct dm_writecache *wc, void *ptr, size_t size) +static void writecache_flush_region(struct dm_writecache *wc, void *ptr) { if (!WC_MODE_PMEM(wc)) __set_bit(((char *)ptr - (char *)wc->memory_map) / BITMAP_GRANULARITY, @@ -657,7 +657,7 @@ static void writecache_free_entry(struct dm_writecache *wc, struct wc_entry *e) writecache_unlink(wc, e); writecache_add_to_freelist(wc, e); clear_seq_count(wc, e); - writecache_flush_region(wc, memory_entry(wc, e), sizeof(struct wc_memory_entry)); + writecache_flush_region(wc, memory_entry(wc, e)); if (unlikely(waitqueue_active(&wc->freelist_wait))) wake_up(&wc->freelist_wait); } @@ -687,9 +687,9 @@ static void writecache_poison_lists(struct dm_writecache *wc) static void writecache_flush_entry(struct dm_writecache *wc, struct wc_entry *e) { - writecache_flush_region(wc, memory_entry(wc, e), sizeof(struct wc_memory_entry)); + writecache_flush_region(wc, memory_entry(wc, e)); if (WC_MODE_PMEM(wc)) - writecache_flush_region(wc, memory_data(wc, e), wc->block_size); + writecache_flush_region(wc, memory_data(wc, e)); } static bool writecache_entry_is_committed(struct dm_writecache *wc, struct wc_entry *e) @@ -733,7 +733,7 @@ static void writecache_flush(struct dm_writecache *wc) wc->seq_count++; pmem_assign(sb(wc)->seq_count, cpu_to_le64(wc->seq_count)); - writecache_flush_region(wc, &sb(wc)->seq_count, sizeof sb(wc)->seq_count); + writecache_flush_region(wc, &sb(wc)->seq_count); writecache_commit_flushed(wc); wc->overwrote_committed = false; @@ -1757,7 +1757,7 @@ static int init_memory(struct dm_writecache *wc) writecache_flush_all_metadata(wc); writecache_commit_flushed(wc); pmem_assign(sb(wc)->magic, cpu_to_le32(MEMORY_SUPERBLOCK_MAGIC)); - writecache_flush_region(wc, &sb(wc)->magic, sizeof sb(wc)->magic); + writecache_flush_region(wc, &sb(wc)->magic); writecache_commit_flushed(wc); return 0; From patchwork Thu Jan 31 02:29:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10790251 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 98F2813B4 for ; Thu, 31 Jan 2019 09:48:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94DE1306C7 for ; Thu, 31 Jan 2019 09:48:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8939530737; Thu, 31 Jan 2019 09:48:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 30F5A306C7 for ; Thu, 31 Jan 2019 09:48:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EBE6F1F575; Thu, 31 Jan 2019 09:48:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BDC3B620CE; Thu, 31 Jan 2019 09:48:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 20B503F604; Thu, 31 Jan 2019 09:48:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0V2VuF2008613 for ; Wed, 30 Jan 2019 21:31:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2567361520; Thu, 31 Jan 2019 02:31:56 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B747B6266C; Thu, 31 Jan 2019 02:31:51 +0000 (UTC) Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7645480F7B; Thu, 31 Jan 2019 02:31:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1548901878; cv=none; d=zoho.com; s=zohoarc; b=d+QkLONkBgupsWcHiOsNzYFbm2WbqDcpLqfM3W7PxKIgCvwF1xUy9fNy5Q77goYJ+LYyCL82kI+Jdy4pDNEW7pFILTxYd6+1n6C6sFapB59OlxPcL+7om5qtHkUvfMwVt4znqhRmHAlrzYh5mx2n865dS4PMK+XTNkgOFJV/sOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1548901878; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=le5j2hLw5GH/PW3GIzsYH2jGxnhrLnZ93bpxcuJQ8Vk=; b=eTSrcMBdvxbZE+XMbrglSQgcap9gWdRvjJ7ficbd/TZvYseNaTNbxCJdKoQODN9ApRLLR78+V3kmhKZNP2PN4Vkw1XuSoQb+mmqRq/Ok9o8HNIGzVC0RaJHvDsNrPhtNXn9eFuhwtOR0dafon5zm7B3ED4e8CgeFDRSALzDpOt8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=yehs2007@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; b=NbRyIcEbfvh1m8GuyIQBhCPJgTigZttqa5wsSXBmtBVVITT7HM7LoyILbwv5P7YOT6UOo9FPIML3 qfYneV0J2ls+odExMC70mXIVjLGaA0s5CbXffVniPP0BGT067fxy DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1548901878; s=default; d=zoho.com; i=yehs2007@zoho.com; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=897; bh=le5j2hLw5GH/PW3GIzsYH2jGxnhrLnZ93bpxcuJQ8Vk=; b=iD4aasrFsUHThMKI/2pHxTG8Ly1NMaWH+5y8148V6doRVDik9AFL5AxPMVULRSoo FRY8vTZmUv/NVz8If63Dg/nX9ZnQmSaNlzGeijI3T+BFg8R4NXl25IKaCQdPWxKhrt+ XfRM5eGHuL6jL5n+C1Pc7SPqhvAB9kPrDLZS4FIw= Received: from YEHS1XR956R00D1.lenovo.com (106.38.1.115 [106.38.1.115]) by mx.zohomail.com with SMTPS id 154890187700296.56872711995572; Wed, 30 Jan 2019 18:31:17 -0800 (PST) From: Huaisheng Ye To: mpatocka@redhat.com, snitzer@redhat.com, agk@redhat.com Date: Thu, 31 Jan 2019 10:29:52 +0800 Message-Id: <20190131022955.9920-3-yehs2007@zoho.com> In-Reply-To: <20190131022955.9920-1-yehs2007@zoho.com> References: <20190131022955.9920-1-yehs2007@zoho.com> X-ZohoMailClient: External X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 31 Jan 2019 02:31:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 31 Jan 2019 02:31:50 +0000 (UTC) for IP:'135.84.80.237' DOMAIN:'sender-pp-092.zoho.com' HELO:'sender-pp-092.zoho.com' FROM:'yehs2007@zoho.com' RCPT:'' X-RedHat-Spam-Score: 0.14 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 135.84.80.237 sender-pp-092.zoho.com 135.84.80.237 sender-pp-092.zoho.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Thu, 31 Jan 2019 04:47:37 -0500 Cc: jack@suse.cz, Huaisheng Ye , corbet@lwn.net, linux-nvdimm@lists.01.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, dan.j.williams@intel.com, hch@lst.de Subject: [dm-devel] [PATCH v3 2/5] dm-writecache: get rid of memory_data flush to writecache_flush_entry X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 31 Jan 2019 09:48:17 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP From: Huaisheng Ye writecache_flush_region only works when SSD mode. If wc->pmem_mode sets, writecache_flush_region doesn't need to be called in writecache_flush_entry. Signed-off-by: Huaisheng Ye --- drivers/md/dm-writecache.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 2d8e0c0..c69317c 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -688,8 +688,6 @@ static void writecache_poison_lists(struct dm_writecache *wc) static void writecache_flush_entry(struct dm_writecache *wc, struct wc_entry *e) { writecache_flush_region(wc, memory_entry(wc, e)); - if (WC_MODE_PMEM(wc)) - writecache_flush_region(wc, memory_data(wc, e)); } static bool writecache_entry_is_committed(struct dm_writecache *wc, struct wc_entry *e) From patchwork Thu Jan 31 02:29:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10790247 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E097917E9 for ; Thu, 31 Jan 2019 09:48:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEE9C306C7 for ; Thu, 31 Jan 2019 09:48:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D20E5307BB; Thu, 31 Jan 2019 09:48:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7171D3070F for ; Thu, 31 Jan 2019 09:48:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7CF62A909; Thu, 31 Jan 2019 09:48:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D41515794; Thu, 31 Jan 2019 09:48:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 318D818033A4; Thu, 31 Jan 2019 09:48:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0V2W3aw008623 for ; Wed, 30 Jan 2019 21:32:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 20FE117F90; Thu, 31 Jan 2019 02:32:03 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 02C724509; Thu, 31 Jan 2019 02:32:03 +0000 (UTC) Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A862FA0915; Thu, 31 Jan 2019 02:32:00 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1548901882; cv=none; d=zoho.com; s=zohoarc; b=K7iq8hS56tegnOe4RWsYVNW4oLhY/6NLylfEiQpxzGXmsYtsRMn50h3cP18/WrwFH46wNZRcpGflqWilFojdiUfX5GHZwind3CqSOIXDDo1xXFgknpFXTJNPWHslLY4nL5nwjNMLWxm9MJttKz3TfYw7XOcpnt+vCUMZfImEzPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1548901882; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=QBdUFHHZxjJDyMep6irBUJTyGeKnwnY2Xb6sUXvAs/8=; b=cA0SPelfccOv9wflHNPDsYWiZlLxTOWdvpPmqu0fttuSnidkAU/yMUxHbvGiZJwjdMT93ckQgvebdT5EOc5yrl1jW+7MocjI+NPYKk550a3ACU2CIJI4uJiLF9fgCZqM+L2fUYEWGlJ+M3HGDGod1YwCa5btbTjMhuU1DDm0mmg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=yehs2007@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; b=Cijfa0RMYhaDqGsZEVvnS7SY4AJ3n9BqzKEvQCBVjwGWMyJe8X9BZXgC448mrVTaY8RDVC8GYgG3 Xq7dTyTDD4BKnKNM/Qb8jIZCx3NdYg7N3brzBE2wPFErvZoyUDH8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1548901882; s=default; d=zoho.com; i=yehs2007@zoho.com; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=1792; bh=QBdUFHHZxjJDyMep6irBUJTyGeKnwnY2Xb6sUXvAs/8=; b=cbOACc31jVwC3kk0JgUvKYSi24l/2kBaCzLsREzrxvmeq5gWLSSyjXYRrRVeYS3x I9e9nlY3NkYwvpjoo+RooI3nK+hZ/XF19ydWQqg1+HW9IH2+rfWGhH42vVRpnoLRanx FPkchWOnh8uKj/3Z5Gs/c+DpnFiIHj8bCgEK4CfY= Received: from YEHS1XR956R00D1.lenovo.com (106.38.1.115 [106.38.1.115]) by mx.zohomail.com with SMTPS id 154890188148863.55614782976397; Wed, 30 Jan 2019 18:31:21 -0800 (PST) From: Huaisheng Ye To: mpatocka@redhat.com, snitzer@redhat.com, agk@redhat.com Date: Thu, 31 Jan 2019 10:29:53 +0800 Message-Id: <20190131022955.9920-4-yehs2007@zoho.com> In-Reply-To: <20190131022955.9920-1-yehs2007@zoho.com> References: <20190131022955.9920-1-yehs2007@zoho.com> X-ZohoMailClient: External X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 31 Jan 2019 02:32:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 31 Jan 2019 02:32:01 +0000 (UTC) for IP:'135.84.80.237' DOMAIN:'sender-pp-092.zoho.com' HELO:'sender-pp-092.zoho.com' FROM:'yehs2007@zoho.com' RCPT:'' X-RedHat-Spam-Score: 0.14 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 135.84.80.237 sender-pp-092.zoho.com 135.84.80.237 sender-pp-092.zoho.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Thu, 31 Jan 2019 04:47:37 -0500 Cc: jack@suse.cz, Huaisheng Ye , corbet@lwn.net, linux-nvdimm@lists.01.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, dan.j.williams@intel.com, hch@lst.de Subject: [dm-devel] [PATCH v3 3/5] dm-writecache: expand pmem_reinit for struct dm_writecache X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 31 Jan 2019 09:48:13 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP From: Huaisheng Ye When use persistent memory as cache data device, sometimes the super block of pmem has messy data stored in it. That would have risk to lead fn ctr failed to work due to invalid magic or version. Here we expand pmem_reinit to optional parameters in order to solve this issue. When user gets pmem device, which has unrelated data, as cache device, he should use paramenter 'reinit' to avoid s.magic and s.version don't equal to NULL or correct MEMORY_SUPERBLOCK_MAGIC/VERSION. Signed-off-by: Huaisheng Ye --- drivers/md/dm-writecache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index c69317c..2c1e825 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -149,6 +149,7 @@ struct dm_writecache { bool pmem_mode:1; bool writeback_fua:1; + bool pmem_reinit:1; bool overwrote_committed:1; bool memory_vmapped:1; @@ -2026,6 +2027,10 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv) wc->writeback_fua = false; wc->writeback_fua_set = true; } else goto invalid_optional; + } else if (!strcasecmp(string, "reinit")) { + if (WC_MODE_PMEM(wc)) + wc->pmem_reinit = true; + else goto invalid_optional; } else { invalid_optional: r = -EINVAL; @@ -2127,7 +2132,7 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv) ti->error = "Hardware memory error when reading superblock"; goto bad; } - if (!le32_to_cpu(s.magic) && !le32_to_cpu(s.version)) { + if (wc->pmem_reinit || (!le32_to_cpu(s.magic) && !le32_to_cpu(s.version))) { r = init_memory(wc); if (r) { ti->error = "Unable to initialize device"; From patchwork Thu Jan 31 02:29:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10790241 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B520117E9 for ; Thu, 31 Jan 2019 09:47:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADC84306C7 for ; Thu, 31 Jan 2019 09:47:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A10E9307BB; Thu, 31 Jan 2019 09:47:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E2D0306C7 for ; Thu, 31 Jan 2019 09:47:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F19BE356F6; Thu, 31 Jan 2019 09:47:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 502DE5C239; Thu, 31 Jan 2019 09:47:46 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DD4873F7D5; Thu, 31 Jan 2019 09:47:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0V2WdOi008634 for ; Wed, 30 Jan 2019 21:32:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id C45F55D97E; Thu, 31 Jan 2019 02:32:39 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ADF865D9D6; Thu, 31 Jan 2019 02:32:29 +0000 (UTC) Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6655881DEB; Thu, 31 Jan 2019 02:32:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1548901888; cv=none; d=zoho.com; s=zohoarc; b=YtnG9vz/O8yeb2MNeONfLbdtluy7M9hj3MuFGwV3MvOPMlItJ81dFVQM1zTsdAJxDgfx3ritJPlZsvYZzaL2qXeVsIE4QkHRnmX8UdAkISsLPrkJDZ+DLInB3T8dSrZpCw0bBu6GrkHneMBW6iccH6wVQBmEVBmW7GERT/3m+BQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1548901888; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=LQScH7Z9ASTjwz+BDMoHBx4OT6Si3H3lqWmXMhgmtTk=; b=Vkvg4xglJaYStlJZKUZSKcJIUfwVf9Td9bX1E/vg/2j244afehfT7KOEUUwehNSCugH16IlXBB9hsshxs2sJ+AmjWDD0Ih6EkPhKylBubaZeBnm4aQ1huD79w2Dn8PHqxnvNnf7kG+EKOhYnsuPSE1ISuS6qeq13LF3w3wpXhQU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=yehs2007@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; b=YTmQfU2DMhroOwFiwJYWEqVCs4EDKZKSuzi5bqP+fbrs5jLJLchtR/ZRLBKnYQeLCn9wuzZrzUEU oPM1+xfIPz224xdB/KchiATUum6Rsmk5Q3QvGuNPI0b8wVT5b+WF DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1548901888; s=default; d=zoho.com; i=yehs2007@zoho.com; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=927; bh=LQScH7Z9ASTjwz+BDMoHBx4OT6Si3H3lqWmXMhgmtTk=; b=QU8yZwJ1bXOM/lnRu9a7Xi9FWCs1kWMxs99q6tZq0Fubgz0Xi4G9kEnx9EhnCjrm DIGBuBvofT5Ad7M2jStIOe7kMsoI/Xh5M4brJxJaXqflRMqakDFEqkvm5px2psb8f99 zwzU+64LOiHq4TLmE9870GY6arm2E110HR8nTwXQ= Received: from YEHS1XR956R00D1.lenovo.com (106.38.1.115 [106.38.1.115]) by mx.zohomail.com with SMTPS id 1548901885991120.6711966437723; Wed, 30 Jan 2019 18:31:25 -0800 (PST) From: Huaisheng Ye To: mpatocka@redhat.com, snitzer@redhat.com, agk@redhat.com Date: Thu, 31 Jan 2019 10:29:54 +0800 Message-Id: <20190131022955.9920-5-yehs2007@zoho.com> In-Reply-To: <20190131022955.9920-1-yehs2007@zoho.com> References: <20190131022955.9920-1-yehs2007@zoho.com> X-ZohoMailClient: External X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 31 Jan 2019 02:32:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 31 Jan 2019 02:32:28 +0000 (UTC) for IP:'135.84.80.237' DOMAIN:'sender-pp-092.zoho.com' HELO:'sender-pp-092.zoho.com' FROM:'yehs2007@zoho.com' RCPT:'' X-RedHat-Spam-Score: 0.14 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 135.84.80.237 sender-pp-092.zoho.com 135.84.80.237 sender-pp-092.zoho.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Thu, 31 Jan 2019 04:47:37 -0500 Cc: jack@suse.cz, Huaisheng Ye , corbet@lwn.net, linux-nvdimm@lists.01.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, dan.j.williams@intel.com, hch@lst.de Subject: [dm-devel] [PATCH v3 4/5] Documentation/device-mapper: add optional parameter reinit X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 31 Jan 2019 09:47:47 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP From: Huaisheng Ye Add intro and usage guide for reinit. Signed-off-by: Huaisheng Ye --- Documentation/device-mapper/writecache.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/device-mapper/writecache.txt b/Documentation/device-mapper/writecache.txt index 01532b3..255c68c 100644 --- a/Documentation/device-mapper/writecache.txt +++ b/Documentation/device-mapper/writecache.txt @@ -45,6 +45,10 @@ Constructor parameters: afterwards - some underlying devices perform better with fua, some with nofua. The user should test it + reinit (by default off) + applicable only to persistent memory - use the REINIT flag + when the surper block has messy data, that would cause fn ctr + failed to work with invalid magic or version in the superblock Status: 1. error indicator - 0 if there was no error, otherwise error number From patchwork Thu Jan 31 02:29:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10790249 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 225CC1874 for ; Thu, 31 Jan 2019 09:48:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F032306C7 for ; Thu, 31 Jan 2019 09:48:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12E0C3070F; Thu, 31 Jan 2019 09:48:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9A19D30737 for ; Thu, 31 Jan 2019 09:48:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0033D394D3C; Thu, 31 Jan 2019 09:48:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C49625D757; Thu, 31 Jan 2019 09:48:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 29C173F6E4; Thu, 31 Jan 2019 09:48:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0V2XA7a008649 for ; Wed, 30 Jan 2019 21:33:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 56B84608C6; Thu, 31 Jan 2019 02:33:10 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D851A5F7C1; Thu, 31 Jan 2019 02:33:03 +0000 (UTC) Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F1D417AE9A; Thu, 31 Jan 2019 02:32:54 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1548901892; cv=none; d=zoho.com; s=zohoarc; b=LDgy6MugAyxvHx80sLMn2iTsvyO7FIJPvN6b5Uxl+C5vSxKbCELW4c9ymRR7+rFPowiDD8KEpFjHwEvjoudnNvu5tuwPBDp/HcKmL9TizoHmWrRM1QPwx1ux2Gx/AkMoSt5gYhZS05AzW8A48sMyhShvzvzSMA+k8Rf3F7CNGfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1548901892; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=DeSXpkuBaRP5FZTknldkbxhMQMJx9Q4qwy3wT5Ssm1k=; b=Rfl3TdNzlrd8lngOI4Fk0VHGqWEAvfmDdyp5KH/r/xB12cy5v3mmedKgk5ROKR+qItRD9P3RHdUGpHSemFvU7XyOn/yp0KQC4BZwxdc4U+3snepVgUfa4Sek1OLHUWirmowRJp2exAkjp6dAQCdMEDBYwHCm7LSlmZONmUON4XU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=yehs2007@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; b=WpEjR8C+TDFyTr6GwT4b6SnH3DxM6SJLnrxkYjPnL1UuMBeF2Hkr0s7isUQ7mxJXrH0BALBEueHW POE53UgKTMdTRic2yHNPIjSJfj3DC+0HrYolLpwpCtTlDrdoq+tl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1548901892; s=default; d=zoho.com; i=yehs2007@zoho.com; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=1009; bh=DeSXpkuBaRP5FZTknldkbxhMQMJx9Q4qwy3wT5Ssm1k=; b=dKClg84rZYnrzufN1FKEICy7VAZdgifPw/2VyDfO1CzslIVF0QaFnjcuy8c6U4Xv C3GSJFOWvfVYuTGZSNz+Dy0jVLKheYUFiNlPqWh4CUgLSSEX+psG3AQwFmzKQqcdTtE elawTJegklis7p3BQPSX3OrGeqJJbbwUnYqJm9A8= Received: from YEHS1XR956R00D1.lenovo.com (106.38.1.115 [106.38.1.115]) by mx.zohomail.com with SMTPS id 1548901890474272.2511908503543; Wed, 30 Jan 2019 18:31:30 -0800 (PST) From: Huaisheng Ye To: mpatocka@redhat.com, snitzer@redhat.com, agk@redhat.com Date: Thu, 31 Jan 2019 10:29:55 +0800 Message-Id: <20190131022955.9920-6-yehs2007@zoho.com> In-Reply-To: <20190131022955.9920-1-yehs2007@zoho.com> References: <20190131022955.9920-1-yehs2007@zoho.com> X-ZohoMailClient: External X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 31 Jan 2019 02:32:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 31 Jan 2019 02:32:55 +0000 (UTC) for IP:'135.84.80.237' DOMAIN:'sender-pp-092.zoho.com' HELO:'sender-pp-092.zoho.com' FROM:'yehs2007@zoho.com' RCPT:'' X-RedHat-Spam-Score: 0.14 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 135.84.80.237 sender-pp-092.zoho.com 135.84.80.237 sender-pp-092.zoho.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Thu, 31 Jan 2019 04:47:37 -0500 Cc: jack@suse.cz, Huaisheng Ye , corbet@lwn.net, linux-nvdimm@lists.01.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, dan.j.williams@intel.com, hch@lst.de Subject: [dm-devel] [PATCH v3 5/5] dm-writecache: output seq_count within status X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 31 Jan 2019 09:48:12 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP From: Huaisheng Ye seq_count is important for flush operations, output it within status for debugging and analyzing code behavior. Signed-off-by: Huaisheng Ye --- drivers/md/dm-writecache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 2c1e825..3396710 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -2231,9 +2231,9 @@ static void writecache_status(struct dm_target *ti, status_type_t type, switch (type) { case STATUSTYPE_INFO: - DMEMIT("%ld %llu %llu %llu", writecache_has_error(wc), + DMEMIT("%ld %llu %llu %llu %llu", writecache_has_error(wc), (unsigned long long)wc->n_blocks, (unsigned long long)wc->freelist_size, - (unsigned long long)wc->writeback_size); + (unsigned long long)wc->writeback_size, wc->seq_count); break; case STATUSTYPE_TABLE: DMEMIT("%c %s %s %u ", WC_MODE_PMEM(wc) ? 'p' : 's',