From patchwork Tue Sep 11 22:06:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Bo X-Patchwork-Id: 10596401 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 3334113BF for ; Tue, 11 Sep 2018 22:06:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2298E29C82 for ; Tue, 11 Sep 2018 22:06:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16F2629C9D; Tue, 11 Sep 2018 22:06:57 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCABD286D7 for ; Tue, 11 Sep 2018 22:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728210AbeILDIQ (ORCPT ); Tue, 11 Sep 2018 23:08:16 -0400 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:45961 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728018AbeILDIQ (ORCPT ); Tue, 11 Sep 2018 23:08:16 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04455;MF=bo.liu@linux.alibaba.com;NM=1;PH=DS;RN=1;SR=0;TI=SMTPD_---0T8TI1Nn_1536703604; Received: from localhost(mailfrom:bo.liu@linux.alibaba.com fp:SMTPD_---0T8TI1Nn_1536703604) by smtp.aliyun-inc.com(127.0.0.1); Wed, 12 Sep 2018 06:06:44 +0800 From: Liu Bo To: Subject: [PATCH] Btrfs: assert page dirty bit Date: Wed, 12 Sep 2018 06:06:21 +0800 Message-Id: <1536703587-94565-2-git-send-email-bo.liu@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just in case that someone breaks the rule that pages are dirty as long as eb is dirty. Signed-off-by: Liu Bo --- fs/btrfs/extent_io.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index fb2bf50134a1..99895f196ecb 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -5184,6 +5184,11 @@ bool set_extent_buffer_dirty(struct extent_buffer *eb) set_page_dirty(eb->pages[i]); } +#ifdef BTRFS_DEBUG + for (i = 0; i < num_pages; i++) + ASSERT(PageDirty(eb->pages[i])); +#endif + return was_dirty; }