On Tue, Mar 1, 2011 at 5:56 AM, Zhong, Xin <xin.zh...@intel.com> wrote:
> Hi Mitch,
>
> I suspect there's a lock contention between flush-btrfs 
> (lock_dellalloc_pages) and btrfs_file_aio_write. However I can not recreate 
> it locally. Could you please try below patch? Thanks!
>
> diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 65338a1..b9d0929 100644
> --- a/fs/btrfs/file.c
> +++ b/fs/btrfs/file.c
> @@ -1007,17 +1007,16 @@ static ssize_t btrfs_file_aio_write(struct kiocb 
> *iocb,
>                        goto out;
>                }
>
> -               ret = btrfs_delalloc_reserve_space(inode,
> -                                       num_pages << PAGE_CACHE_SHIFT);
> -               if (ret)
> -                       goto out;
> -
>                ret = prepare_pages(root, file, pages, num_pages,
>                                    pos, first_index, last_index,
>                                    write_bytes);
> -               if (ret) {
> -                       btrfs_delalloc_release_space(inode,
> +               if (ret)
> +                       goto out;
> +
> +               ret = btrfs_delalloc_reserve_space(inode,
>                                        num_pages << PAGE_CACHE_SHIFT);
> +               if (ret) {
> +                       btrfs_drop_pages(pages, num_pages);
>                        goto out;
>                }
>
>

Thanks.

I've tested this patch, but the build is still failing at the same
point as before.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to