All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kyle Gates" <kylegates@hotmail.com>
To: <bo.li.liu@oracle.com>
Cc: <dsterba@suse.cz>, <linux-btrfs@vger.kernel.org>
Subject: Re: nocow 'C' flag ignored after balance
Date: Thu, 30 May 2013 11:40:46 -0500	[thread overview]
Message-ID: <BAY172-DS1116FE7B830861258CAA89B0910@phx.gbl> (raw)
In-Reply-To: <20130529015510.GA6571@liubo>

On Tue, May 28, 2013, Liu Bo wrote:
> On Tue, May 28, 2013 at 09:22:11AM -0500, Kyle Gates wrote:
>> >From: Liu Bo <bo.li.liu@oracle.com>
>> >
>> >Subject: [PATCH] Btrfs: fix broken nocow after a normal balance
>> >
>>[...]
>>
>> Sorry for the long wait in replying.
>> This patch was unsuccessful in fixing the problem (on my 3.8 Ubuntu
>> Raring kernel). I can probably try again on a newer version if you
>> think it will help.
>> This was my first kernel compile so I patched by hand and waited (10
>> hours on my old 32 bit single core machine).
>>
>> I did move some of the files off and back on to the filesystem to
>> start fresh and compare but all seem to exhibit the same behavior
>> after a balance.
>>
>
> Thanks for testing the patch although it didn't help you.
> Actually I tested it to be sure that it fixed the problems in my 
> reproducer.
>
> So anyway can you please apply this debug patch in order to nail it down?
>
> thanks,
> liubo
>
>
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index df472ab..c12a11c 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -2857,8 +2857,12 @@ static noinline int check_committed_ref(struct 
> btrfs_trans_handle *trans,
>  goto out;
>
>  if (btrfs_extent_generation(leaf, ei) <=
> -     btrfs_root_last_snapshot(&root->root_item))
> +     btrfs_root_last_snapshot(&root->root_item)) {
> + printk("extent gen %llu last_snap %llu\n",
> + btrfs_extent_generation(leaf, ei),
> + btrfs_root_last_snapshot(&root->root_item));
>  goto out;
> + }
>
>  iref = (struct btrfs_extent_inline_ref *)(ei + 1);
>  if (btrfs_extent_inline_ref_type(leaf, iref) !=
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 23c596c..8cad6ee 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -1317,16 +1317,24 @@ next_slot:
>  goto out_check;
>  if (btrfs_file_extent_compression(leaf, fi) ||
>      btrfs_file_extent_encryption(leaf, fi) ||
> -     btrfs_file_extent_other_encoding(leaf, fi))
> +     btrfs_file_extent_other_encoding(leaf, fi)) {
> + printk("special encoding\n");
>  goto out_check;
> - if (extent_type == BTRFS_FILE_EXTENT_REG && !force)
> + }
> + if (extent_type == BTRFS_FILE_EXTENT_REG && !force) {
> + printk("BTRFS_FILE_EXTENT_REF\n");
>  goto out_check;
> - if (btrfs_extent_readonly(root, disk_bytenr))
> + }
> + if (btrfs_extent_readonly(root, disk_bytenr)) {
> + printk("ro\n");
>  goto out_check;
> + }
>  if (btrfs_cross_ref_exist(trans, root, ino,
>    found_key.offset -
> -   extent_offset, disk_bytenr))
> +   extent_offset, disk_bytenr)) {
> + printk("cross ref\n");
>  goto out_check;
> + }
>  disk_bytenr += extent_offset;
>  disk_bytenr += cur_offset - found_key.offset;
>  num_bytes = min(end + 1, extent_end) - cur_offset;
>
In another email Miao Xie suggests this patch won't help, so I'll wait for 
more comments/suggestions.
Thanks,
Kyle 


      parent reply	other threads:[~2013-05-30 16:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 20:41 Creating recursive snapshots for all filesystems Alexander Skwar
2013-05-03  8:48 ` Sander
2013-05-03 11:46   ` Alexander Skwar
2013-05-05 11:05 ` Kai Krakow
2013-05-05 12:59   ` Alexander Skwar
2013-05-05 16:03     ` Kai Krakow
2013-05-05 16:19       ` Alexander Skwar
2013-05-09 20:41     ` nocow 'C' flag ignored after balance Kyle Gates
2013-05-10  5:15       ` Liu Bo
2013-05-10 13:58         ` Kyle Gates
2013-05-16 19:11           ` Kyle Gates
2013-05-17  7:04             ` Liu Bo
2013-05-17 14:38               ` Kyle Gates
2013-05-28 14:22               ` Kyle Gates
2013-05-29  1:55                 ` Liu Bo
2013-05-29  8:33                   ` Miao Xie
2013-05-30 16:40                     ` Kyle Gates
2013-05-30 16:40                   ` Kyle Gates [this message]

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=BAY172-DS1116FE7B830861258CAA89B0910@phx.gbl \
    --to=kylegates@hotmail.com \
    --cc=bo.li.liu@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.