From patchwork Tue Jul 4 11:20:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9824597 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 497F6602F0 for ; Tue, 4 Jul 2017 11:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39FF22844E for ; Tue, 4 Jul 2017 11:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E21A28469; Tue, 4 Jul 2017 11:20:26 +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 BA58E2844E for ; Tue, 4 Jul 2017 11:20:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752306AbdGDLUZ (ORCPT ); Tue, 4 Jul 2017 07:20:25 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:32823 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299AbdGDLUY (ORCPT ); Tue, 4 Jul 2017 07:20:24 -0400 Received: by mail-wm0-f67.google.com with SMTP id j85so25602117wmj.0; Tue, 04 Jul 2017 04:20:23 -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=89VS+9pc+evo9vPi0AxxxOUJK/dKBLYhjWzMraAua20=; b=fByqYITK7E1ECttc+WOY272O7ETzvk9tPFjLHz/KX4kAdQpHZWzj5VLtZorGXNjsp9 DRJhnvpXT8IE+fWOVmTuAkl/eBka6BpIIk1+pA0WR3cg3BU1ywk9mlyzEmErB3GeHfn0 TtNjD+iA7g9mUYyDui+mSiDjtX6VNNjyg2M3bre5F/xa5ms1sf+zCjeMMPti23fiJPjd DA7h3imKTJigKnO7ujMOvFCie9JTKu+xbdTnm/8L6238UOjmDC/irhANh0KvXIiYtlqH wptc9wiNhhni2qTihDT6mtF6TJX/b13JZZasQSQAwoKh39hxN8RqdaKhlWj0Cm1cueML r7lQ== 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=89VS+9pc+evo9vPi0AxxxOUJK/dKBLYhjWzMraAua20=; b=pOQvWtF34plQe1X2NZa/UeNflZ3j86mELGcx87BmWS0C5YMdvpHuaE2kHZTsfzCIyx OlW0kojvZHnxYT+4/ul0Dhx4k9dt7IRv8EURc5UXYM0/bmmWtGDHn6XyIjdTnZmr2Sav qyR4Cs4jtE+Ajo5OI4YaPomuQIWojh5k5BCoFW238QEEIomSNrQRR3K1hGoMuR9GZstj r4RWZkKtR9AT/wLJKv1Tu5HJFz0APhaPQMx/VRUnLDWeurlY1Bvap5lHlVGUTUIEntaW QxP4OblAppHh4BGMMZ1gl+E/Zjjc5PDKgWLCbuvdbH26uz+iCRKuEitzg4hPrtxGCt6D z8LA== X-Gm-Message-State: AKS2vOyMuwSrbKoyg0q6v5CiH5OHlooVyw77D288IkzWSFWCFhdy+JIX BJ+zzv+YwtTIGOJY X-Received: by 10.28.229.80 with SMTP id c77mr19641771wmh.31.1499167223122; Tue, 04 Jul 2017 04:20:23 -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.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 04:20:22 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 4/6] overlay/018: test lower hardlinks re-unite on copy up Date: Tue, 4 Jul 2017 14:20:32 +0300 Message-Id: <1499167234-22779-5-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 Test that when two lower hardlinks are copied up, they end up as two upper hardlinks of the same upper inode. Drop caches before copy up so there is no knowledge of the copied up hardlink in inode/dcache. Signed-off-by: Amir Goldstein --- tests/overlay/018 | 10 ++++++++++ tests/overlay/018.out | 7 +++++++ tests/overlay/group | 1 + 3 files changed, 18 insertions(+) diff --git a/tests/overlay/018 b/tests/overlay/018 index 46097a9..41855dc 100755 --- a/tests/overlay/018 +++ b/tests/overlay/018 @@ -111,5 +111,15 @@ echo "== After mount cycle ==" cat $FILES check_ino_nlink $tmp.after_one $tmp.after_cycle +# Drop caches to get the copied up hardlink out of cache +echo 3 > /proc/sys/vm/drop_caches + +# Modify content of the other hardlink +echo "two" >> $foo + +echo "== After write two ==" +cat $FILES +check_ino_nlink $tmp.after_one $tmp.after_two + status=0 exit diff --git a/tests/overlay/018.out b/tests/overlay/018.out index 5b74ee1..adc7f72 100644 --- a/tests/overlay/018.out +++ b/tests/overlay/018.out @@ -12,3 +12,10 @@ zero one zero one +== After write two == +zero +one +two +zero +one +two diff --git a/tests/overlay/group b/tests/overlay/group index 28df5b6..2baba3a 100644 --- a/tests/overlay/group +++ b/tests/overlay/group @@ -34,3 +34,4 @@ 029 auto quick 030 auto quick perms 031 auto quick whiteout +032 auto quick copyup hardlink