From patchwork Thu Nov 17 18:14:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9435047 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 E5E7460238 for ; Thu, 17 Nov 2016 18:14:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB3E82965F for ; Thu, 17 Nov 2016 18:14:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D01802968B; Thu, 17 Nov 2016 18:14:25 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 B280C29660 for ; Thu, 17 Nov 2016 18:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933450AbcKQSOS (ORCPT ); Thu, 17 Nov 2016 13:14:18 -0500 Received: from mail-it0-f45.google.com ([209.85.214.45]:36050 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932301AbcKQSOP (ORCPT ); Thu, 17 Nov 2016 13:14:15 -0500 Received: by mail-it0-f45.google.com with SMTP id l8so154102747iti.1 for ; Thu, 17 Nov 2016 10:14:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-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=J9qUaMIpuFg40iLbGim/netGzMqtEzmHOVXAt+Ogims=; b=eancAzVugelCzWrZrdaqw/aqExNxu5n6ZheL3q8i6tRLZ9hHNL5Rb5ggp8R8hIX8ko lR5RmAtqCkzvRHT2UOk02NMBgWLbB8SG2a/LwQwBgMw9dy2MbTqMZ2fJv4TAWc/2gfu3 JQ/QWv0rd4Dr9vW6MF9C+HXxk7Kwu8rh7JHTdmzvi1MGVwQhMlbhqCAbk3l55RHqoFDl 1Ku6DqQJVPqbyHdtjSh6C14Rdjp1tVH1ggBLw0Sxvk1deJ/xbbWk/RHD79PKd21DLTmM /biH1Hiy37awGt/duOeeuR7wEx871whXnHI8kKa0JVyG1V3UU0IznwdBOOl9ylqR+Bar htgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=J9qUaMIpuFg40iLbGim/netGzMqtEzmHOVXAt+Ogims=; b=kmAOVwHZH5a7EEOwCJGprZAFb3c7QEE2ingM64pMbO1vTrIUc3B65Nwcu236O3nU8s pwdLRi6mKZqw4hPldlRvlwEUIM/Ze+NNTOUM3nElkP/gLFTWVx8XgnpI8dIdB4dK3wCF domPikf+nVQBcpww10cYG+kkR2UEJR+fcIXch/SuSi1GCqDRGm206DwyseQ4jxzkKmLN 4w4OHItT30QMLGvg8KofXCKIeWhfZXwkkDEafk7GlitBYuGTf4RnCvCIo26yaqIqu44b OCNTQleZv59QiS4FYSRkUZ3EzO5Vw1E1B8d31ESMzfJ0p8cUuLLhnrxdklUU3stAsf2R LVtQ== X-Gm-Message-State: AKaTC02PIKnReUtCEhDr3FuYalXXGh5FKgarW8iHCPZPLqNj3bWNw847NNWgbX2lNkYpeeq0 X-Received: by 10.107.164.202 with SMTP id d71mr4744699ioj.185.1479406454638; Thu, 17 Nov 2016 10:14:14 -0800 (PST) Received: from vader.DHCP.thefacebook.com ([2620:10d:c090:200::e:cd45]) by smtp.gmail.com with ESMTPSA id h142sm5797956itb.1.2016.11.17.10.14.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Nov 2016 10:14:14 -0800 (PST) Date: Thu, 17 Nov 2016 10:14:12 -0800 From: Omar Sandoval To: Eryu Guan Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] generic: test concurrent non-overlapping direct I/O on the same extents Message-ID: <20161117181412.GA21816@vader.DHCP.thefacebook.com> References: <1edb45d8895de8fe347e800a5fd22b0f6eafb181.1479342541.git.osandov@fb.com> <20161117052611.GX27776@eguan.usersys.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161117052611.GX27776@eguan.usersys.redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) 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 On Thu, Nov 17, 2016 at 01:26:11PM +0800, Eryu Guan wrote: > On Wed, Nov 16, 2016 at 04:29:34PM -0800, Omar Sandoval wrote: > > From: Omar Sandoval > > > > There have been a couple of logic bugs in `btrfs_get_extent()` which > > could lead to spurious -EEXIST errors from read or write. This test > > exercises those conditions by having two threads race to add an extent > > to the extent map. > > > > This is fixed by Linux commit 8dff9c853410 ("Btrfs: deal with duplciates > > during extent_map insertion in btrfs_get_extent") and the patch "Btrfs: > > deal with existing encompassing extent map in btrfs_get_extent()" > > (http://marc.info/?l=linux-btrfs&m=147873402311143&w=2). > > > > Although the bug is Btrfs-specific, nothing about the test is. > > > > Signed-off-by: Omar Sandoval > > --- > [snip] > > +# real QA test starts here > > + > > +_supported_fs generic > > +_supported_os Linux > > +_require_test > > +_require_xfs_io_command "falloc" > > +_require_test_program "dio-interleaved" > > + > > +extent_size="$(($(stat -f -c '%S' "$TEST_DIR") * 2))" > > There's a helper to get fs block size: "get_block_size". > > > +num_extents=1024 > > +testfile="$TEST_DIR/$$-testfile" > > + > > +truncate -s 0 "$testfile" > > I prefer using xfs_io to do the truncate, > > $XFS_IO_PROG -fc "truncate 0" "$testfile" > > Because in rare cases truncate(1) may be unavailable, e.g. RHEL5, > usually it's not a big issue, but xfs_io works all the time, we have a > better way, so why not :) > > > +for ((off = 0; off < num_extents * extent_size; off += extent_size)); do > > + xfs_io -c "falloc $off $extent_size" "$testfile" > > Use $XFS_IO_PROG not bare xfs_io. > > I can fix all the tiny issues at commit time. > > Thanks, > Eryu Thank you, Eryu, that's all okay with me. I also had a typo here: Feel free to fix this at commit time, too, or I can send a v2 if you prefer. diff --git a/src/dio-interleaved.c b/src/dio-interleaved.c index 831a191..6b04c99 100644 --- a/src/dio-interleaved.c +++ b/src/dio-interleaved.c @@ -58,7 +58,7 @@ int main(int argc, char **argv) int fd; if (argc != 4) { - fprintf(stderr, "usage: %s SECTORSIZE NUM_EXTENTS PATH\n", + fprintf(stderr, "usage: %s EXTENT_SIZE NUM_EXTENTS PATH\n", argv[0]); return EXIT_FAILURE; }