All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christophe Varoqui <christophe.varoqui@gmail.com>
Cc: dm-devel@redhat.com
Subject: [PATCH 5/6] devmapper: do not flush I/O for DM_DEVICE_CREATE
Date: Wed,  4 May 2016 07:57:29 +0200	[thread overview]
Message-ID: <1462341450-5507-6-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1462341450-5507-1-git-send-email-hare@suse.de>

DM_DEVICE_CREATE loads a new table, so there cannot be any
I/O pending. Hence we should be setting the 'no flush'
and 'skip lockfs' flag to avoid delays during creation.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 libmultipath/devmapper.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index 04dcb72..0ae72fc 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -294,16 +294,23 @@ dm_addmap (int task, const char *target, struct multipath *mpp,
 	if (ro)
 		dm_task_set_ro(dmt);
 
-	if ((task == DM_DEVICE_CREATE) && strlen(mpp->wwid) > 0){
-		prefixed_uuid = MALLOC(UUID_PREFIX_LEN + strlen(mpp->wwid) + 1);
-		if (!prefixed_uuid) {
-			condlog(0, "cannot create prefixed uuid : %s",
-				strerror(errno));
-			goto addout;
+	if (task == DM_DEVICE_CREATE) {
+		if (strlen(mpp->wwid) > 0) {
+			prefixed_uuid = MALLOC(UUID_PREFIX_LEN +
+					       strlen(mpp->wwid) + 1);
+			if (!prefixed_uuid) {
+				condlog(0, "cannot create prefixed uuid : %s",
+					strerror(errno));
+				goto addout;
+			}
+			sprintf(prefixed_uuid, UUID_PREFIX "%s", mpp->wwid);
+			if (!dm_task_set_uuid(dmt, prefixed_uuid))
+				goto freeout;
 		}
-		sprintf(prefixed_uuid, UUID_PREFIX "%s", mpp->wwid);
-		if (!dm_task_set_uuid(dmt, prefixed_uuid))
-			goto freeout;
+		dm_task_skip_lockfs(dmt);
+#ifdef LIBDM_API_FLUSH
+		dm_task_no_flush(dmt);
+#endif
 	}
 
 	if (mpp->attribute_flags & (1 << ATTR_MODE) &&
-- 
2.6.6

  parent reply	other threads:[~2016-05-04  5:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04  5:57 [PATCH 0/6] multipath cookie handling rework Hannes Reinecke
2016-05-04  5:57 ` [PATCH 1/6] libmultipath: pass in cookie as argument for dm_simplecmd() Hannes Reinecke
2016-05-06 19:06   ` Benjamin Marzinski
2016-05-04  5:57 ` [PATCH 2/6] libmultipath: pass in 'cookie' as argument for dm_addmap() Hannes Reinecke
2016-05-06 19:27   ` Benjamin Marzinski
2016-05-04  5:57 ` [PATCH 3/6] Remove 'udev_sync' argument from dm_simplecmd() Hannes Reinecke
2016-05-06 19:50   ` Benjamin Marzinski
2016-05-04  5:57 ` [PATCH 4/6] libmultipath: Fixup 'DM_DEVICE_RELOAD' handling Hannes Reinecke
2016-05-06 20:12   ` Benjamin Marzinski
2016-05-09 10:26     ` Hannes Reinecke
2016-05-09 14:56       ` Benjamin Marzinski
2016-05-04  5:57 ` Hannes Reinecke [this message]
2016-05-06 20:18   ` [PATCH 5/6] devmapper: do not flush I/O for DM_DEVICE_CREATE Benjamin Marzinski
2016-05-04  5:57 ` [PATCH 6/6] libmultipath: fixup dm_rename to complete cookie on failure Hannes Reinecke
2016-05-06 20:29   ` Benjamin Marzinski
2016-05-06 21:59     ` Alasdair G Kergon
2016-05-06 22:45       ` Benjamin Marzinski

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=1462341450-5507-6-git-send-email-hare@suse.de \
    --to=hare@suse.de \
    --cc=christophe.varoqui@gmail.com \
    --cc=dm-devel@redhat.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 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.