Blame SOURCES/0190-RHBZ-1380602-rbd-lock-on-read.patch

f20720
---
f20720
 libmultipath/checkers/rbd.c |    9 ++++++++-
f20720
 1 file changed, 8 insertions(+), 1 deletion(-)
f20720
f20720
Index: multipath-tools-130222/libmultipath/checkers/rbd.c
f20720
===================================================================
f20720
--- multipath-tools-130222.orig/libmultipath/checkers/rbd.c
f20720
+++ multipath-tools-130222/libmultipath/checkers/rbd.c
f20720
@@ -45,6 +45,7 @@ struct rbd_checker_context {
f20720
 	char *username;
f20720
 	int remapped;
f20720
 	int blacklisted;
f20720
+	int lock_on_read:1;
f20720
 
f20720
 	rados_t cluster;
f20720
 
f20720
@@ -141,6 +142,9 @@ int libcheck_init(struct checker * c)
f20720
 		goto free_addr;
f20720
 	}
f20720
 
f20720
+	if (strstr(config_info, "lock_on_read"))
f20720
+		ct->lock_on_read = 1;
f20720
+
f20720
 	ct->config_info = strdup(config_info);
f20720
 	if (!ct->config_info)
f20720
 		goto free_addr;
f20720
@@ -397,7 +401,10 @@ static int rbd_remap(struct rbd_checker_
f20720
 	case 0:
f20720
 		argv[i++] = "rbd";
f20720
 		argv[i++] = "map";
f20720
-		argv[i++] = "-o noshare";
f20720
+		if (ct->lock_on_read)
f20720
+			argv[i++] = "-o noshare,lock_on_read";
f20720
+		else
f20720
+			argv[i++] = "-o noshare";
f20720
 		if (ct->username) {
f20720
 			argv[i++] = "--id";
f20720
 			argv[i++] = ct->username;