linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: image: Warn about log tree generation mismatch when restore
@ 2018-10-04  6:02 Qu Wenruo
  2018-10-25 12:08 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Qu Wenruo @ 2018-10-04  6:02 UTC (permalink / raw)
  To: linux-btrfs

At restore time, btrfs-image will try to fixup dev extents, this will
trigger a transaction.

It's normally OK to start a new transaction, but for image with log
tree, a new transaction will bump up generation, and log tree generation
will not match with super block generation + 1.

There is no good way to solve it yet. Just output a warning for now.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 image/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/image/main.c b/image/main.c
index 351c5a256938..40fe406d8a33 100644
--- a/image/main.c
+++ b/image/main.c
@@ -2093,6 +2093,10 @@ static int fixup_devices(struct btrfs_fs_info *fs_info,
 	u64 devid, cur_devid;
 	int ret;
 
+	if (btrfs_super_log_root(fs_info->super_copy)) {
+		warning(
+		"log tree detected, log tree generation will be suspicious");
+	}
 	trans = btrfs_start_transaction(fs_info->tree_root, 1);
 	if (IS_ERR(trans)) {
 		error("cannot starting transaction %ld", PTR_ERR(trans));
-- 
2.19.0


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

* Re: [PATCH] btrfs-progs: image: Warn about log tree generation mismatch when restore
  2018-10-04  6:02 [PATCH] btrfs-progs: image: Warn about log tree generation mismatch when restore Qu Wenruo
@ 2018-10-25 12:08 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2018-10-25 12:08 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On Thu, Oct 04, 2018 at 02:02:13PM +0800, Qu Wenruo wrote:
> At restore time, btrfs-image will try to fixup dev extents, this will
> trigger a transaction.
> 
> It's normally OK to start a new transaction, but for image with log
> tree, a new transaction will bump up generation, and log tree generation
> will not match with super block generation + 1.
> 
> There is no good way to solve it yet. Just output a warning for now.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Applied, thanks.

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

end of thread, other threads:[~2018-10-25 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-04  6:02 [PATCH] btrfs-progs: image: Warn about log tree generation mismatch when restore Qu Wenruo
2018-10-25 12:08 ` David Sterba

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).