From patchwork Mon Nov 27 15:04:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10076995 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C7EE16028E for ; Mon, 27 Nov 2017 15:04:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B957228EEA for ; Mon, 27 Nov 2017 15:04:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE32D28EF1; Mon, 27 Nov 2017 15:04:47 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 B09D528EEA for ; Mon, 27 Nov 2017 15:04:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653AbdK0PEo (ORCPT ); Mon, 27 Nov 2017 10:04:44 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:35026 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752395AbdK0PEn (ORCPT ); Mon, 27 Nov 2017 10:04:43 -0500 Received: by mail-qk0-f195.google.com with SMTP id p19so32755848qke.2 for ; Mon, 27 Nov 2017 07:04:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=w8PgJiyBBh0U8YSDLNunLlsaYOdqVWW80jNc99U0Nw4=; b=UCFNW8Oao3gfOdjQc5u2Co6J1yXuzUVlulSDSmD+EbMfr3PNU2DWpZt+7omwBCDj9F NKUPJZyzK7fAenHD0LYtPVGfG6aIZWey19sKd0RLv+impRX/2GuGgyEukIMbeT1oYVfD fLVFnthMTq0nphyRPT2sZhfnLh3h6nJ+Luo8yhv+4NxHYjlSNdQQux9Qhc6KiqIWk3Pr No5H078dDGPahX/FNCna1CgNGIA8XhZ0pteVJIiJiikJJd0VFdB3hO0DEtWfpq5LAklY IIwFGh1Vi4ulH6xEe32jIWK0jMYuVShSzMlWfhTb85Q9xrlStwZggNqPJUUVp1OyrLbz 8KmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=w8PgJiyBBh0U8YSDLNunLlsaYOdqVWW80jNc99U0Nw4=; b=fnKg565clNEbL6soYWFqesYDubZAQSs/CuDWj/DYGWokfyvmQ77PUbA9fPwwMHYWqo f8FA/QOCa0O2VoklNlG+zxRFMQtBp1Q0XYtuXGFEYfOj1HbP1kc32HYNd3zMTOFxwOPC O4htKy5pZBGqNi5sDPFQ+0X3wKhtwf29zt+uILP5QAesxRhijH7hHy5HtScu9lndW2kp zETuskA/iAKmxtxn3P+hJfeBZoOBdJyhevlPuxfn31eR0PArXLHm+2MeSXXWRGKOXmgt lSEBg/9r86F6LHRoCWML/swePBZv06vBb5I0TickmaAJgv/3jGls9DigqHWu9eogsotd 2qRA== X-Gm-Message-State: AJaThX5GJoOjNJ1n4ABQF/JasU4xct94iMHKAvSzotuIRUDsdATbsnju fXB1dwWSUMti9goH0OxdEKG7mw== X-Google-Smtp-Source: AGs4zMavcVlcuEj3EcfCJRiuy07LIZISGM4zahH9zE2hYjtDdCdgZVn4ujV1VMcC9ff1BSHAEHgwUQ== X-Received: by 10.55.18.92 with SMTP id c89mr58101954qkh.297.1511795082271; Mon, 27 Nov 2017 07:04:42 -0800 (PST) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id 44sm19465467qtq.62.2017.11.27.07.04.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 07:04:41 -0800 (PST) Date: Mon, 27 Nov 2017 10:04:40 -0500 From: Josef Bacik To: Amir Goldstein Cc: Josef Bacik , fstests , linux-fsdevel , Eryu Guan Subject: Re: [PATCH v3 10/13] fstests: crash consistency fsx test using dm-log-writes Message-ID: <20171127150439.i4tpt4yhooxnoaiz@destiny> References: <1504638680-25682-1-git-send-email-amir73il@gmail.com> <1504638680-25682-11-git-send-email-amir73il@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170714 (1.8.3) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Nov 27, 2017 at 11:56:58AM +0200, Amir Goldstein wrote: > On Tue, Sep 5, 2017 at 10:11 PM, Amir Goldstein wrote: > > Cherry-picked the test from commit 70d41e17164b > > in Josef Bacik's fstests tree (https://github.com/josefbacik/fstests). > > Quoting from Josef's commit message: > > > > The test just runs some ops and exits, then finds all of the good buffers > > in the directory we provided and: > > - replays up to the mark given > > - mounts the file system and compares the md5sum > > - unmounts and fsck's to check for metadata integrity > > > > dm-log-writes will pretend to do discard and the replay-log tool will > > replay it properly depending on the underlying device, either by writing > > 0's or actually calling the discard ioctl, so I've enabled discard in the > > test for maximum fun. > > > > [Amir:] > > - Removed unneeded _test_falloc_support dynamic FSX_OPTS > > - Fold repetitions into for loops > > - Added place holders for using constant random seeds > > - Add pre umount checkpint > > - Add test to new 'replay' group > > - Address review comments by Eryu Guan > > > > Cc: Josef Bacik > > Signed-off-by: Amir Goldstein > > > Josef, > > As you know, this test is now merged to xfstest as generic/455. > I have been running the test for a while on xfs and it occasionally > reports inconsistencies which I try to investigate. > > In some of the reports, it appears that dm-log-writes may be exhibiting > a reliability issue (see below). > It's not a reliability issue, its a caching issue. dm-log-writes is just issuing bio's to the log device, and our destructor waits for all pending io blocks to complete before exiting, so unless I've missed how dm is destroying devices everything should be on disk. However since we replay in userspace we are going through the blockdevice's pagecache, so we could have stale pages left in place which is screwing us up. Will you try this patch and see if it fixes the problem? Thanks, Josef --- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index 8b80a9ce9ea9..1c502930af5e 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -545,6 +545,8 @@ static void log_writes_dtr(struct dm_target *ti) !atomic_read(&lc->pending_blocks)); kthread_stop(lc->log_kthread); + invalidate_bdev(lc->logdev->bdev); + invalidate_bdev(lc->dev->bdev); WARN_ON(!list_empty(&lc->logging_blocks)); WARN_ON(!list_empty(&lc->unflushed_blocks)); dm_put_device(ti, lc->dev);