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