Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: Miao Xie <miaox@cn.fujitsu.com>
Cc: Chris Mason <chris.mason@oracle.com>,
	Josef Bacik <josef@redhat.com>,
	Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/6] btrfs: try to reclaim some space when chunk allocation fails
Date: Wed, 22 Dec 2010 14:21:23 -0500	[thread overview]
Message-ID: <20101222192122.GA1669@dhcp231-156.rdu.redhat.com> (raw)
In-Reply-To: <4D11D738.3000700@cn.fujitsu.com>

On Wed, Dec 22, 2010 at 06:47:20PM +0800, Miao Xie wrote:
> We cannot write data into files when when there is tiny space in the filesystem.
> 
> Reproduce steps:
>  # mkfs.btrfs /dev/sda1
>  # mount /dev/sda1 /mnt
>  # dd if=/dev/zero of=/mnt/tmpfile0 bs=4K count=1
>  # dd if=/dev/zero of=/mnt/tmpfile1 bs=4K count=99999999999999
>    (fill the filesystem)
>  # umount /mnt
>  # mount /dev/sda1 /mnt
>  # rm -f /mnt/tmpfile0
>  # dd if=/dev/zero of=/mnt/tmpfile0 bs=4K count=1
>    (failed with nospec)
> 
> But if we do the last step again, we can write data successfully. The reason of
> the problem is that btrfs didn't try to commit the current transaction and
> reclaim some space when chunk allocation failed.
> 
> This patch fixes it by committing the current transaction to to reclaim some
> space when chunk allocation fails.
> 
> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>

Reviewed-by: Josef Bacik <josef@redhat.com>

Thanks,

Josef

      reply	other threads:[~2010-12-22 19:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22 10:47 [PATCH 2/6] btrfs: try to reclaim some space when chunk allocation fails Miao Xie
2010-12-22 19:21 ` Josef Bacik [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=20101222192122.GA1669@dhcp231-156.rdu.redhat.com \
    --to=josef@redhat.com \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=miaox@cn.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox