linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Omar Sandoval <osandov@osandov.com>
Cc: Linux Block Layer Mailinglist <linux-block@vger.kernel.org>,
	Linux NVMe Mailinglist <linux-nvme@lists.infradead.org>,
	Anthony Iliopoulos <ailiopoulos@suse.de>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH blktests 1/2] nvme: enable buffered_io for file-backed namespaces
Date: Thu, 17 Jan 2019 13:59:05 +0100	[thread overview]
Message-ID: <20190117125906.15479-1-jthumshirn@suse.de> (raw)

All file-based NVMe over Fabrics tests fail in my test environment as I'm
running these tests form within an initramfs. It turns out the file backing
store of the NVMe target defaults to using direct I/O which is not
available on tmpfs for obvious reasons.

If the backing store of an nvme target is file-based enable the use of
buffered I/O.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 tests/nvme/rc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/nvme/rc b/tests/nvme/rc
index eff1dd992460..ec92e41396be 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -48,7 +48,7 @@ _remove_nvmet_port() {
 _create_nvmet_ns() {
 	local nvmet_subsystem="$1"
 	local nsid="$2"
-	local blkdev="$3"
+	local backstore="$3"
 	local uuid="00000000-0000-0000-0000-000000000000"
 	local subsys_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}"
 	local ns_path="${subsys_path}/namespaces/${nsid}"
@@ -58,8 +58,11 @@ _create_nvmet_ns() {
 	fi
 
 	mkdir "${ns_path}"
-	printf "%s" "${blkdev}" > "${ns_path}/device_path"
+	printf "%s" "${backstore}" > "${ns_path}/device_path"
 	printf "%s" "${uuid}" > "${ns_path}/device_uuid"
+	if [[ -f ${backstore} ]]; then
+		printf 1 > "${ns_path}/buffered_io"
+	fi
 	printf 1 > "${ns_path}/enable"
 }
 
-- 
2.16.4


             reply	other threads:[~2019-01-17 12:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 12:59 Johannes Thumshirn [this message]
2019-01-17 12:59 ` [PATCH blktests 2/2] nvme: test resize of a namespace with file-backed ns Johannes Thumshirn
2019-01-18  0:04   ` Chaitanya Kulkarni
2019-01-17 23:46 ` [PATCH blktests 1/2] nvme: enable buffered_io for file-backed namespaces Chaitanya Kulkarni
2019-01-18  7:17   ` Johannes Thumshirn
2019-01-18 19:10     ` Chaitanya Kulkarni

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=20190117125906.15479-1-jthumshirn@suse.de \
    --to=jthumshirn@suse.de \
    --cc=ailiopoulos@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=osandov@osandov.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).