linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: waxhead@dirtcellar.net, Liu Bo <obuil.liubo@gmail.com>,
	Mike Stevens <michael.stevens@bayer.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Crashes running btrfs scrub
Date: Mon, 19 Mar 2018 09:51:04 +0800	[thread overview]
Message-ID: <9a2148df-f158-dbf1-63f1-5e5c74e82d93@gmx.com> (raw)
In-Reply-To: <fa53b8c8-1cf9-2d3d-4a9b-70e760ec45bb@dirtcellar.net>


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



On 2018年03月19日 06:52, waxhead wrote:
> Liu Bo wrote:
>> On Sat, Mar 17, 2018 at 5:26 PM, Liu Bo <obuil.liubo@gmail.com> wrote:
>>> On Fri, Mar 16, 2018 at 2:46 PM, Mike Stevens
>>> <michael.stevens@bayer.com> wrote:
>>>>> Could you please paste the whole dmesg, it looks like it hit
>>>>> btrfs_abort_transaction(),
>>>>> which should give us more information about where goes wrong.
>>>>
>>>> The whole thing is here https://pastebin.com/4ENq2saQ
>>>
>>> Given this,
>>>
>>> [  299.410998] BTRFS: error (device sdag) in
>>> btrfs_create_pending_block_groups:10192: errno=-27 unknown
>>>
>>> it refers to -EFBIG, so I think the warning comes from
>>>
>>> btrfs_add_system_chunk()
>>> {
>>> ...
>>>          if (array_size + item_size + sizeof(disk_key)
>>>
>>>                          > BTRFS_SYSTEM_CHUNK_ARRAY_SIZE) {
>>>
>>>                  mutex_unlock(&fs_info->chunk_mutex);
>>>
>>>                  return -EFBIG;
>>>
>>>          }
>>>
>>> If that's the case, we need to check this earlier during mount.
>>>
>>
>> I didn't realize this until now,  we do have a limitation on up to how
>> many disks btrfs could handle, in order to make balance/scrub work
>> properly (where system chunks may be set readonly),
>>
>> ((BTRFS_SYSTEM_CHUNK_ARRAY_SIZE / 2) - sizeof(struct btrfs_chunk)) /
>> sizeof(struct btrfs_stripe) + 1
>>
>> will be the number of disks btrfs can handle at most.
> 
> Am I understanding this correct, BTRFS have limit to the number of
> physical devices it can handle?! (max 30 devices?!)

Not exactly.

System chunk array is only used to store system chunk (tree blocks of
chunk tree).
For data chunks, it's completely unrelated.

And for certain system chunk type (raid1/dup) it's fixed to have 2
stripes for each chunk, so it won't take so much space.


Furthermore, system chunk should not be that much, as it's only
containing chunk tree.
For large fs, one chunk can be up to 10G for data or 1G for metadata.

10TB only needs about 100 chunk items, which doesn't even need to
allocate extra system chunk space.


But if one is using RAID0/5/6/10, it's pretty possible one will hit that
device number max.
But that's still pretty strange.
Correct calculation should be (I hardly see more than 2 system chunks in
real world)

2048 = 80 + 32 + 80 + n * 32 (For old mkfs which still has temporary sys
chunk)

Or

2048 = 80 + n * 32 (For new mkfs which doesn't have temporary sys chunk)

n should be the total number of disks if using RAID0/10/5/6 as metadata
profile.

So n will be 58, which is quite large at least for mkfs time limit.

Although for runtime, especially for relocation case, we need half of
the system chunk array to store the new system chunk, which makes the
number half.

But it should still be possible if we convert system chunk profile from
RAID0/10/5/6 to RAID1, which only takes 80 + 32 * 2.

Thanks,
Qu


> 
> Or are this referring to the number of devices BTRFS can utilize in a
> stripe (in which case 30 actually sounds like a high number).
> 
> 30 devices is really not that much, heck you get 90 disks top load JBOD
> storage chassis these days and BTRFS does sound like an attractive
> choice for things like that.
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  reply	other threads:[~2018-03-19  1:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 18:58 Crashes running btrfs scrub Mike Stevens
2018-03-15 20:32 ` waxhead
2018-03-15 21:07   ` Mike Stevens
2018-03-15 21:22     ` Chris Murphy
     [not found]       ` <6b4f2b33edb44f1ea8cef47ae68960af@MOXDE7.na.bayer.cnb>
2018-03-16 16:00         ` Chris Murphy
2018-03-16 16:17           ` Mike Stevens
2018-03-16 16:44             ` Chris Murphy
2018-03-16 18:53               ` Mike Stevens
2018-03-18  2:23         ` Qu Wenruo
2018-03-16 21:39     ` Liu Bo
2018-03-16 21:46       ` Mike Stevens
2018-03-18  0:26         ` Liu Bo
2018-03-18  6:41           ` Liu Bo
2018-03-18  7:57             ` Goffredo Baroncelli
2018-03-18 14:46               ` Goffredo Baroncelli
2018-03-18 22:52             ` waxhead
2018-03-19  1:51               ` Qu Wenruo [this message]
2018-03-19 18:06               ` Liu Bo
2018-03-20 17:44                 ` Mike Stevens
2018-03-21  2:01                   ` Qu Wenruo
2018-03-21 17:13                     ` Liu Bo
2018-03-22  0:08                       ` Qu Wenruo
2018-03-20 20:04                 ` Goffredo Baroncelli
2018-03-15 21:15 ` Chris Murphy

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=9a2148df-f158-dbf1-63f1-5e5c74e82d93@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=michael.stevens@bayer.com \
    --cc=obuil.liubo@gmail.com \
    --cc=waxhead@dirtcellar.net \
    /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).