From patchwork Fri Apr 28 08:24:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9704031 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 8A2B7602B7 for ; Fri, 28 Apr 2017 08:25:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AB7228602 for ; Fri, 28 Apr 2017 08:25:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F9E928663; Fri, 28 Apr 2017 08:25: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 2498828602 for ; Fri, 28 Apr 2017 08:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034792AbdD1IZC (ORCPT ); Fri, 28 Apr 2017 04:25:02 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33159 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034798AbdD1IYs (ORCPT ); Fri, 28 Apr 2017 04:24:48 -0400 Received: by mail-wm0-f66.google.com with SMTP id y10so9444995wmh.0; Fri, 28 Apr 2017 01:24:48 -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=6NuWpqdD94MJevFHDHVMx/5xiQg0SvF894zXobyxalM=; b=qV5K1GANNRdwjRNfV9y4fT1iob0B8tDzwdsn5j8GVNMZ0uPQtzmoKJzrESIrrKTSg7 hYX6b/UxO06bmAI+5wiFd8z9klu/dgHqnDUmsxjTX/S9hCd9mkFJLbMa7POIVXOhnbQ9 Zg8nDjNuLNLrW81C6O3nMnWH6wqKSBiDZb1AJK9/JWAu9VtLoNJ486Aaqtx84rUuYaTo uSFQLAs6c7tK8EjsVi8kmaaon/N9F0dSoGwgx1Adr1O29GOoH+W2a89W6FfgB9OXlgqd wKmUSgSHKO3/vrxFvQ6kmUxjiUffJFZi38RT8nA5prVfw1QSDpW96PxQLoG8CLOsLXuB LtEQ== 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=6NuWpqdD94MJevFHDHVMx/5xiQg0SvF894zXobyxalM=; b=pasAcsw7I9O9LyTY7K7dbqo4NbUZCW7396qsvqu550W4FYAJ73YpO2PeT79IrqsgCn hLMu0nd9wzpaEud1qe1plZ8jIgaXDtQHkflRxEUs3Nl7AfshpxNz2KDV0qs8zrwfli16 HsBJEtXhknEz7Qg5+RyzZNBh8QWxZdRwiLbKtfnBt7q5D3LS1fHsPPobtUPS6HDYPtZ+ LT0J+E+0vBYJ0sa98TL3EGx4QihgPXaEXxA/rS33H/IZ++gGOZ9Q7VHDc5BrBH/5YWw9 z4ZV7/FD+/qFi61KFzu+p2yv/qBUvf0qSYgJFSeYG6bkEZdsRJKKWBUIk7t26OEV4aE1 dKuw== X-Gm-Message-State: AN3rC/5Pkba8lwT0vk6OZYgwrnkq/VzEVxre1KYqR/MVJxVPB3ozjlGb 2O2PqvkFjcbDzbuRw04= X-Received: by 10.28.94.194 with SMTP id s185mr4663399wmb.103.1493367887153; Fri, 28 Apr 2017 01:24:47 -0700 (PDT) Received: from amir-VirtualBox.lan (bzq-79-179-55-127.red.bezeqint.net. [79.179.55.127]) by smtp.gmail.com with ESMTPSA id e67sm637836wma.9.2017.04.28.01.24.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Apr 2017 01:24:46 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , Xiong Zhou , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v2 5/6] overlay/017: verify constant inode number after rename Date: Fri, 28 Apr 2017 11:24:47 +0300 Message-Id: <1493367888-26550-6-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493367888-26550-1-git-send-email-amir73il@gmail.com> References: <1493367888-26550-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 The test verifies constant inode number after copy up. Verify that inode number remains constant also after rename and drop caches (when overlayfs needs to find the lower inodes in another location). Signed-off-by: Amir Goldstein --- tests/overlay/017 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/overlay/017 b/tests/overlay/017 index 3ff429f..fe2518b 100755 --- a/tests/overlay/017 +++ b/tests/overlay/017 @@ -8,7 +8,8 @@ # - modify A to trigger copy up # - stat file A shows inode number Y != X # -# Also test if d_ino of readdir entries changes after copy up. +# Also test if d_ino of readdir entries changes after copy up +# and if inode numbers persist after rename and drop caches. # #----------------------------------------------------------------------- # @@ -114,6 +115,8 @@ _scratch_mount rm -f $tmp.* +testdir=$SCRATCH_MNT/test +mkdir -p $testdir # Record inode numbers before copy up record_inode_numbers $SCRATCH_MNT $tmp.before @@ -126,6 +129,16 @@ done # Compare inode numbers before/after copy up check_inode_numbers $SCRATCH_MNT $tmp.before $tmp.after_copyup +for f in $FILES; do + # move to another dir + mv $SCRATCH_MNT/$f $testdir/ +done + +echo 3 > /proc/sys/vm/drop_caches + +# Compare inode numbers before/after rename and drop caches +check_inode_numbers $testdir $tmp.after_copyup $tmp.after_move + echo "Silence is golden" status=0 exit