linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] imsm: Warn user about reboot risk
@ 2011-04-05 13:46 Adam Kwolek
  2011-04-05 13:46 ` [PATCH 2/3] imsm: FIX: Check array alignment before expansion Adam Kwolek
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Adam Kwolek @ 2011-04-05 13:46 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

Current check-pointing implementation doesn't allow for interrupting reshape of boot arrays
due to checkpoint restore has to be done before system start.
There is problem with passing backup file name to array automatically mounted during boot time,
especially when scan mode is used.

Until IMSM check-pointing implementation will be introduced, warning about reboot risk
should be placed in mdadm.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
---

 super-intel.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 62ccd15..9c2caf7 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -7251,6 +7251,29 @@ int imsm_takeover(struct supertype *st, struct geo_params *geo)
 	return 0;
 }
 
+static int warn_user_about_risk(void)
+{
+	int rv = 0;
+
+	fprintf(stderr,
+		"\nThis is experimental feature. Data on the RAID volume(s) "
+		"can be lost!!!\n\n"
+		"To continue command execution please make sure that\n"
+		"grow process will not be interrupted. Use safe power\n"
+		"supply to avoid unexpected system reboot. Make sure that\n"
+		"reshaped container is not assembled automatically during\n"
+		"system boot.\n"
+		"If reshape is be interrupted, assemble array manually\n"
+		"using e.g. '-Ac' option and up to date mdadm.conf file.\n"
+		"Assembly in scan mode is not possible in such case.\n"
+		"Growing container with boot array is not possible.\n"
+		"If boot array reshape is interrupted, whole file system\n"
+		"can be lost.\n\n");
+	rv = ask("Do you want to continue? ");
+	fprintf(stderr, "\n");
+
+	return rv;
+}
 static int imsm_reshape_super(struct supertype *st, long long size, int level,
 			      int layout, int chunksize, int raid_disks,
 			      int delta_disks, char *backup, char *dev,
@@ -7283,6 +7306,14 @@ static int imsm_reshape_super(struct supertype *st, long long size, int level,
 		/* On container level we can only increase number of devices. */
 		dprintf("imsm: info: Container operation\n");
 		int old_raid_disks = 0;
+
+		/* this warning will be removed when imsm checkpointing
+		 * will be implemented, and restoring from check-point
+		 * operation will be transparent for reboot process
+		 */
+		if (warn_user_about_risk() == 0)
+			return ret_val;
+
 		if (imsm_reshape_is_allowed_on_container(
 			    st, &geo, &old_raid_disks)) {
 			struct imsm_update_reshape *u = NULL;


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] imsm: FIX: Check array alignment before expansion
  2011-04-05 13:46 [PATCH 1/3] imsm: Warn user about reboot risk Adam Kwolek
@ 2011-04-05 13:46 ` Adam Kwolek
  2011-04-05 13:46 ` [PATCH 3/3] imsm: fix: report aligned component size value Adam Kwolek
  2011-04-06  2:41 ` [PATCH 1/3] imsm: Warn user about reboot risk NeilBrown
  2 siblings, 0 replies; 4+ messages in thread
From: Adam Kwolek @ 2011-04-05 13:46 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

It can occur that OROM creates array not aligned properly.
Expansion cannot be run in such cases. It is detected in analyse_change().
It is too late. This causes that metadata is in migration state already,
when expansion cannot be started.
This problem has to be detected before metadata is updated,
in all arrays in reshaped container.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
---

 super-intel.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 9c2caf7..9e9d6a9 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -6946,6 +6946,14 @@ static int imsm_reshape_is_allowed_on_container(struct supertype *st,
 					 geo->raid_disks > 1 ? "s" : "");
 				break;
 			}
+			/* check if component size is aligned to chunk size
+			 */
+			if (info->component_size %
+			    (info->array.chunk_size/512)) {
+				dprintf("Component size is not alligned to "
+					"chunk size\n");
+				break;
+			}
 		}
 
 		if (*old_raid_disks &&


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] imsm: fix: report aligned component size value
  2011-04-05 13:46 [PATCH 1/3] imsm: Warn user about reboot risk Adam Kwolek
  2011-04-05 13:46 ` [PATCH 2/3] imsm: FIX: Check array alignment before expansion Adam Kwolek
@ 2011-04-05 13:46 ` Adam Kwolek
  2011-04-06  2:41 ` [PATCH 1/3] imsm: Warn user about reboot risk NeilBrown
  2 siblings, 0 replies; 4+ messages in thread
From: Adam Kwolek @ 2011-04-05 13:46 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

OROM can create array with chunk size not aligned.
To resolve this problem in mdadm ,metadata handler has to report
component size aligned value for mdadm operations
while metadata value stays unchanged.

Do not correct alignment for raid1 and in error case.

Correction allows check in analyse_change() (Grow.c:905) to pass.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
---

 super-intel.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 9e9d6a9..fd044cb 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -1745,6 +1745,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
 	struct imsm_map *map_to_analyse = map;
 	struct dl *dl;
 	char *devname;
+	unsigned int component_size_alligment;
 	int map_disks = info->array.raid_disks;
 
 	if (prev_map)
@@ -1824,6 +1825,21 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
 	info->data_offset	  = __le32_to_cpu(map_to_analyse->pba_of_lba0);
 	info->component_size	  =
 		__le32_to_cpu(map_to_analyse->blocks_per_member);
+
+	/* check component size aligment
+	 */
+	component_size_alligment =
+		info->component_size % (info->array.chunk_size/512);
+
+	if (component_size_alligment &&
+	    (info->array.level != 1) && (info->array.level != UnSet)) {
+		dprintf("imsm: reported component size alligned from %llu ",
+			info->component_size);
+		info->component_size -= component_size_alligment;
+		dprintf("to %llu (%i).\n",
+			info->component_size, component_size_alligment);
+	}
+
 	memset(info->uuid, 0, sizeof(info->uuid));
 	info->recovery_start = MaxSector;
 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] imsm: Warn user about reboot risk
  2011-04-05 13:46 [PATCH 1/3] imsm: Warn user about reboot risk Adam Kwolek
  2011-04-05 13:46 ` [PATCH 2/3] imsm: FIX: Check array alignment before expansion Adam Kwolek
  2011-04-05 13:46 ` [PATCH 3/3] imsm: fix: report aligned component size value Adam Kwolek
@ 2011-04-06  2:41 ` NeilBrown
  2 siblings, 0 replies; 4+ messages in thread
From: NeilBrown @ 2011-04-06  2:41 UTC (permalink / raw)
  To: Adam Kwolek
  Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

On Tue, 05 Apr 2011 15:46:09 +0200 Adam Kwolek <adam.kwolek@intel.com> wrote:

> Current check-pointing implementation doesn't allow for interrupting reshape of boot arrays
> due to checkpoint restore has to be done before system start.
> There is problem with passing backup file name to array automatically mounted during boot time,
> especially when scan mode is used.
> 
> Until IMSM check-pointing implementation will be introduced, warning about reboot risk
> should be placed in mdadm.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>

These three have been applied (in the master branch).

Thanks,
NeilBrown


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-06  2:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-05 13:46 [PATCH 1/3] imsm: Warn user about reboot risk Adam Kwolek
2011-04-05 13:46 ` [PATCH 2/3] imsm: FIX: Check array alignment before expansion Adam Kwolek
2011-04-05 13:46 ` [PATCH 3/3] imsm: fix: report aligned component size value Adam Kwolek
2011-04-06  2:41 ` [PATCH 1/3] imsm: Warn user about reboot risk NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).