From patchwork Tue Jul 4 11:40: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: 9824641 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 3A0E960237 for ; Tue, 4 Jul 2017 11:40:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BF4C2811E for ; Tue, 4 Jul 2017 11:40:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20B302844E; Tue, 4 Jul 2017 11:40: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 B78CD2844C for ; Tue, 4 Jul 2017 11:40:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752051AbdGDLkZ (ORCPT ); Tue, 4 Jul 2017 07:40:25 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33136 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131AbdGDLkY (ORCPT ); Tue, 4 Jul 2017 07:40:24 -0400 Received: by mail-wm0-f67.google.com with SMTP id j85so25713518wmj.0; Tue, 04 Jul 2017 04:40: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=3SZrY41VyN6oTL+BljCbtIJ51biyGW8dc5Dl0MiGwdY=; b=W7UF8xHHDvtkFz6RK/MI4G/E2uSWqKfo1PCffniz4cc2wTTOhkd+H/OfB5nvJ2VrkB oOUrepShU85IZ16ayY7c9iq4+sDaZwGCJdB5uHX7FvVyKKk6vW/BaWd7368SAAGBww/p 2VZ9ZJSgx3eNIKd91+IMpJPAJ4Vcqxo2LO9GEAmtPpDaAt/Swu0DWF8nvrX7BzptueEz jO1omQJUZanMWmfx0ugeHbXO7OfqvWd29TgrB6t0jnSQqV+OaXsao1oq2gyHStxjJRTg ISQHvVuEYNOPR9GyvJv5tobrYQhIqDqdNWCbBNQMlcI/CpBrMlVT+cb/PALZi11qmzem Q7Qg== 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=dCRQ+mVmNl5t3K8htbSKBjfLLuKMQBWSHYiaMaB3lh0K7KzhwaCYlpgAOmVLPiaxap 73iA1ONIRH9IlghPKT5U9YlVepd2981XRFMhrCDTIKEJFbW5MjbQtgIL/qSCnuH8ii24 2f1GTWz/Wa28E1yPAXkSbZm88oqGdxchFiVoDi76gy4zUxdlx8Ic9aMCDuwFE2LZJfNR z7ojirydJg92QgmFpMPgOPXWuWe1UOvCWcZpEt5og7djf+YuNtDiquI4gGEy6nTCnWvj 5tS4KyO22Zo/2MQKaiu8gdyvyF7woIwXYAXXwFVk3dIziRGfzyCy4QrlJmFkaCnsiE8o BRLw== X-Gm-Message-State: AIVw111jTciwwYgMuG50oy5GUDVGQOUwbcmXEA2oih/W/t6UWQcZ6UAz B8Tq09mqOXxfDbv2 X-Received: by 10.28.211.20 with SMTP id k20mr6858734wmg.123.1499168422799; Tue, 04 Jul 2017 04:40:22 -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 90sm18842912wrk.38.2017.07.04.04.40.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 04:40:22 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v2 4/7] overlay/018: test lower hardlinks re-unite on copy up Date: Tue, 4 Jul 2017 14:40:31 +0300 Message-Id: <1499168434-23859-5-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499168434-23859-1-git-send-email-amir73il@gmail.com> References: <1499168434-23859-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