linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
To: Ronan Arraes Jardim Chagas <ronisbr@gmail.com>,
	<linux-btrfs@vger.kernel.org>
Subject: Re: BTRFS constantly reports "No space left on device" even with a huge unallocated space
Date: Tue, 30 Aug 2016 10:12:21 +0800	[thread overview]
Message-ID: <57C4EB85.7030000@cn.fujitsu.com> (raw)
In-Reply-To: <1472485953.3290.0.camel@gmail.com>

hello,

On 08/29/2016 11:52 PM, Ronan Arraes Jardim Chagas wrote:
> Hi guys,
>
> I just have the problem again. Now, it happens during the lunch time
> when the machine was idle. Only the system processes were running. It
> was not the first time that I saw this problem just after lunch when
> the machine stayed idle for a long period (+- 1h).
>
> Here is the information requested:
>
> /sys/fs/btrfs/$UUID/allocation/data
>
> ./bytes_may_use
> 0
> ./bytes_pinned
> 0
> ./bytes_reserved
> 0
> ./bytes_used
> 36128374784
> ./disk_total
> 37589352448
> ./disk_used
> 36128374784
> ./flags
> 1
> ./total_bytes
> 37589352448
> ./total_bytes_pinned
> 20339560448
> ./single/total_bytes
> 37589352448
> ./single/used_bytes
> 36128374784
>
> /sys/fs/btrfs/$UUID/allocation/metadata
>
> ./bytes_may_use
> 84974452736
> ./bytes_pinned
> 0
> ./bytes_reserved
> 0
> ./bytes_used
> 977354752
> ./disk_total
> 4294967296
> ./disk_used
> 1954709504
> ./flags
> 4
> ./total_bytes
> 2147483648
> ./total_bytes_pinned
> -57851904
> ./dup/total_bytes
> 2147483648
> ./dup/used_bytes
> 977354752

For metadata, "bytes_may_use" is about 80GB, it's very big,
I think this value is very abnormal.

So this explains why you have huge unallocated space, you still
get ENOSPC error. In kernel btrfs, there is a function should_alloc_chunk()
to determine whether to allocate new chunks(new device space)
  num_bytes = total_bytes - bytes_readonly; it's 2147483648
  num_allocated = bytes_used + bytes_reserved; it's 977354752

if num_allocated < num_bytes * 0.8, it will not allocate new device 
space :) even you
have huge unallocated space.

I think the root reason is that bytes_may_use has some computation error and
is not be converted to bytes_used or bytes_reserved.

I just explain why you get ENOSPC error even with huge unallocated space 
from
codes :)

>
> # btrfs fi usage /
>
> btrfs_destroy_inode+0x23f/0x2b0 [btrfs]
> Ago 29 12:06:07 ronanarraes-osd kernel:  [<ffffffff8121f6d1>]
> do_unlinkat+0x131/0x310
> Ago 29 12:06:07 ronanarraes-osd kernel:  [<ffffffff816bb4f6>]
> entry_SYSCALL_64_fastpath+0x1e/0xa8
> Ago 29 12:06:07 ronanarraes-osd kernel: DWARF2 unwinder stuck at
> entry_SYSCALL_64_fastpath+0x1e/0xa8
> Ago 29 12:06:07 ronanarraes-osd kernel:
> Ago 29 12:06:07 ronanarraes-osd kernel: Leftover inexact backtrace:
> Ago 29 12:06:07 ronanarraes-osd kernel: ---[ end trace 5774bd3049f78a63
> ]---
Yes, I know these WARNINGs, but indeed they are already results,
we don't know the procedures which cause these results.

Can you work out a reproducer for this ENOSPC error, then I can
dig into codes to figure out the true reason.

Regards,
Xiaoguang Wang

