From patchwork Wed Jul 5 12:02:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9826431 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 A994D603B5 for ; Wed, 5 Jul 2017 12:02:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A14D527F54 for ; Wed, 5 Jul 2017 12:02:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95F19284B5; Wed, 5 Jul 2017 12:02:03 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 3C11427F54 for ; Wed, 5 Jul 2017 12:02:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752837AbdGEMCC (ORCPT ); Wed, 5 Jul 2017 08:02:02 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:36228 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752819AbdGEMB6 (ORCPT ); Wed, 5 Jul 2017 08:01:58 -0400 Received: by mail-wr0-f193.google.com with SMTP id 77so49780091wrb.3; Wed, 05 Jul 2017 05:01:57 -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:in-reply-to:references; bh=68+FXmPfbx9w3lPGaZTJ1NQrv16fswHmMHdag/fLbJ8=; b=QRkRN7suA69Mk78LHWiQVwrBuRA8S/hyRUerGEzDtB2KnBCC95yNFtKEF7tNglHCS4 nbhOQLCbiv7B9eku+5DNchJNrR0mRJUQhHRyC8LCsZkAQza0D/0micMX4ehm1XLb3i6T hSlXdOnUhS+kcWK1CBFmtV3J6NFerCr4olbH7W9/xJupfQ2YFMKuYhkuNf6tb4bRcyUO jMPc5qHqsPWFAybc9TktiIjCqAx4zUq/90pIMas8KHY80R1RJRRVSUyKrfniajfzyVfQ iYW4AQycqhouu3dTSNK/6un00hSwMB+pspP0S7gHZgKCxq/OXbI3PASvRYUfdTb9afH+ SW0A== 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:in-reply-to :references; bh=68+FXmPfbx9w3lPGaZTJ1NQrv16fswHmMHdag/fLbJ8=; b=nNy5uvJehmMvQRG1tew2+WrBQAcOoiM6dE/B/gK0oWw+pbHwFMSNNdClYFL4r/4awA l5iEnOZRuZTZN2WNoNwqkPMqD6lOJNFdSjUwU/DqPbi6AAk9Q+Enyee1fR55lSVEoWQE 3nXyRWI3kTt2L27J9zAOen6UOXbUyFFPU2rmSz5NhIwB287mUBQ8SlqwTL8pY586JfdT WKq2DCG1hCjQ/UjhXHNkuEWJHfFvP/M6wH20lWwrb4yd8D9XV4i/2uw7aSik6CWL/i4r 8f3SIVs5wYKG9lqfsVsF+OhFtkmwh6g3RJUm/RwwRmsj+DZnkfomEFGF/ICtZvQzkOdX MJkA== X-Gm-Message-State: AKS2vOybMUnXtioR45uLjplBKKwFVPbOhCmrhH1HXF9T4Sv3w0z5za2q BsjvXOM6iHx3Hw== X-Received: by 10.223.148.129 with SMTP id 1mr40965534wrr.28.1499256111295; Wed, 05 Jul 2017 05:01:51 -0700 (PDT) Received: from amir-VirtualBox.ctera.local (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id 143sm155578wmg.9.2017.07.05.05.01.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Jul 2017 05:01:50 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v3 3/7] overlay/018: test broken hardlinks after mount cycle Date: Wed, 5 Jul 2017 15:02:02 +0300 Message-Id: <1499256126-21866-4-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499256126-21866-1-git-send-email-amir73il@gmail.com> References: <1499256126-21866-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This test checks if overlayfs hardlinks are preserved across copy up. Check if they are preserved also after copy up and mount cycle. Signed-off-by: Amir Goldstein --- tests/overlay/018 | 13 +++++++++++-- tests/overlay/018.out | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/overlay/018 b/tests/overlay/018 index 7570a16..46097a9 100755 --- a/tests/overlay/018 +++ b/tests/overlay/018 @@ -96,11 +96,20 @@ cat $FILES record_ino_nlink $tmp.before # Modify content of one of the hardlinks -echo "one" >> $foo +# Intentionally modify the last hardlink in $FILES, so after mount cycle +# when reading the first file in $FILES, last file won't be in inode/dcache +echo "one" >> $bar echo "== After write one ==" cat $FILES -check_ino_nlink $tmp.before $tmp.after +check_ino_nlink $tmp.before $tmp.after_one + +# Verify that the hardlinks survive a mount cycle +_scratch_cycle_mount + +echo "== After mount cycle ==" +cat $FILES +check_ino_nlink $tmp.after_one $tmp.after_cycle status=0 exit diff --git a/tests/overlay/018.out b/tests/overlay/018.out index 784e8bc..5b74ee1 100644 --- a/tests/overlay/018.out +++ b/tests/overlay/018.out @@ -7,3 +7,8 @@ zero one zero one +== After mount cycle == +zero +one +zero +one