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: 10282555 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 09003602C2 for ; Wed, 14 Mar 2018 15:50:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECD872821F for ; Wed, 14 Mar 2018 15:50:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E149D2823E; Wed, 14 Mar 2018 15:50:11 +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, T_TVD_MIME_EPI 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 2E7AD2821F for ; Wed, 14 Mar 2018 15:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752136AbeCNPuH (ORCPT ); Wed, 14 Mar 2018 11:50:07 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:33776 "EHLO mail-oi0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752274AbeCNPuE (ORCPT ); Wed, 14 Mar 2018 11:50:04 -0400 Received: by mail-oi0-f43.google.com with SMTP id e9so3107817oii.0 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=NpejH3I4V6J007why9XEC9ApVTXAjDogEkEIJhecj1sWxGhMbOPtGYmxnE0QSw9oPA 0jqyXIxhpVfbEb4DLfXCZYfore4ZM3e6zjd9WrcHCzOr+4jXtUMrXVZVgLetlzBXQFIe AKWK1TwuIcpbkJD7PxGvK3vk3wdJxQsqcitMHRtoy5Pf2+BoEzF940CwFzRITOWeRyvE LJNYaCf2/GtdbDScoUBjaCHiUOBvvybIfWmRQEm7SltLdYejYIsSHvyvgORom4upHmPC 6XMvHX4BQ8cC/ejAf62SDvkC5iBcsEN+wmYGp8fbwPn737BHMv3sSDOGlXE+Mi0bbVqj 4qFA== X-Gm-Message-State: AElRT7HX7B/hPORMT+D2Bd9lPH7/0buFtwLhv+0JDyJpytUwDxNKwi/8 p096Lhi+1EZlMgoDS1yJEr0D8FC1Jj8rqjnSO70dpA== 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-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@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);