>
> Best regards,
> Ronan Arraes
>
>




  parent reply	other threads:[~2016-08-30  2:16 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12 17:36 BTRFS constantly reports "No space left on device" even with a huge unallocated space Ronan Arraes Jardim Chagas
2016-08-12 18:02 ` Chris Murphy
2016-08-12 19:00   ` Ronan Arraes Jardim Chagas
2016-08-12 19:37     ` Chris Murphy
2016-08-12 20:34       ` Chris Murphy
     [not found]         ` <CAKdnfRJeOXHmrumDkfxLTf-nU=KwZ0f7ybET-3o7kwwJDOZ2aw@mail.gmail.com>
2016-08-15 23:24           ` Chris Murphy
2016-08-16 17:49             ` Ronan Arraes Jardim Chagas
2016-08-22 19:11             ` Ronan Arraes Jardim Chagas
2016-08-22 20:39             ` Ronan Arraes Jardim Chagas
2016-08-22 20:49               ` Chris Murphy
2016-08-22 21:04                 ` Ronan Arraes Jardim Chagas
2016-08-24  0:40                   ` Jeff Mahoney
2016-08-25 15:58             ` Lutz Vieweg
2016-08-25 23:56               ` Chris Murphy
2016-08-26  5:59                 ` Marc Haber
2016-08-29 12:12 ` Wang Xiaoguang
2016-08-29 13:20   ` Ronan Arraes Jardim Chagas
2016-08-29 15:52   ` Ronan Arraes Jardim Chagas
2016-08-29 22:25     ` Jeff Mahoney
2016-08-30  2:12     ` Wang Xiaoguang [this message]
2016-08-30 12:50       ` Ronan Arraes Jardim Chagas
2016-08-30 16:44         ` Chris Murphy
2016-08-30 16:57           ` Ronan Arraes Jardim Chagas
2016-08-31 20:49           ` Ronan Arraes Jardim Chagas
2016-08-31 21:44             ` Chris Murphy
2016-08-31 21:48               ` Chris Murphy
2016-08-31 22:47                 ` Jeff Mahoney
2016-08-31 22:58                   ` Chris Murphy
2016-08-31 23:03                     ` Jeff Mahoney
2016-08-31 23:09                       ` Chris Murphy
2016-09-01 12:57                         ` Ronan Arraes Jardim Chagas
2016-09-01 13:21                           ` Austin S. Hemmelgarn
2016-09-01 16:34                             ` Ronan Arraes Jardim Chagas
2016-09-01 17:04                               ` Austin S. Hemmelgarn
2016-09-01 17:12                                 ` Jeff Mahoney
2016-09-01 17:39                                   ` Ronan Arraes Jardim Chagas
2016-09-01 17:43                                     ` Jeff Mahoney
2016-09-01 17:58                                       ` Ronan Arraes Jardim Chagas
2016-09-01 17:45                                   ` Chris Murphy
2016-09-01 18:47                                   ` Austin S. Hemmelgarn
2016-09-02  0:12                                     ` Chris Murphy
2016-09-02 14:26                                       ` Jeff Mahoney
2016-09-02 14:43                                         ` Ronan Arraes Jardim Chagas
2016-09-02 14:48                                           ` Jeff Mahoney
2016-09-02 15:20                                             ` Ronan Arraes Jardim Chagas
2016-09-02 15:26                                               ` Jeff Mahoney
2016-09-02 19:25                                                 ` Ronan Arraes Jardim Chagas
2016-09-05  8:49                                                   ` Qu Wenruo
2016-09-08 18:24                                                     ` Ronan Arraes Jardim Chagas
2016-09-08 18:49                                                       ` Jeff Mahoney
2016-09-08 23:02                                                         ` Jeff Mahoney
2016-09-13 20:24                                                           ` Josef Bacik
2016-09-14 14:25                                                             ` Jeff Mahoney
2016-09-19  2:38                                                               ` Wang Xiaoguang
2016-09-22 13:40                                                                 ` Jeff Mahoney
     [not found]                                                               ` <57DF4E44.2040506@cn.fujitsu.com>
2016-09-22 13:20                                                                 ` Ronan Arraes Jardim Chagas
2016-09-22 13:41                                                                   ` Austin S. Hemmelgarn
2016-09-22 14:03                                                                     ` Ronan Arraes Jardim Chagas
2016-09-22 14:39                                                                       ` Josef Bacik
2016-09-22 17:06                                                                         ` Ronan Arraes Jardim Chagas
2016-09-22 17:49                                                                           ` Josef Bacik
2016-09-22 17:54                                                                             ` Ronan Arraes Jardim Chagas
2016-09-23 15:20                                                                             ` [SOLVED] " Ronan Arraes Jardim Chagas
2016-09-02 19:56                                                 ` Ronan Arraes Jardim Chagas
2016-09-02 21:34                                                   ` Chris Murphy
2016-09-02 22:13                                                     ` Ronan Arraes Jardim Chagas
2016-09-02 22:39                                                       ` Chris Murphy
2016-09-03  2:47                                                         ` Ronan Arraes Jardim Chagas
2016-09-03  3:41                                                           ` Chris Murphy
2016-09-03  3:47                                                             ` Ronan Arraes Jardim Chagas
2016-09-03  4:14                                                               ` Chris Murphy
2016-09-01 17:07                             ` Chris Murphy
2016-09-02  0:37               ` Qu Wenruo
2016-09-02 14:09             ` Jeff Mahoney
2016-09-14 20:15   ` Ronan Arraes Jardim Chagas
2016-09-14 22:25     ` Chris Murphy
2016-09-15  0:56       ` Ronan Arraes Jardim Chagas
2016-09-13  3:17 ` Wang Xiaoguang
2016-09-13 12:54   ` Ronan Arraes Jardim Chagas
2016-09-13 20:49   ` Ronan Arraes Jardim Chagas
2016-09-13 21:01     ` Josef Bacik
2016-09-14 14:40       ` Ronan Arraes Jardim Chagas

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=57C4EB85.7030000@cn.fujitsu.com \
    --to=wangxg.fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=ronisbr@gmail.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;
as well as URLs for NNTP newsgroup(s).