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

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