linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 2/4] fs: btrfs: volumes: prevent overflow for multiplying
       [not found]     ` <405beba4-a461-41ad-9da7-809498cb6e16@suse.com>
@ 2020-11-02  1:06       ` Qu Wenruo
  0 siblings, 0 replies; only message in thread
From: Qu Wenruo @ 2020-11-02  1:06 UTC (permalink / raw)
  To: Marek Behun; +Cc: u-boot, linux-btrfs


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



On 2020/11/2 上午8:20, Qu Wenruo wrote:
> 
> 
> On 2020/11/2 上午7:02, Marek Behun wrote:
>> On Sat, 31 Oct 2020 09:07:50 +0800
>> Qu Wenruo <wqu@suse.com> wrote:
>>
>>> In real world, this should not cause problem as we have device number
>>> limit thus it won't go beyond 4G for a single stripe.
>>
>> So we can't run into this overflow in U-Boot because only one device is
>> supported? But in Linux we can run into this issue?
>>
> In kernel, we have device number check, IIRC for default nodesize is
> just several donzens of devices.
> And since each stripe is only 64K fixed in btrfs, you can see it won't
> go beyond 4G even in kernel.

Sorry, the 64K stripe_len is only for RAID56, and for kernel, we always
use u64 for stripe_len, thus we won't hit the problem.

The problem is in btrfs-progs, where the code comes from, we use int,
other than u64.

Thanks for the hint for the root cause, would related values to be u64
for both btrfs-progs and u-boot to follow the kernel scheme.

Thanks,
Qu
> 
> Thanks,
> Qu
> 


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-02  1:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20201031010752.23974-1-wqu@suse.com>
     [not found] ` <20201031010752.23974-3-wqu@suse.com>
     [not found]   ` <20201102000256.6ca75cb9@nic.cz>
     [not found]     ` <405beba4-a461-41ad-9da7-809498cb6e16@suse.com>
2020-11-02  1:06       ` [PATCH 2/4] fs: btrfs: volumes: prevent overflow for multiplying Qu Wenruo

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).