From patchwork Mon Sep 23 14:35:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Whitney X-Patchwork-Id: 277243 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6F5FD2C0121 for ; Tue, 24 Sep 2013 00:37:39 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753945Ab3IWOfZ (ORCPT ); Mon, 23 Sep 2013 10:35:25 -0400 Received: from mail-qa0-f54.google.com ([209.85.216.54]:49260 "EHLO mail-qa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752306Ab3IWOfX (ORCPT ); Mon, 23 Sep 2013 10:35:23 -0400 Received: by mail-qa0-f54.google.com with SMTP id bv4so1510294qab.20 for ; Mon, 23 Sep 2013 07:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=leqbOuCYeHc034Zv2/FJFrjMKNc5fCPzFryiE63R0mQ=; b=jnPjayuX0HhIMLzUGiY1paTVdXSAQQihPNlDMgOaN+Q5VM+Mj2y/VEFo7SHVnipD+P nAyWV4CYz5QSYIFNC6wHerJVOfpGnSDne9yJ98V0eks9ZgaUXC7ZBmJJeYXNYU0DHzmI O6z5pJqxPON8NS6gX2D50I72KqCT172n2ZkAHvh5bFqhG8DOI9oF/ZYyAvsQP8KZGlW7 BRF/NlbHLRnzN70nODLemw0tMPCsqlIP7n3RI2Wd9t73lAZhO69B4nQB3rcut7qTo3Fa FvgB9IVI7q/+pEnOa6rOogo859JfK8VYEueAVKnKMnnlBiHLy438RPHJhc/B9U71xKCw Mh6A== X-Received: by 10.49.51.67 with SMTP id i3mr29625338qeo.8.1379946922770; Mon, 23 Sep 2013 07:35:22 -0700 (PDT) Received: from wallace (c-75-68-62-236.hsd1.nh.comcast.net. [75.68.62.236]) by mx.google.com with ESMTPSA id y9sm44484866qaj.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Sep 2013 07:35:20 -0700 (PDT) Date: Mon, 23 Sep 2013 10:35:18 -0400 From: Eric Whitney To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu Subject: [PATCH][RESEND] tests: add another test for uninit extents past eof Message-ID: <20130923143518.GA2464@wallace> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Commit d3f32c2db8 was intended to detect extents found outside their proper location in the extent tree, including invalid extents at the end of an extent block. However, it incorrectly reported legal uninitialized extents created by fallocate() at the end of file with the FALLOC_FL_KEEP_SIZE flag as false positives. xfstests generic/263 (among others) caught this problem, while the e2fsprogs test f_uninit_ext_past_eof did not. The latter test failed to detect the problem in part because it uses a test file whose i_size is 0. Add a test derived from the fsx-based test case in xfstests generic/263 consisting of a file with non-zero length, more than four extents total, and two uninitialized extents past EOF to reliably reproduce commit d3f32c2db8's false positive behavior. Signed-off-by: Eric Whitney --- tests/f_uninit_ext_past_eof2/expect.1 | 7 +++++++ tests/f_uninit_ext_past_eof2/expect.2 | 7 +++++++ tests/f_uninit_ext_past_eof2/image.gz | Bin 0 -> 989 bytes tests/f_uninit_ext_past_eof2/name | 1 + 4 files changed, 15 insertions(+) create mode 100644 tests/f_uninit_ext_past_eof2/expect.1 create mode 100644 tests/f_uninit_ext_past_eof2/expect.2 create mode 100644 tests/f_uninit_ext_past_eof2/image.gz create mode 100644 tests/f_uninit_ext_past_eof2/name diff --git a/tests/f_uninit_ext_past_eof2/expect.1 b/tests/f_uninit_ext_past_eof2/expect.1 new file mode 100644 index 0000000..eb8248e --- /dev/null +++ b/tests/f_uninit_ext_past_eof2/expect.1 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 12/16 files (8.3% non-contiguous), 70/100 blocks +Exit status is 0 diff --git a/tests/f_uninit_ext_past_eof2/expect.2 b/tests/f_uninit_ext_past_eof2/expect.2 new file mode 100644 index 0000000..eb8248e --- /dev/null +++ b/tests/f_uninit_ext_past_eof2/expect.2 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 12/16 files (8.3% non-contiguous), 70/100 blocks +Exit status is 0 diff --git a/tests/f_uninit_ext_past_eof2/image.gz b/tests/f_uninit_ext_past_eof2/image.gz new file mode 100644 index 0000000000000000000000000000000000000000..c739e499475a47d2ebc8247a5e448b4bba310e33 GIT binary patch literal 989 zcmb2|=HN&!{}{-`oSB=Lp33m{?&-HnDjN)9*m@;5EB6MJk~o>pKb zdsJgq)_(n;U+0{&J%776?_HXoGsCr2+awknUOQT0<7Vi#Zr=gnsUA=J&fK;9=++aX zF};1?+0>`I9=+eXXlvC{iO+`fdOs%FwR}(db#ZO`Ion@PA9~Nvv-utiCQrvi9f7)AP6FWd8o~b#~?+>DAX?J^!fibau_OcOMzO`$HE9BuDqm zz4=f7*w?5v(aX1Uy%YFTKlQZt(KH)zzHiBVw zL*f$ycyLWpfK0F&_@&D(Q@|{`HFRQfd3raG6eE67rSiOIL(R-i1fbjik z!BV&HEYpc!J^$FR&`|Hgf3n`bfAjWr{jUA{zdOX|U;e1No89`*+lfItDnGwSe`xnO zJA22zf(;_;_C=q%m6>Dzcb~-beLreGzt)t!AH&7`c=nKBwO{3y87?cS@qc;m$L&?~^^cs7+U5Ol=c~V~*T?6q zsNcGb`}h63xSRivnyh~} z^>2R1&y^cz-dx$aVPPT5>0keMR{r1mO+5Mb_SswR%YD9FEL^?(n4aIcp096S&YZhT z;FdP)w5|V7zdyhJD7UubmaGYZSj$ zuacUo-TLOg;PS~Hmm($BmKUGy(>%?3eA>tFXXE?qzlnEiU$0-c>)*d!W!uZI?w&T! z{`YL#|DSIDbelSPLYQ6sB}uE-at{B)Fa46{d3dGkdA#19sY{tl&+ospw<>z|%lVee dU*7sL?e)J)DDEJcbKvhEu8<}N4TcGf3;?{p01W^D literal 0 HcmV?d00001 diff --git a/tests/f_uninit_ext_past_eof2/name b/tests/f_uninit_ext_past_eof2/name new file mode 100644 index 0000000..352a0f5 --- /dev/null +++ b/tests/f_uninit_ext_past_eof2/name @@ -0,0 +1 @@ +fallocated extents after nonzero i_size and total extents > 4