From patchwork Wed Jul 5 12:02:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9826421 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 E42D8603B5 for ; Wed, 5 Jul 2017 12:01:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D910A27F54 for ; Wed, 5 Jul 2017 12:01:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDCD9284B5; Wed, 5 Jul 2017 12:01:59 +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 8269F27F54 for ; Wed, 5 Jul 2017 12:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752836AbdGEMB6 (ORCPT ); Wed, 5 Jul 2017 08:01:58 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36432 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752663AbdGEMBy (ORCPT ); Wed, 5 Jul 2017 08:01:54 -0400 Received: by mail-wm0-f68.google.com with SMTP id y5so31937465wmh.3; Wed, 05 Jul 2017 05:01:53 -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=3SZrY41VyN6oTL+BljCbtIJ51biyGW8dc5Dl0MiGwdY=; b=ChK0uUnnmg/FvBmMXFUpthjhoCvCgKZSFakGqzja33qZ8fSeHVzeMwk/6d/vLQ15Hp K7JJGSTuHsvwccdIoikb0POGiGNhMw48rFmUOP4y/ncjhcsRTjN4Z+193wEMdz/XC6ji OqDuIVfbiuZ8+jIq4+twZa49SvKrb12XeHSStJ6aEapUorg+cuzGcZC+/nQypFleECtJ 0AQXTYuVdqqzWzCwKhA1rMnNHstQJVemrxzsIOLlHBzltNsX9KIKh920EskSTC4tbpbc KhVQCdGEF2Qs4iE0pusDp9VdH2v/Z71WPUufwabFfe/3h6h2vo3EJdOZVRLR16e1Ci4Z hiqg== 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=3SZrY41VyN6oTL+BljCbtIJ51biyGW8dc5Dl0MiGwdY=; b=PvyXXmMQ4DBvONdnQf0M00Qf8gxrRZ3wQ+pS+5aLoYBEm5RfYmLKIhv3+JXP3erjAC w4cktcEkVtKzgwNSbW9LlSys7f5rhmZppbBuOxGcYd/nC3XJ9texqkhyfdaStgtND5wF YCm1QSRarCNrj4b70O+2CVbkFfm0yu8J3w9PjCvosCPSsjA2PetcsITat2Jub7AbMaf+ 6u6maiKYkpdlP2YvTq4uqHJLEpEbRzlplIyhpEW1TpIcBNHGuegywoPtvxOH175N34hi T7V7H5q6oL68eSozxt2vv57UJTJgkoxfFybb4aw+PX2pMOqioqxomqa7/luxh2dkZrDO dcoQ== X-Gm-Message-State: AKS2vOyyreLzT/uTr8emHBsBsdMFfon+FyYjfHTIZbmWfjvSvULbplRW QM8iyb7md2TeYfgj X-Received: by 10.28.232.29 with SMTP id f29mr20532225wmh.55.1499256112850; Wed, 05 Jul 2017 05:01:52 -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.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Jul 2017 05:01:52 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v3 4/7] overlay/018: test lower hardlinks re-unite on copy up Date: Wed, 5 Jul 2017 15:02:03 +0300 Message-Id: <1499256126-21866-5-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 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 +++++++ 2 files changed, 17 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