Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
To: linux-raid@vger.kernel.org
Cc: jes.sorensen@gmail.com, Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Subject: [PATCH] Grow: don't allow to enable PPL when reshape is in progress
Date: Fri,  9 Jun 2017 16:20:19 +0200	[thread overview]
Message-ID: <1497018019-11809-1-git-send-email-tomasz.majchrzak@intel.com> (raw)

Don't allow to enable PPL consistency policy when reshape is in progress.
Current PPL implementation doesn't work when reshape is taking place.

Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
---
 Grow.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Grow.c b/Grow.c
index 4ecb1d8..1a93391 100644
--- a/Grow.c
+++ b/Grow.c
@@ -530,6 +530,7 @@ int Grow_consistency_policy(char *devname, int fd, struct context *c, struct sha
 	char *subarray = NULL;
 	int ret = 0;
 	char container_dev[PATH_MAX];
+	char buf[20];
 
 	if (s->consistency_policy != CONSISTENCY_POLICY_RESYNC &&
 	    s->consistency_policy != CONSISTENCY_POLICY_PPL) {
@@ -577,6 +578,17 @@ int Grow_consistency_policy(char *devname, int fd, struct context *c, struct sha
 		goto free_info;
 	}
 
+	if (s->consistency_policy == CONSISTENCY_POLICY_PPL) {
+		if (sysfs_get_str(sra, NULL, "sync_action", buf, 20) <= 0) {
+			ret = 1;
+			goto free_info;
+		} else if (strcmp(buf, "reshape\n") == 0) {
+			pr_err("PPL cannot be enabled when reshape is in progress\n");
+			ret = 1;
+			goto free_info;
+		}
+	}
+
 	if (subarray) {
 		char *update;
 
-- 
1.8.3.1


             reply	other threads:[~2017-06-09 14:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09 14:20 Tomasz Majchrzak [this message]
2017-06-09 14:58 ` [PATCH] Grow: don't allow to enable PPL when reshape is in progress Jes Sorensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497018019-11809-1-git-send-email-tomasz.majchrzak@intel.com \
    --to=tomasz.majchrzak@intel.com \
    --cc=jes.sorensen@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox