All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: Miao Xie <miaox@cn.fujitsu.com>, <linux-btrfs@vger.kernel.org>
Cc: <t-itoh@jp.fujitsu.com>
Subject: Re: [PATCH 1/2] Btrfs: fix the race between write back and nocow buffered write
Date: Wed, 8 Jan 2014 10:09:58 -0500	[thread overview]
Message-ID: <52CD6A46.2030802@fb.com> (raw)
In-Reply-To: <1388149910-31499-1-git-send-email-miaox@cn.fujitsu.com>


On 12/27/2013 08:11 AM, Miao Xie wrote:
> When we ran the 274th case of xfstests with nodatacow mount option,
> We met the following warning message:
> WARNING: CPU: 1 PID: 14185 at fs/btrfs/extent-tree.c:3734 btrfs_free_reserved_data_space+0xa6/0xd0
>
> It is caused by the race between the write back and nocow buffered
> write:
>    Task1				Task2
>    __btrfs_buffered_write()
>      skip data reservation
>      reserve the metadata space
>      copy the data
>      dirty the pages
>      unlock the pages
> 				write back the pages
> 				release the data space
>     				  becasue there is no
> 				  noreserve flag
>     set the noreserve flag
>
> This patch fixes this problem by unlocking the pages after
> the noreserve flag is set.
>
> Reported-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
> ---
>   fs/btrfs/file.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
> index 82d0342..f6960c2 100644
> --- a/fs/btrfs/file.c
> +++ b/fs/btrfs/file.c
> @@ -1523,7 +1523,6 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
>   		}
>   
>   		release_bytes = 0;
> -		btrfs_drop_pages(pages, num_pages);
>   

This isn't based on your other patch

     Btrfs: fix the reserved space leak caused by the race between 
nonlock dio and buffered io

You need to redo this one ontop of that patch, I'll take 2/2 tho. Thanks,

Josef

  parent reply	other threads:[~2014-01-08 15:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-27 13:11 [PATCH 1/2] Btrfs: fix the race between write back and nocow buffered write Miao Xie
2013-12-27 13:11 ` [PATCH 2/2] Btrfs: fix the wrong nocow range check Miao Xie
2014-01-08 15:09 ` Josef Bacik [this message]
2014-01-09  2:06   ` [PATCH V2 1/2] Btrfs: fix the race between write back and nocow buffered write Miao Xie

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=52CD6A46.2030802@fb.com \
    --to=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=miaox@cn.fujitsu.com \
    --cc=t-itoh@jp.fujitsu.com \
    /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.