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

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