From patchwork Fri Jan 4 08:19:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Tao X-Patchwork-Id: 10748123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99C0A17E6 for ; Fri, 4 Jan 2019 08:16:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AC2727C2D for ; Fri, 4 Jan 2019 08:16:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 777B227F4B; Fri, 4 Jan 2019 08:16:04 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 B4B3027F81 for ; Fri, 4 Jan 2019 08:16:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725919AbfADIQD (ORCPT ); Fri, 4 Jan 2019 03:16:03 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:44279 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726786AbfADIQC (ORCPT ); Fri, 4 Jan 2019 03:16:02 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 390E7584DC47F for ; Fri, 4 Jan 2019 16:15:59 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Fri, 4 Jan 2019 16:15:53 +0800 From: Hou Tao To: CC: Subject: [PATCH v2 2/2] fsx: check ENOSYS in test_copy_range() & test_fallocate() Date: Fri, 4 Jan 2019 16:19:27 +0800 Message-ID: <20190104081927.112622-3-houtao1@huawei.com> X-Mailer: git-send-email 2.16.2.dirty In-Reply-To: <20190104081927.112622-1-houtao1@huawei.com> References: <20190104081927.112622-1-houtao1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In configure script, we only check whether or not the build of test program succeeds, but that doesn't mean the kernel has implemented the syscall, so checking for this case. Signed-off-by: Hou Tao Reviewed-by: Darrick J. Wong --- v2: * also check ENOSYS for fallocate syscall --- ltp/fsx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ltp/fsx.c b/ltp/fsx.c index 316f08eb..f4a1c7cf 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -1583,7 +1583,7 @@ test_copy_range(void) loff_t o1 = 0, o2 = 0; if (syscall(__NR_copy_file_range, fd, &o1, fd, &o2, 0, 0) == -1 && - (errno == EOPNOTSUPP || errno == ENOTTY)) { + (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTTY)) { if (!quiet) fprintf(stderr, "main: filesystem does not support " @@ -2423,7 +2423,8 @@ __test_fallocate(int mode, const char *mode_str) #ifdef HAVE_LINUX_FALLOC_H int ret = 0; if (!lite) { - if (fallocate(fd, mode, file_size, 1) && errno == EOPNOTSUPP) { + if (fallocate(fd, mode, file_size, 1) && + (errno == ENOSYS || errno == EOPNOTSUPP)) { if(!quiet) fprintf(stderr, "main: filesystem does not support "