From patchwork Wed Jun 13 22:25:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10462991 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 26E966020A for ; Wed, 13 Jun 2018 22:27:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1035F28BC9 for ; Wed, 13 Jun 2018 22:27:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0509F28CEF; Wed, 13 Jun 2018 22:27:17 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY 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 9DEA428BD5 for ; Wed, 13 Jun 2018 22:27:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935320AbeFMW1Q (ORCPT ); Wed, 13 Jun 2018 18:27:16 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:56460 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935256AbeFMW1P (ORCPT ); Wed, 13 Jun 2018 18:27:15 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5DMIh6Q077505; Wed, 13 Jun 2018 22:26:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=RZrY9y71+Mo2tHQ64oVeGFQehkkDKW8znBsEg1jSp7s=; b=WXdZGB436IpRMmwhXBtOPcqE54xiaY/pkQSfVgSevbjbCEKVNyZsMMl4rCVseAWE4ZwI vtnGcfRW1DaTO9L6omJklWHHqsy1A8nfvDGGIv7Vo83omhW+1BJ+2mcL8y6sTYY4cv0r fLHIzo9D9UwnIET1O5XoaGDxv4k6tgXX4sZNlEgaBQsAJGyKTQJCv+EhAe4o3hvqrX4V wNKQBw8ywN20NKIOaLebMqM1NfpfJes4t9aRtYh+i3KEgmEy1R7ua+EAuRq2dV5C9/l2 z3WNk38Fc+LsDT5ij2jnyQuDl5k630LejL8vp41KB0xr6eAruIapyBtQRZ7MbSPSIgyR aA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2jk0xrakj1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Jun 2018 22:26:00 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5DMQ0Ew030139 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Jun 2018 22:26:00 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w5DMPxlT000366; Wed, 13 Jun 2018 22:25:59 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 13 Jun 2018 15:25:59 -0700 Date: Wed, 13 Jun 2018 15:25:58 -0700 From: "Darrick J. Wong" To: Ross Zwisler Cc: Eryu Guan , fstests@vger.kernel.org, linux-nvdimm@lists.01.org Subject: Re: [fstests PATCH] generic/223: skip when using DAX Message-ID: <20180613222558.GA9432@magnolia> References: <20180613210742.28148-1-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180613210742.28148-1-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8923 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806130238 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Jun 13, 2018 at 03:07:42PM -0600, Ross Zwisler wrote: > As of these upstream kernel commits: > > commit 6e2608dfd934 ("xfs, dax: introduce xfs_dax_aops") > commit 5f0663bb4a64 ("ext4, dax: introduce ext4_dax_aops") > > generic/223 fails on XFS and ext4 because filesystems mounted with DAX no > longer support bmap. This is desired behavior and will not be fixed, > according to: > > https://lists.01.org/pipermail/linux-nvdimm/2018-April/015383.html > > So, just skip over generic/223 when using DAX so we don't throw false > positive test failures. Just because we decided not to support FIBMAP on XFSDAX doesn't mean we should let this test bitrot. :) Just out of curiosity, does the following patch fix g/223 for you? --D --- 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/src/t_stripealign.c b/src/t_stripealign.c index 05ed36b5..690f743a 100644 --- a/src/t_stripealign.c +++ b/src/t_stripealign.c @@ -17,8 +17,13 @@ #include #include #include +#include +#include -#define FIBMAP _IO(0x00, 1) /* bmap access */ +#define FIEMAP_EXTENT_ACCEPTABLE (FIEMAP_EXTENT_LAST | \ + FIEMAP_EXTENT_DATA_ENCRYPTED | FIEMAP_EXTENT_ENCODED | \ + FIEMAP_EXTENT_UNWRITTEN | FIEMAP_EXTENT_MERGED | \ + FIEMAP_EXTENT_SHARED) /* * If only filename given, print first block. @@ -28,11 +33,14 @@ int main(int argc, char ** argv) { - int fd; - int ret; - int sunit = 0; /* in blocks */ - char *filename; - unsigned int block = 0; + struct stat sb; + struct fiemap *fie; + struct fiemap_extent *fe; + int fd; + int ret; + int sunit = 0; /* in blocks */ + char *filename; + unsigned long long block; if (argc < 3) { printf("Usage: %s \n", argv[0]); @@ -48,21 +56,63 @@ int main(int argc, char ** argv) return 1; } - ret = ioctl(fd, FIBMAP, &block); - if (ret < 0) { + ret = fstat(fd, &sb); + if (ret) { + perror(filename); close(fd); - perror("fibmap"); return 1; } - close(fd); + fie = calloc(1, sizeof(struct fiemap) + sizeof(struct fiemap_extent)); + if (!fie) { + close(fd); + perror("malloc"); + return 1; + } + fie->fm_length = 1; + fie->fm_flags = FIEMAP_FLAG_SYNC; + fie->fm_extent_count = 1; + + ret = ioctl(fd, FS_IOC_FIEMAP, fie); + if (ret < 0) { + unsigned int bmap = 0; + + ret = ioctl(fd, FIBMAP, &bmap); + if (ret < 0) { + perror("fibmap"); + free(fie); + close(fd); + return 1; + } + block = bmap; + goto check; + } + + if (fie->fm_mapped_extents != 1) { + printf("%s: no extents?\n", filename); + free(fie); + close(fd); + return 1; + } + fe = &fie->fm_extents[0]; + if (fe->fe_flags & ~FIEMAP_EXTENT_ACCEPTABLE) { + printf("%s: bad flags 0x%x\n", filename, fe->fe_flags); + free(fie); + close(fd); + return 1; + } + + block = fie->fm_extents[0].fe_physical / sb.st_blksize; +check: if (block % sunit) { - printf("%s: Start block %u not multiple of sunit %u\n", + printf("%s: Start block %llu not multiple of sunit %u\n", filename, block, sunit); return 1; } else printf("%s: well-aligned\n", filename); + free(fie); + close(fd); return 0; }