All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume
Date: Thu,  7 Mar 2024 18:20:24 +0530	[thread overview]
Message-ID: <c68878cb99025b8c8465221205d5de9e40777b18.1709806478.git.anand.jain@oracle.com> (raw)
In-Reply-To: <cover.1709806478.git.anand.jain@oracle.com>

When a flakey device is configured, we have access to both the physical
device and the DM flaky device. Ensure that when the flakey device is
configured, the physical device mount fails.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 tests/btrfs/318     | 45 +++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/318.out |  3 +++
 2 files changed, 48 insertions(+)
 create mode 100755 tests/btrfs/318
 create mode 100644 tests/btrfs/318.out

diff --git a/tests/btrfs/318 b/tests/btrfs/318
new file mode 100755
index 000000000000..015950fbd93c
--- /dev/null
+++ b/tests/btrfs/318
@@ -0,0 +1,45 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2024 Oracle.  All Rights Reserved.
+#
+# FS QA Test 318
+#
+# Create multiple device nodes with the same device try mount
+#
+. ./common/preamble
+_begin_fstest auto volume tempfsid
+
+# Override the default cleanup function.
+_cleanup()
+{
+	umount $extra_mnt &> /dev/null
+	rm -rf $extra_mnt &> /dev/null
+	_unmount_flakey
+	_cleanup_flakey
+ 	cd /
+ 	rm -r -f $tmp.*
+}
+
+# Import common functions.
+. ./common/filter
+. ./common/dmflakey
+
+# real QA test starts here
+_supported_fs btrfs
+_require_scratch
+_require_dm_target flakey
+
+_scratch_mkfs >> $seqres.full
+_init_flakey
+
+_mount_flakey
+extra_mnt=$TEST_DIR/extra_mnt
+rm -rf $extra_mnt
+mkdir -p $extra_mnt
+_mount $SCRATCH_DEV $extra_mnt 2>&1 | _filter_testdir_and_scratch
+
+_flakey_drop_and_remount
+
+# success, all done
+status=0
+exit
diff --git a/tests/btrfs/318.out b/tests/btrfs/318.out
new file mode 100644
index 000000000000..5cdbea8c4b2a
--- /dev/null
+++ b/tests/btrfs/318.out
@@ -0,0 +1,3 @@
+QA output created by 318
+mount: TEST_DIR/extra_mnt: wrong fs type, bad option, bad superblock on SCRATCH_DEV, missing codepage or helper program, or other error.
+       dmesg(1) may have more information after failed mount system call.
-- 
2.39.3


  parent reply	other threads:[~2024-03-07 12:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1709806478.git.anand.jain@oracle.com>
2024-03-07 12:50 ` [PATCH 1/3] .gitignore: add src/fcntl_lock_corner_tests Anand Jain
2024-03-07 15:26   ` Zorro Lang
2024-03-07 15:55     ` Anand Jain
2024-03-07 12:50 ` [PATCH 2/3] common/rc: specify required device size Anand Jain
2024-03-07 15:16   ` Zorro Lang
2024-03-07 16:08     ` Anand Jain
2024-03-07 12:50 ` Anand Jain [this message]
2024-03-07 14:59   ` [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume Zorro Lang
2024-03-07 16:15   ` Filipe Manana
2024-03-07 16:46     ` Anand Jain
2024-03-08 12:30       ` Filipe Manana
2024-03-08 13:35         ` Anand Jain
2024-03-07 19:20   ` Zorro Lang
2024-03-08 13:38     ` Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c68878cb99025b8c8465221205d5de9e40777b18.1709806478.git.anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.