All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Anand Jain <anand.jain@oracle.com>
Cc: linux-btrfs@vger.kernel.org, dsterba@suse.cz
Subject: Re: [PATCH 01/11, RESEND] btrfs-progs: root_item generation_v2 is out of sync after btrfsck
Date: Sun, 21 Apr 2013 18:09:10 -0500	[thread overview]
Message-ID: <51747196.9090501@redhat.com> (raw)
In-Reply-To: <1366007897-26567-2-git-send-email-anand.jain@oracle.com>

On 4/15/13 1:38 AM, Anand Jain wrote:
> reproducing steps:
> mkfs.btrfs /dev/dm-2 -f
> mount /dev/dm-2 /btrfs
> umount /btrfs
> btrfs check /dev/dm-2 --repair
> mount /dev/dm-2 /btrfs
> 
> ----
> btrfs: mismatching generation and generation_v2 found in root item. This root was probably mounted with an older kernel. Resetting all new fields.
> ----

After this patch (on the integration branch), I'm getting:

[61371.570449] btrfs: mismatching generation and generation_v2 found in root item. This root was probably mounted with an older kernel. Resetting all new fields.

when I run xfstests on my box...

Reverting to an older mkfs.btrfs makes it go away.

-Eric

> btrfs-debug-tree shows change in uuid
> 
> < 		root data bytenr 29425664 level 0 dirid 0 refs 1 gen 43
> < 		uuid 293596e8-7888-eb4c-9134-6df9db996fe5
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>  root-tree.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/root-tree.c b/root-tree.c
> index c10d068..4454147 100644
> --- a/root-tree.c
> +++ b/root-tree.c
> @@ -69,6 +69,7 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
>  	int ret;
>  	int slot;
>  	unsigned long ptr;
> +	u32 old_size;
>  
>  	path = btrfs_alloc_path();
>  	BUG_ON(!path);
> @@ -79,6 +80,18 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
>  	l = path->nodes[0];
>  	slot = path->slots[0];
>  	ptr = btrfs_item_ptr_offset(l, slot);
> +	/*
> +	* If the btrfs-progs is newer and kernel is at
> +	* generation_v1 then we don't touch v2 items
> +	* otherwise when kernel is at same or greater
> +	* version compared with btrfs-progs then update
> +	* the needed
> +	*/
> +	old_size = btrfs_item_size_nr(l, slot);
> +	if (old_size >= sizeof(*item)) {
> +		btrfs_set_root_generation_v2(item,
> +			btrfs_root_generation(item));
> +	}
>  	write_extent_buffer(l, item, ptr, sizeof(*item));
>  	btrfs_mark_buffer_dirty(path->nodes[0]);
>  out:
> 


  reply	other threads:[~2013-04-21 23:09 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05  5:54 [PATCH 0/9] a bunch of miscellaneous bug fixes Anand Jain
2013-04-05  5:54 ` [PATCH 1/9] [RESEND] btrfs-progs: root_item generation_v2 is out of sync after btrfsck Anand Jain
2013-04-05  5:54 ` [PATCH 2/9] btrfs-progs: no pending balance is not an error Anand Jain
2013-04-12 15:57   ` David Sterba
2013-04-15  2:22     ` Anand Jain
2013-04-05  5:54 ` [PATCH 3/9] btrfs-progs: mkfs should first check all disks before writing to a disk Anand Jain
2013-04-12 16:06   ` David Sterba
2013-04-15  6:47     ` Anand Jain
2013-04-05  5:54 ` [PATCH 4/9] btrfs-progs: check if btrfs kernel module is loaded Anand Jain
2013-04-10  8:23   ` [PATCH 4/9 v2] " Anand Jain
2013-04-12 16:23     ` David Sterba
2013-04-15  7:14       ` Anand Jain
2013-04-05  5:54 ` [PATCH 5/9] [RESEND] btrfs-progs: delete unused function get_mountpt Anand Jain
2013-04-05  5:55 ` [PATCH 6/9] btrfs-progs: mkfs stdout print to match chronology Anand Jain
2013-04-05  5:55 ` [PATCH 7/9] btrfs-progs: cmd replace should check target-dev fully Anand Jain
2013-04-05  5:55 ` [PATCH 8/9] btrfs-progs: btrfs-select-super output is confusing when it fails Anand Jain
2013-04-05  5:55 ` [PATCH 9/9] btrfs-progs: fix btrfs scrub start help Anand Jain
2013-04-05  9:05   ` Stefan Behrens
2013-04-08  2:09   ` [PATCH 9/9 v2] " Anand Jain
2013-04-08  2:20   ` [PATCH 9/9 v3] " Anand Jain
2013-04-11  9:58 ` [PATCH] btrfs-progs: avoid ioctl for multipath-dev with its non-multipath path Anand Jain
2013-04-15  6:38 ` [PATCH 00/11 v2] a bunch of miscellaneous bug fixes Anand Jain
2013-04-15  6:38   ` [PATCH 01/11, RESEND] btrfs-progs: root_item generation_v2 is out of sync after btrfsck Anand Jain
2013-04-21 23:09     ` Eric Sandeen [this message]
2013-04-15  6:38   ` [PATCH 02/11, RESEND] btrfs-progs: no pending balance is not an error Anand Jain
2013-04-15  6:44     ` [PATCH 02/11, v2] " Anand Jain
2013-04-16  4:58       ` [PATCH 02/11 v3] " Anand Jain
2013-04-15 16:21     ` [PATCH 02/11, RESEND] " David Sterba
2013-04-16  5:02       ` Anand Jain
2013-04-15  6:38   ` [PATCH 03/11 v2] btrfs-progs: mkfs should first check all disks before writing to a disk Anand Jain
2013-04-15  6:38   ` [PATCH 04/11 v2] btrfs-progs: cmd replace should check target-dev fully Anand Jain
2013-04-15  6:38   ` [PATCH 05/11, RESEND] btrfs-progs: mkfs stdout print to match chronology Anand Jain
2013-04-15  6:38   ` [PATCH 06/11, v2] btrfs-progs: check if btrfs kernel module is loaded Anand Jain
2013-04-15  7:11     ` [PATCH 06/11 v3] " Anand Jain
2013-04-15  6:38   ` [PATCH 07/11, RESEND] btrfs-progs: delete unused function get_mountpt Anand Jain
2013-04-15  6:38   ` [PATCH 08/11, RESEND] btrfs-progs: btrfs-select-super output is confusing when it fails Anand Jain
2013-04-15  6:38   ` [PATCH 09/11, RESEND] btrfs-progs: fix btrfs scrub start help Anand Jain
2013-04-15  6:38   ` [PATCH 10/11, RESEND] btrfs-progs: avoid ioctl for multipath-dev with its non-multipath path Anand Jain
2013-04-15  6:38   ` [PATCH 11/11, RESEND] btrfs-progs: a copy of superblock is zero may not mean btrfs is not there Anand Jain
2013-04-16 12:15   ` [PATCH 00/11 v2] a bunch of miscellaneous bug fixes David Sterba

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=51747196.9090501@redhat.com \
    --to=sandeen@redhat.com \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.