[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201118153947.3394530-8-saranyamohan@google.com>
Date: Wed, 18 Nov 2020 07:38:53 -0800
From: Saranya Muruganandam <saranyamohan@...gle.com>
To: linux-ext4@...r.kernel.org, tytso@....edu
Cc: adilger.kernel@...ger.ca, Wang Shilong <wshilong@....com>,
Li Xi <lixi@....com>,
Saranya Muruganandam <saranyamohan@...gle.com>
Subject: [RFC PATCH v3 07/61] e2fsck: copy badblocks when copying fs
From: Wang Shilong <wshilong@....com>
This patch copies badblocks when the copying fs.
Signed-off-by: Li Xi <lixi@....com>
Signed-off-by: Wang Shilong <wshilong@....com>
Signed-off-by: Saranya Muruganandam <saranyamohan@...gle.com>
---
e2fsck/pass1.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 3a4286e1..14508dd8 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -2123,6 +2123,12 @@ static errcode_t e2fsck_pass1_copy_fs(ext2_filsys dest, ext2_filsys src)
return retval;
}
+ if (src->badblocks) {
+ retval = ext2fs_badblocks_copy(src->badblocks, &dest->badblocks);
+ if (retval)
+ return retval;
+ }
+
/* icache will be rebuilt if needed, so do not copy from @src */
src->icache = NULL;
return 0;
@@ -2155,6 +2161,13 @@ static int e2fsck_pass1_merge_fs(ext2_filsys dest, ext2_filsys src)
src->icache = NULL;
}
+ if (src->badblocks) {
+ retval = ext2fs_badblocks_copy(src->badblocks, &dest->badblocks);
+
+ ext2fs_badblocks_list_free(src->badblocks);
+ src->badblocks = NULL;
+ }
+
return retval;
}
--
2.29.2.299.gdc1121823c-goog
Powered by blists - more mailing lists