All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Eric Levy <ericlevy@gmail.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: ERROR... please contact btrfs developers
Date: Mon, 5 Oct 2020 17:17:46 +0800	[thread overview]
Message-ID: <0b0cab47-1824-13ae-61c0-1c3c42c5fa10@gmx.com> (raw)
In-Reply-To: <CA++hEgwdYmfGFudNvkBR6zo3Ux01UFRwHN1WDd7csH5_jBZ0Rg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2801 bytes --]



On 2020/10/5 下午5:05, Eric Levy wrote:
> The volume is not RAID, only a single NVMe card.

Then this means, we may have a bigger problem.

Normally btrfs space reservation keeps enough margin for critical
operations, thus it will return ENOSPC before we really go to do some
space consuming operations, thus no abort_transaction problem like yours.

If it's single device, and still hit the case we need more space than we
have, either the space reservation or the space consumer,
btrfs_drop_snapshot(), has something wrong.
> 
> I deleted all the files and subvolumes except what I need to recover.

You may want to wait until btrfs really drops the subvolume/snapshot.

The command is "btrfs subv sync <mount>". And then check if the usage drops.

> 
> Below is the dump from fi usage. It looks as though 1.00Mb is all that
> is unallocated.
> 
> 
> $ sudo btrfs fi usage /mnt/custom
> Overall:
>     Device size:         378.04GiB
>     Device allocated:         378.04GiB
>     Device unallocated:           1.00MiB
>     Device missing:             0.00B
>     Used:             323.54GiB
>     Free (estimated):          53.13GiB    (min: 53.13GiB)
>     Data ratio:                  1.00
>     Metadata ratio:              1.00
>     Global reserve:         512.00MiB    (used: 0.00B)
> 
> Data,single: Size:371.02GiB, Used:317.89GiB (85.68%)
>    /dev/sdb5     371.02GiB
> 
> Metadata,single: Size:7.01GiB, Used:5.65GiB (80.66%)
>    /dev/sdb5       7.01GiB

This is strange. Even accounting the GlobalRSV (0.5G), we should still
have 1GiB space for metadata.
We shouldn't use that much space just for delete.

Would you please try a more uptodate kernel to see if it works?
(One simpler solution is using rolling release ISOs, like OpenSUSE
tumbleweed or Arch install iso).

I'm wondering it may be a bug not fixed in v4.15 due to the hardness to
backport.


BTW, when mounting the fs, you may want to mount with skip_balance mount
option.

Thanks,
Qu

> 
> System,single: Size:4.00MiB, Used:64.00KiB (1.56%)
>    /dev/sdb5       4.00MiB
> 
> Unallocated:
>    /dev/sdb5       1.00MiB
> 
> 
>> Oh, that's a completely different bug.
>>
>> Somehow btrfs exhausted the metadata space.
>>
>> Normally caused by unbalanced data/metadata usage and multi-device.
>> (Currently, RAID1/RAID0/RAID10/RAID5/RAID6 can all over-estimate the
>> available space, and cause ENOSPC to happen in critical context, where
>> we can only abort transaction to avoid further corruption)
>>
>> Currently I guess you need to don't do any balance, but try to remove as
>> many unused files as possible, until you have enough unallocated space
>> for metadata.
>>
>> To check your unalloated space, you can use btrfs fi usage:


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2020-10-05  9:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30  1:44 ERROR... please contact btrfs developers Eric Levy
2020-09-30  2:03 ` Qu Wenruo
     [not found]   ` <CA++hEgyyn0Os1-w-WE8seXCrDJVosgLnfL1pU7e2p_LpqRmJ_Q@mail.gmail.com>
2020-10-05  2:38     ` Qu Wenruo
     [not found]   ` <CA++hEgwsLH=9-PCpkR4X2MEqSwwK6ZMhpb+YEB=ze-kOJ8cwaQ@mail.gmail.com>
2020-10-05  7:14     ` Qu Wenruo
     [not found]     ` <CA++hEgzbFsf6LgPb+XJbf-kkEYEy0cYAbaF=+m3pbEdSd+f62g@mail.gmail.com>
2020-10-05  8:51       ` Qu Wenruo
     [not found]         ` <CA++hEgwdYmfGFudNvkBR6zo3Ux01UFRwHN1WDd7csH5_jBZ0Rg@mail.gmail.com>
2020-10-05  9:17           ` Qu Wenruo [this message]
     [not found]             ` <CA++hEgx4d_-Y4Be7_fpDLTbCnN2-2yAecbyjJWSJuU-qSFvVuw@mail.gmail.com>
2020-10-05 12:12               ` Qu Wenruo
     [not found]       ` <CA++hEgzRkz+qQQf_+YBX2r5bBiNvtexiguPG99jBzVM6JhtPzg@mail.gmail.com>
2020-10-05  8:54         ` Qu Wenruo
2020-10-05  1:33 ` Eric Levy
2020-10-05  1:36   ` Qu Wenruo

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=0b0cab47-1824-13ae-61c0-1c3c42c5fa10@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=ericlevy@gmail.com \
    --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.