From patchwork Sun Jan 7 18:07:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10148425 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 D9233601BE for ; Sun, 7 Jan 2018 18:06:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE9BD28628 for ; Sun, 7 Jan 2018 18:06:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C38F428633; Sun, 7 Jan 2018 18:06:47 +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 5AB9628628 for ; Sun, 7 Jan 2018 18:06:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754363AbeAGSGq (ORCPT ); Sun, 7 Jan 2018 13:06:46 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:39189 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754273AbeAGSGn (ORCPT ); Sun, 7 Jan 2018 13:06:43 -0500 Received: by mail-wm0-f66.google.com with SMTP id i11so10476228wmf.4; Sun, 07 Jan 2018 10:06:43 -0800 (PST) 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=6ySj+x7Ow3AW7vejMbA2DrWxDvsIoaVZt4P+TpzpCE0=; b=qj4ej7PQGs0IKriAD3jXI4ZBuyVycJC0WXnaAUXpy2MLwFhmaoR20S+dFKpPPSmzwn DQbL61eqi6az2xzkDc4PR7V30IhQb6xivtBF4ELHSwAi6lbNp8tADx/W6RJS48lAY2Ja Rv2hPfmxW4Zy+oA6YT1Lz5CjJq9q/TC1pPmSLi5PpROkpS4yJGZPN10OQerY7nDIjcft x/HD6+1CnMdKC3Ng/8VVBSwNr8SgAsuWFWLaShN8P5tGnj05CbV5RDghfTYjqj5N6N8r o4x77+rLM1Wv56FipLxLWhQ1QdqANt/7Kv802tHMtJ0C3OGmYHLVYEMsEORv4p39L9Eh UHYg== 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=6ySj+x7Ow3AW7vejMbA2DrWxDvsIoaVZt4P+TpzpCE0=; b=XmP63PIpJwD27DAcj0Oo6DAf2TCX1mkLt39blKsRoCmW9SUgtb840VItJRpHeZs6gt 261pKIhx0C5kbOF+wVBvYebIgWYB0YxfZUMJu+/g5E0rXccJEDejjI2o3yeH9KhUSOWT FXCyyJAPt8Xf5W/yKlb6FnyW0G68cQ7NbxpLiwdG9sQqRJFIm9jnGsD9rtGSQG0qQQ3t N/yLalpVtdG+izQchqM7a+F4BtVAk50CcJveQTqW+xrAv9pGkIFTHKo1XuXeiK6Iwq7R bKfDgeO3Dxbywikk3UQS4tMOfxoH+ABmr7VpNvgyHbo5RcmcIzqXY7RnZic14oDNy0y0 QzDw== X-Gm-Message-State: AKGB3mKfId5AYUmdlelkyN9yAbxwnEQF2a7HdQCLh+CpRq/uv2aB6Blu 8JhW4asUAv/4mEc+Vp1epi4= X-Google-Smtp-Source: ACJfBosUIfaD1LRttu38hEaBK8LEnjdg8tRKbooVEWfduO3tjZz1fdsK2z9RZAwNrSIVRozyYDCQXw== X-Received: by 10.28.11.75 with SMTP id 72mr6459595wml.158.1515348402427; Sun, 07 Jan 2018 10:06:42 -0800 (PST) Received: from localhost.localdomain (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id k42sm11433750wrf.37.2018.01.07.10.06.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Jan 2018 10:06:41 -0800 (PST) From: Amir Goldstein To: Eryu Guan Cc: Jeff Layton , "J . Bruce Fields" , Miklos Szeredi , fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: [PATCH 5/7] generic/exportfs: add a test case for renamed parent dir Date: Sun, 7 Jan 2018 20:07:23 +0200 Message-Id: <1515348445-1403-6-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515348445-1403-1-git-send-email-amir73il@gmail.com> References: <1515348445-1403-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 Check that a dir file handle can be opened after its parent has been renamed. Retry decoding subdir file handle when parent is in dcache and when parent is not in dcache. Signed-off-by: Amir Goldstein --- tests/generic/467 | 7 +++++++ tests/generic/467.out | 3 +++ 2 files changed, 10 insertions(+) diff --git a/tests/generic/467 b/tests/generic/467 index 592ffbe..555b44b 100755 --- a/tests/generic/467 +++ b/tests/generic/467 @@ -67,6 +67,7 @@ create_test_files() local opt=$2 rm -rf $dir + mkdir -p $dir $here/src/open_by_handle -cwp $dir $NUMFILES } @@ -114,12 +115,18 @@ test_file_handles $TEST_DIR -r -i $tmp.file_handles # Check non-stale file handles of renamed dirs create_test_files $testdir +create_test_files $testdir/subdir rm -rf $testdir.renamed # Store file handles before rename of testdir test_file_handles $testdir -p -o $tmp.file_handles +test_file_handles $testdir/subdir -p -o $tmp.subdir_file_handles mv $testdir $testdir.renamed/ # Check open, read and readdir from stored file handles test_file_handles $TEST_DIR -rp -i $tmp.file_handles +test_file_handles $TEST_DIR -rp -i $tmp.subdir_file_handles +# Retry decoding subdir file handle when testdir is in dcache +# (providing renamed testdir argument pins testdir to dcache) +test_file_handles $testdir.renamed -rp -i $tmp.subdir_file_handles status=0 exit diff --git a/tests/generic/467.out b/tests/generic/467.out index c29289e..dfa3240 100644 --- a/tests/generic/467.out +++ b/tests/generic/467.out @@ -8,4 +8,7 @@ test_file_handles TEST_DIR/467-dir -mr test_file_handles TEST_DIR/467-dir -o file_handles test_file_handles TEST_DIR -r -i file_handles test_file_handles TEST_DIR/467-dir -p -o file_handles +test_file_handles TEST_DIR/467-dir/subdir -p -o subdir_file_handles test_file_handles TEST_DIR -rp -i file_handles +test_file_handles TEST_DIR -rp -i subdir_file_handles +test_file_handles TEST_DIR/467-dir.renamed -rp -i subdir_file_handles