From patchwork Wed Mar 14 15:50:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10282557 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 55AEC6061F for ; Wed, 14 Mar 2018 15:50:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 453D32821F for ; Wed, 14 Mar 2018 15:50:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39FBB2823E; Wed, 14 Mar 2018 15:50:13 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 D75852821F for ; Wed, 14 Mar 2018 15:50:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752302AbeCNPuH (ORCPT ); Wed, 14 Mar 2018 11:50:07 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:39064 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752271AbeCNPuE (ORCPT ); Wed, 14 Mar 2018 11:50:04 -0400 Received: by mail-oi0-f50.google.com with SMTP id u190so2337879oif.6 for ; Wed, 14 Mar 2018 08:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=ajlWukfUZBEG5D0ESNrKwecmImuVF0LzYivMapEuudI=; b=Hg6iRCA28CuM4dEkb6EDzyUSKxKrrmeYeYicXbKTXrc/VgRG/LlDq0IV5ATCTe+DBY CaMsH/9y6JyRKABeI5Xasq7d4glNWV7KJyqQlKJbQdPIdk7LvW6IEjYBI4djA+1QY8Wa 4+Pkdk4V69fplGyOi/HWGfECukKO3z7eW7t8Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=ajlWukfUZBEG5D0ESNrKwecmImuVF0LzYivMapEuudI=; b=UZHvbmJhn5rv/ZdVSbRR4e8fNb4v/wMiIpVPLM2QRZWn8/PyN0Jx8XPAZnV+DxKU2b hOW+IPpa8QHo+LY/ht4yJIJLEJ7OoiHp6jjJGX28jmZPJsG8SYJf8USKVYndLjlaDxDR fgJwNL+rXTGLUDmFe3CPH2AgaQxu1AC0DGGQHB2g1M7sJ7+aVVRYaa7wBlS8tILfYUGH +7El3Qw2eT23KQRzNQA8UBuvs7mw3oMSS0Orsv/INTDrz8zQHAzBDUBr31K1DKhDhSc+ aPXI805dCJvpUKn4nmFnSw5xFO2eBVaPAiU2okgHafV+tXSwhruLl2Wzrf2jMrLq61/5 PTsA== X-Gm-Message-State: AElRT7H04qGEzfX6gm0nI4gfLgHPRbBXrUN2h0NvYVqceqV7NFwslDdB 8Amv5zxSAFQ4p62nu/iWxCLz382xG2JuuUSUiTTQIg== X-Google-Smtp-Source: AG47ELtWzRgfuHnW45zdEz3aH9B7eeUZ9RdCggUSIycMMUJMb9p8rjOyHMU/3Ft7E9bFpvW0X+URghOMwbRc3u3AEL0= X-Received: by 10.202.245.214 with SMTP id t205mr3213735oih.13.1521042603489; Wed, 14 Mar 2018 08:50:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:5403:0:0:0:0:0 with HTTP; Wed, 14 Mar 2018 08:50:02 -0700 (PDT) X-Originating-IP: [176.63.54.97] From: Miklos Szeredi Date: Wed, 14 Mar 2018 16:50:02 +0100 Message-ID: Subject: generic/127 failure on xfs with hacked fsx To: "Darrick J . Wong" Cc: linux-xfs , linux-fsdevel@vger.kernel.org, fstests Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While testing overlayfs I found something which appears to be an unwanted side effect of xfs_release(). Apply the attached patch to xfstests and run generic/127. Result is: +ltp/fsx -q -l 262144 -o 65536 -S 191110531 -N 100000 fsx_std_mmap +Mapped Read: non-zero data past EOF (0x8aa1) page offset 0xaa2 is 0xa091 +LOG DUMP (70315 total operations): Thanks, Miklos --- ltp/fsx.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -647,6 +647,14 @@ check_trunc_hack(void) } } +static void openclose(int fd) +{ + char path[32]; + + sprintf(path, "/proc/self/fd/%i", fd); + close(open(path, O_RDONLY)); +} + void doflush(unsigned offset, unsigned size) { @@ -799,6 +807,7 @@ domapread(unsigned offset, unsigned size prterr("domapread: mmap"); report_failure(190); } + openclose(fd); memcpy(temp_buf, p + pg_offset, size); check_eofpage("Read", offset, p, size);