[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH] Fix memory lock imbalance in lv_suspend if already suspended.

(well, this time correct version)

pvmove suspends all moved LVs + pvmoveX mirrored LV itself.

This suspends even underlying pvmoveX and following explicit
suspend call is just noop.

But in resume the pvmoveX volume is no longer underlying
device for moved LVs, so it performs full resume with memlock

Code must call memlock_inc() if suspend is requested, volume
is already suspended and error is not requested.

Signed-off-by: Milan Broz <mbroz redhat com>
 lib/activate/activate.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 1aaa16c..cfd2953 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -879,7 +879,11 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s,
 	if (!info.exists || info.suspended) {
-		r = error_if_not_suspended ? 0 : 1;
+		if (!error_if_not_suspended) {
+			r = 1;
+			if (info.suspended)
+				memlock_inc();
+		}
 		goto out;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]