From patchwork Tue Jul 4 11:20:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9824595 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 DDEC2602F0 for ; Tue, 4 Jul 2017 11:20:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE6782844E for ; Tue, 4 Jul 2017 11:20:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C34FD28469; Tue, 4 Jul 2017 11:20:24 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 5E9AC2844E for ; Tue, 4 Jul 2017 11:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752298AbdGDLUY (ORCPT ); Tue, 4 Jul 2017 07:20:24 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:33705 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752284AbdGDLUX (ORCPT ); Tue, 4 Jul 2017 07:20:23 -0400 Received: by mail-wr0-f194.google.com with SMTP id x23so47065792wrb.0; Tue, 04 Jul 2017 04:20:22 -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=Etb5uCo5EtRCDB5CoWVT8tn1NiO6gcY6wOoLqpcEQLyIisxVNb3g/c5gxMvA6M2YP5 RnD9SGyVHZpCnfrdjM7g56IiMycxdOxkNUVt77q9Qp7cfgJFgkJL+OuyEcJbOLgCBtPQ Sg4xnwl/6ADrBN+/LssmsLfMKHoSV9cbUTHV4/sUDOy92/OOLkbXQWbMMgUhXtP96+AS aWdniALCHR8xGMQ8Qyv5dfLpWjlJG2rUbnZQo3MRsAPfbNP53fVZDQEcqnQjbPVEGYR5 Nfh0JQ50TJiO2tbW/vH2XB38HHHm9M7cbEuESwIqJ+j4KJAZHehzB9GlZQxl2u1nnBVN 58Cg== 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=kpKtwKB60APME2NO+UV1oVS4yt571/oCuR7DIMdDdz/XWMrf3q5L0LBLeVbRcyWO46 Id6YQb+Cr6YxuaLg75Pgpo7xXqpRYFzRqhcvEqUkn1vsDo0utqinG1o7Y0hmXqwy824x p4S15EYxkNEajEOg7+RyA6XKtTIK3xS/rZ7HPjoaLi5X+Mh4GCePHxLmZN/BiWcC/+9E smI62QfPTml0ywuPl7Oz1//9QgYaS3FOTZz6/FT1IIlGZcJO6JubPIwzawW+I8plo3Hd dMH0T1S44qZIFVBwsJtIIiDZSVrUAiQ6tPGn//GM+0zN49pr51kFvvCPx9/v0tFLQJcX sOaQ== X-Gm-Message-State: AKS2vOwTkzScW6EaiGxYncsh/6uKHWD3nSW6eSL7z2GBAqvGNOG6yDUC hG82wXSMgk1fZAyd X-Received: by 10.223.150.89 with SMTP id c25mr33952669wra.15.1499167221921; Tue, 04 Jul 2017 04:20:21 -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 l20sm14121449wre.25.2017.07.04.04.20.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 04:20:21 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 3/6] overlay/018: test broken hardlinks after mount cycle Date: Tue, 4 Jul 2017 14:20:31 +0300 Message-Id: <1499167234-22779-4-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499167234-22779-1-git-send-email-amir73il@gmail.com> References: <1499167234-22779-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