From patchwork Thu Oct 11 11:45:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10636563 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 CFA4C15E2 for ; Thu, 11 Oct 2018 11:45:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD3F22B170 for ; Thu, 11 Oct 2018 11:45:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B14AD2B25C; Thu, 11 Oct 2018 11:45:31 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 58F682B170 for ; Thu, 11 Oct 2018 11:45:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726212AbeJKTMX (ORCPT ); Thu, 11 Oct 2018 15:12:23 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38018 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726071AbeJKTMW (ORCPT ); Thu, 11 Oct 2018 15:12:22 -0400 Received: by mail-wr1-f68.google.com with SMTP id a13-v6so9332534wrt.5; Thu, 11 Oct 2018 04:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=iATRRmdL8J7B/kEKMQ5EvsiGiGKAdBrKyXHeot+R0v4=; b=H69F92UZOvGJr6kcbxlA7zwTlLpu1UShxsyzskXisUTEFHoPw0Nnm698CE1VSQ/ve0 Yk6D0eyCZVLUtI9awEClZNpK67fADUCLgsUdMpV0pTG1m1UtPZxqb0NF16MaytM+F2p8 LppLlaAiBxaRtI6HUm3B6MutkJjQeSrjsDeT+NWrn7WEddXQoCv4mbsGb8Sq/fYmYD4V xXZgV9qdnmovzu0pPaDzdGI7yZfgBlK4TwX9CXtgcEzREcC0BZ4ZxR7TFt+UAc/HRUJx TlPg62o8Jx1zxCPuGNAtB7vLjgHqav8eWQUMPx2hYIiB3+jx5CO2dgRrSxqFVw7Gnv0t 98uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iATRRmdL8J7B/kEKMQ5EvsiGiGKAdBrKyXHeot+R0v4=; b=bb7Rudwi4FtM+XcsmueHdHfckaC40EZEok+CmimAZuHhcS+MhiD6h0vukDGRIE03rL EK/X5zIpby36zkMWVQ7Jq9ayKPBqAHaiOPrw7jwAYidvgJ/cTruxY+8aLpnvGVv7GfF0 g/Qc4E+PchOWQYpcHgBcVZE+r2WmL9DzM/P4SWniuNHiwKj6seoWAGHorGhBeBC1ET8t +xOj0tGtrBbOf/t5N0TIJY1DRAGXNz2VEYIUBMkyjBND1r82XoiB3fnmIi5HaA73d9CJ wIkQjy9rh3L4gTWummJJegZ0tgRL0LDdinMrFVnQso5qyBUIywD9U15h3ac+f02biPqh nneQ== X-Gm-Message-State: ABuFfojgkfsl8Rvs16Q0CsvJV1PPkZPRupl4FCMdVyeZ7EiKV8qBAaDH 47thYJ5MFL86Otm8AbjKdu4= X-Google-Smtp-Source: ACcGV63JcI1JB8Xj9GL2n37C5KVjpT1jV/wDNOfJhGqAoELJ8Y0FdktuI1vO3ziwu+lyCwXnaS0n9w== X-Received: by 2002:adf:f785:: with SMTP id q5-v6mr1189934wrp.86.1539258328818; Thu, 11 Oct 2018 04:45:28 -0700 (PDT) Received: from localhost.localdomain (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id 82-v6sm23383387wms.17.2018.10.11.04.45.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Oct 2018 04:45:28 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH] src/fiemap-tester: check for illegal block size Date: Thu, 11 Oct 2018 14:45:22 +0300 Message-Id: <20181011114522.7537-1-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There was a regression in v4.19-rc1 that caused FIGETBSZ ioctl to return 0 on an overlayfs file. That regression went unnoticed because the xfstests that run fiemap-tester program terminated in success status after not doing much instead of failing. Check for invalid value of block size returned by FIGETBSZ ioctl, so these tests can detect the regression. Signed-off-by: Amir Goldstein --- src/fiemap-tester.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fiemap-tester.c b/src/fiemap-tester.c index 97ac5ad0..5b0af478 100644 --- a/src/fiemap-tester.c +++ b/src/fiemap-tester.c @@ -561,6 +561,12 @@ main(int argc, char **argv) exit(1); } + if (blocksize <= 0) { + printf("Illegal filesystem block size\n"); + close(fd); + exit(1); + } + #ifdef HAVE_FALLOCATE /* if fallocate passes, then we can do preallocation, else not */ if (prealloc) {