[PATCH 6/9] FIX: Verify Backup file name before reshape

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

 



When reshape is continued in the background, backup_file is required
for user data safety. reshape_array() makes backup_file verification,
but for container operation it will be done in forked code, so check
result will be unknown for assemble.
Grow_continue() has to verify if any file name is passed in.

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

 Grow.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Grow.c b/Grow.c
index 5176425..a1e6091 100644
--- a/Grow.c
+++ b/Grow.c
@@ -3339,8 +3339,15 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
 		if (err)
 			return err;
 	} else {
+		if (backup_file == NULL) {
+			fprintf(stderr, Name ": Backup file name has to be "
+				"specified for reshape continuation.\n");
+			return 1;
+		}
+
 		fmt_devname(buf, st->container_dev);
 		container = buf;
+
 		switch (fork()) {
 		case -1:
 			fprintf(stderr, Name ": Cannot run child to "

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux