From patchwork Thu Mar 28 10:51:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 10874785 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 D2C151669 for ; Thu, 28 Mar 2019 10:51:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE0FC28B7D for ; Thu, 28 Mar 2019 10:51:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B10D828BE7; Thu, 28 Mar 2019 10:51:29 +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 5B9D928B7D for ; Thu, 28 Mar 2019 10:51:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726158AbfC1Kv3 (ORCPT ); Thu, 28 Mar 2019 06:51:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:57884 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725779AbfC1Kv2 (ORCPT ); Thu, 28 Mar 2019 06:51:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E4A0BBAA3 for ; Thu, 28 Mar 2019 10:51:27 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 84F361E424A; Thu, 28 Mar 2019 11:51:27 +0100 (CET) From: Jan Kara To: fstests@vger.kernel.org Cc: Jan Kara Subject: [PATCH] Fix fsx errors due to unsupported FIDEDUPERANGE Date: Thu, 28 Mar 2019 11:51:19 +0100 Message-Id: <20190328105119.31257-1-jack@suse.cz> X-Mailer: git-send-email 2.16.4 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Older kernels (prior commit 494633fac7896 "vfs: vfs_dedupe_file_range() doesn't return EOPNOTSUPP") will return EINVAL when operation is not supported. Make fsx treat this error as a sign of unsupported deduplication as well to make it usable with these older kernels. Signed-off-by: Jan Kara Reviewed-by: Darrick J. Wong --- ltp/fsx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ltp/fsx.c b/ltp/fsx.c index f4a1c7cf820b..391824bfbc68 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -1482,7 +1482,8 @@ test_dedupe_range(void) else error = 0; - if (error == EOPNOTSUPP || error == ENOTTY) { + /* Older kernels may return EINVAL... */ + if (error == EOPNOTSUPP || error == ENOTTY || error == EINVAL) { if (!quiet) fprintf(stderr, "main: filesystem does not support "