Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp275723pxb; Wed, 24 Feb 2021 01:36:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJymTxCy1zy22pkE2/Xs0/xGBJlefuWpA0fpm+/jze0s+FAq9jDnYUrQiX+lhmZwYO1bNhgh X-Received: by 2002:a05:6402:1853:: with SMTP id v19mr10691606edy.10.1614159410481; Wed, 24 Feb 2021 01:36:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1614159410; cv=pass; d=google.com; s=arc-20160816; b=0vvBQ4vKSX5jcLTuuQJnoBUP4T3aWtURxPVODWhr2qOqJGjI8RIP/IorLPt0KYc4Vy yKhZFtRkb5Yi4RpWasuwRke6WFKSTGbwk61CCyC2tUCEpUdCRCloaGMw4Kmi5UumHu2I /2W6RSmFb6mmyrQmw72qvEE/ySXdI/Y/YsKm2fMB6FW/WB5E+PfrGtlHDH+3PJ2/cRgJ KbUS7Mh+mJC8BnDUAvf47UcCCXupCvQ6PLK+xHjnSMVTqtU5KtTFkCFQYFjW5D2tBaA/ jXUJcSPjju2Nvn7/onpSHX/eReMtVX0D4LW9TGA7k+wcpwsjXIL/cZMhdDhyhoWQPVs/ dbsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to :reply-to:from:date:dkim-signature; bh=o0fTyu9G7rUFQ/OGzxoVzPpUOsLKeXJKJVGoEv++MPM=; b=y5mEGsFBdqch10igLVFS6wEmExJIKxEd9xDBa6fqcIneNt11SX5BIOPuj8n5LpI2Gi JZpgDASYSQzjCTtaa9uvgK0t2bPIq7LcKxFh7siK7bXdsQqoVx4ApKcEXs7ze+VIqF6g BIdj6+eZD5NAo465cUcPxU2URZe42+nEwHRZPoXyhPjLaHkPpOLVMnpCFYtSOHc2mhQi UEXLRJRWNktelOVSlUnKLO09KuFpRWjVz387p3lGXptBIVj8yrDDuJWdO1BBTFdSl0Mw o2IAWXUetRjlOqyUnHuuN3xcM2v5f2UxNrLs0uDKUhTLo+VlhaQe+hVVAshHJ3I1Yhbg EyUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=a33ekXQ+; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si703299eds.603.2021.02.24.01.36.24; Wed, 24 Feb 2021 01:36:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=a33ekXQ+; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234631AbhBXJfy (ORCPT + 99 others); Wed, 24 Feb 2021 04:35:54 -0500 Received: from sender2-op-o12.zoho.com.cn ([163.53.93.243]:17192 "EHLO sender2-op-o12.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234349AbhBXJfF (ORCPT ); Wed, 24 Feb 2021 04:35:05 -0500 X-Greylist: delayed 1056 seconds by postgrey-1.27 at vger.kernel.org; Wed, 24 Feb 2021 04:35:04 EST ARC-Seal: i=1; a=rsa-sha256; t=1614158188; cv=none; d=zoho.com.cn; s=zohoarc; b=FxQ9+njD8BI+w4IsRFrbyodzDlxedvroizBe6xmI0aRo8PXPHtHufHTx3MvrbJjapalK5mT1vozqjl1hFs3SNfiAnvLjG2qZSbXSlZ8DNUeVa2Y0LeFoz3zbifrM+cIy+S8MLCXHkun9UTWW/qAslHheoL1aFI8920ZzdyRHmdU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1614158188; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:Reply-To:References:Subject:To; bh=o0fTyu9G7rUFQ/OGzxoVzPpUOsLKeXJKJVGoEv++MPM=; b=Xr6QmbCX/yZdKNtTsTVA/QcZVZ6PEM7oXw0VyawctekgxxfLG9Z7bd8Uq7cjin0l4Q+D+hu/+JAXSuek2Bm6kQuI8rpT0+eDLEiMcE2N3vRQ+Q4G0u4IkkrvkCJORSFuXGaoyQY7i1/vbYowLViwjDtReL/AKaGN/WuTnGiHAd8= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1614158188; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=Date:From:Reply-To:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=o0fTyu9G7rUFQ/OGzxoVzPpUOsLKeXJKJVGoEv++MPM=; b=a33ekXQ+rFtOCjV0llSSmqK94Te6QLAySW1vxcN2rx5wFMz07X9ZPVVO+mmKOupE V+xc9tOeHXI0k3xf1MLs+bKSpAxY5510o2EQjAflU5A4Eo490oFSMYZf9bSI6C4avv4 Ft5VVfeeeGqXa1D+HzT/2BVEnans3qJJN1/dx/LE= Received: from mail.baihui.com by mx.zoho.com.cn with SMTP id 1614158186224958.4758690489913; Wed, 24 Feb 2021 17:16:26 +0800 (CST) Date: Wed, 24 Feb 2021 17:16:26 +0800 From: Chengguang Xu Reply-To: cgxu519@mykernel.net To: "Su Yue" Cc: "guaneryu" , "fstests" , "linux-fsdevel" , "linux-ext4" , "linux-xfs" , "linux-btrfs" Message-ID: <177d35346ec.11233c59d16029.4880134583713959983@mykernel.net> In-Reply-To: <177d33c0982.10b8858b515683.1169986601273192029@mykernel.net> References: <20210223134042.2212341-1-cgxu519@mykernel.net> <4ki1rjgu.fsf@damenly.su> <177d33c0982.10b8858b515683.1169986601273192029@mykernel.net> Subject: Re: [PATCH] generic/473: fix expectation properly in out file MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Importance: Medium User-Agent: ZohoCN Mail X-Mailer: ZohoCN Mail Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org ---- =E5=9C=A8 =E6=98=9F=E6=9C=9F=E4=B8=89, 2021-02-24 16:51:03 Chengguang= Xu =E6=92=B0=E5=86=99 ---- > ---- =E5=9C=A8 =E6=98=9F=E6=9C=9F=E4=B8=89, 2021-02-24 15:52:17 Su Yue = =E6=92=B0=E5=86=99 ---- > >=20 > > Cc to the author and linux-xfs, since it's xfsprogs related. > >=20 > > On Tue 23 Feb 2021 at 21:40, Chengguang Xu =20 > > wrote: > >=20 > > > It seems the expected result of testcase of "Hole + Data" > > > in generic/473 is not correct, so just fix it properly. > > > > >=20 > > But it's not proper... > >=20 > > > Signed-off-by: Chengguang Xu > > > --- > > > tests/generic/473.out | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/tests/generic/473.out b/tests/generic/473.out > > > index 75816388..f1ee5805 100644 > > > --- a/tests/generic/473.out > > > +++ b/tests/generic/473.out > > > @@ -6,7 +6,7 @@ Data + Hole > > > 1: [256..287]: hole > > > Hole + Data > > > 0: [0..127]: hole > > > -1: [128..255]: data > > > +1: [128..135]: data > > > > > The line is produced by `$XFS_IO_PROG -c "fiemap -v 0 65k" $file |=20 > > _filter_fiemap`. > > 0-64k is a hole and 64k-128k is a data extent. > > fiemap ioctl always returns *complete* ranges of extents. Finally, I found btrfs returns *complete* rangne of extents but xfs/ext4 do= es not. :-/ [root@VM-89-226-centos /test]# xfs_io -c "fiemap 0 65k" a a: 0: [0..127]: hole 1: [128..255]: 24576..24703 [root@VM-89-226-centos /test]# xfs_io -c "fiemap 0 128k" a a: 0: [0..127]: hole 1: [128..255]: 24576..24703 >=20 > Manual testing result in latest kernel like below. >=20 > [root@centos test]# uname -a > Linux centos 5.11.0+ #5 SMP Tue Feb 23 21:02:27 CST 2021 x86_64 x86_64 x= 86_64 GNU/Linux >=20 > [root@centos test]# xfs_io -V > xfs_io version 5.0.0 >=20 > [root@centos test]# stat a > File: a > Size: 4194304 Blocks: 0 IO Block: 4096 regular file > Device: fc01h/64513d Inode: 140 Links: 1 > Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) > Access: 2021-02-24 16:33:20.235654140 +0800 > Modify: 2021-02-24 16:33:25.070641521 +0800 > Change: 2021-02-24 16:33:25.070641521 +0800 > Birth: - > =20 > [root@centos test]# xfs_io -c "pwrite 64k 64k" a > wrote 65536/65536 bytes at offset 65536 > 64 KiB, 16 ops; 0.0000 sec (992.063 MiB/sec and 253968.2540 ops/sec) >=20 > [root@VM-8-4-centos test]# xfs_io -c "fiemap -v 0 65k" a > a: > EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS > 0: [0..127]: hole 128 > 1: [128..135]: 360..367 8 0x1 > =20 > [root@centos test]# xfs_io -c "fiemap -v 0 128k" a > a: > EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS > 0: [0..127]: hole 128 > 1: [128..255]: 360..487 128 0x1 >=20 >=20 > >=20 > > You may ask why the ending hole range is not aligned to 128 in=20 > > 473.out. Because > > fiemap ioctl returns nothing of querying holes. xfs_io does the=20 > > extra > > print work for holes. > >=20 > > xfsprogs-dev/io/fiemap.c: > > for holes: > > 153 if (lstart > llast) { > > 154 print_hole(0, 0, 0, cur_extent, lflag, true, llast,=20 > > lstart); > > 155 cur_extent++; > > 156 num_printed++; > > 157 } > >=20 > > for the ending hole: > > 381 if (cur_extent && last_logical < range_end) > > 382 print_hole(foff_w, boff_w, tot_w, cur_extent, lflag,=20 > > !vflag, > > 383 BTOBBT(last_logical), BTOBBT(range_end)); > >=20 > > > Hole + Data + Hole > > > 0: [0..127]: hole > > > 1: [128..255]: data > >=20 >=20