mbox series

[v4,0/1] Enforce 4k sectorize by default for mkfs

Message ID 20231116160235.2708131-1-neal@gompa.dev (mailing list archive)
Headers show
Series Enforce 4k sectorize by default for mkfs | expand

Message

Neal Gompa Nov. 16, 2023, 4:02 p.m. UTC
The Fedora Asahi SIG[0] is working on bringing up support for
Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k
page sizes, which means that the current default for mkfs.btrfs(8)
makes a filesystem that is unreadable on x86 PCs and most other ARM
PCs.

This is now even more of a problem within Apple Silicon Macs as it is now
possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to
enable performant x86 emulation[2] and the host storage needs to be compatible
for both environments.

Thus, I'd like to see us finally make the switchover to 4k sectorsize
for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo
looked promising[4], and we've been running with this behavior on
Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

=== Changelog ===

v4: Fixed minor errors in the cover letter and patch subject

v3: Refreshed cover letter, rebased to latest, updated doc references for v6.7

v2: Rebased to latest, updated doc references for v6.6

Final v1: Collected Reviewed-by tags for inclusion.

RFC v2: Addressed documentation feedback

RFC v1: Initial submission

[0]: https://fedoraproject.org/wiki/SIGs/Asahi
[1]: https://fedora-asahi-remix.org/
[2]: https://sinrega.org/2023-10-06-using-microvms-for-gaming-on-fedora-asahi/
[3]: https://lore.kernel.org/linux-btrfs/fdffeecd-964f-0c69-f869-eb9ceca20263@suse.com/T/#m11d7939de96c43b3a7cdabc7c568d8bcafc7ca83
[4]: https://lore.kernel.org/linux-btrfs/fdffeecd-964f-0c69-f869-eb9ceca20263@suse.com/T/#mf382b78a8122b0cb82147a536c85b6a9098a2895

Neal Gompa (1):
  btrfs-progs: mkfs: Enforce 4k sectorsize by default

 Documentation/Subpage.rst    | 15 ++++++++-------
 Documentation/mkfs.btrfs.rst | 13 +++++++++----
 mkfs/main.c                  |  2 +-
 3 files changed, 18 insertions(+), 12 deletions(-)

Comments

Josef Bacik Nov. 27, 2023, 4:07 p.m. UTC | #1
On Thu, Nov 16, 2023 at 11:02:23AM -0500, Neal Gompa wrote:
> The Fedora Asahi SIG[0] is working on bringing up support for
> Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].
> 
> Apple Silicon Macs are unusual in that they currently require 16k
> page sizes, which means that the current default for mkfs.btrfs(8)
> makes a filesystem that is unreadable on x86 PCs and most other ARM
> PCs.
> 
> This is now even more of a problem within Apple Silicon Macs as it is now
> possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to
> enable performant x86 emulation[2] and the host storage needs to be compatible
> for both environments.
> 
> Thus, I'd like to see us finally make the switchover to 4k sectorsize
> for new filesystems by default, regardless of page size.
> 
> The initial test run by Hector Martin[3] at request of Qu Wenruo
> looked promising[4], and we've been running with this behavior on
> Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.
> 

This is a good change and well documented.  This isn't being ignored, it's just
a policy change that we have to be conservative about considering.  We only in
the last 3 months have added a Apple Silicon machine to our testing
infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent
subpage-blocksize testing.  Generally speaking it's been fine, we've fixed a few
things and haven't broken anything, but it's still comes with some risks when
compared to the default of using the pagesize.

We will continue to discuss this amongst ourselves and figure out what we think
would be a reasonable timeframe to make this switch and let you know what we're
thinking ASAP.  Thanks,

Josef
Hector Martin Nov. 28, 2023, 3:01 p.m. UTC | #2
On 2023/11/28 1:07, Josef Bacik wrote:
> On Thu, Nov 16, 2023 at 11:02:23AM -0500, Neal Gompa wrote:
>> The Fedora Asahi SIG[0] is working on bringing up support for
>> Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].
>>
>> Apple Silicon Macs are unusual in that they currently require 16k
>> page sizes, which means that the current default for mkfs.btrfs(8)
>> makes a filesystem that is unreadable on x86 PCs and most other ARM
>> PCs.
>>
>> This is now even more of a problem within Apple Silicon Macs as it is now
>> possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to
>> enable performant x86 emulation[2] and the host storage needs to be compatible
>> for both environments.
>>
>> Thus, I'd like to see us finally make the switchover to 4k sectorsize
>> for new filesystems by default, regardless of page size.
>>
>> The initial test run by Hector Martin[3] at request of Qu Wenruo
>> looked promising[4], and we've been running with this behavior on
>> Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.
>>
> 
> This is a good change and well documented.  This isn't being ignored, it's just
> a policy change that we have to be conservative about considering.  We only in
> the last 3 months have added a Apple Silicon machine to our testing
> infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent
> subpage-blocksize testing.  Generally speaking it's been fine, we've fixed a few
> things and haven't broken anything, but it's still comes with some risks when
> compared to the default of using the pagesize.
> 
> We will continue to discuss this amongst ourselves and figure out what we think
> would be a reasonable timeframe to make this switch and let you know what we're
> thinking ASAP.  Thanks,

Reminder that the Raspberry Pi 5 is also shipping with 16K pages by
default now. The clock is ticking for an ever-growing stream of people
upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an
x86 machine ;)

- Hector
Qu Wenruo Nov. 28, 2023, 7:57 p.m. UTC | #3
On 2023/11/29 01:31, Hector Martin wrote:
> 
> 
> On 2023/11/28 1:07, Josef Bacik wrote:
>> On Thu, Nov 16, 2023 at 11:02:23AM -0500, Neal Gompa wrote:
>>> The Fedora Asahi SIG[0] is working on bringing up support for
>>> Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].
>>>
>>> Apple Silicon Macs are unusual in that they currently require 16k
>>> page sizes, which means that the current default for mkfs.btrfs(8)
>>> makes a filesystem that is unreadable on x86 PCs and most other ARM
>>> PCs.
>>>
>>> This is now even more of a problem within Apple Silicon Macs as it is now
>>> possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to
>>> enable performant x86 emulation[2] and the host storage needs to be compatible
>>> for both environments.
>>>
>>> Thus, I'd like to see us finally make the switchover to 4k sectorsize
>>> for new filesystems by default, regardless of page size.
>>>
>>> The initial test run by Hector Martin[3] at request of Qu Wenruo
>>> looked promising[4], and we've been running with this behavior on
>>> Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.
>>>
>>
>> This is a good change and well documented.  This isn't being ignored, it's just
>> a policy change that we have to be conservative about considering.  We only in
>> the last 3 months have added a Apple Silicon machine to our testing
>> infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent
>> subpage-blocksize testing.  Generally speaking it's been fine, we've fixed a few
>> things and haven't broken anything, but it's still comes with some risks when
>> compared to the default of using the pagesize.
>>
>> We will continue to discuss this amongst ourselves and figure out what we think
>> would be a reasonable timeframe to make this switch and let you know what we're
>> thinking ASAP.  Thanks,
> 
> Reminder that the Raspberry Pi 5 is also shipping with 16K pages by
> default now. The clock is ticking for an ever-growing stream of people
> upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an
> x86 machine ;)

As long as they are using 5.15+ kernel, they should be able to mount and 
use their RPI NAS with disks from x86 machines.

The change is only for the default mkfs options.

Thanks,
Qu
> 
> - Hector
Roman Mamedov Nov. 28, 2023, 8:09 p.m. UTC | #4
On Wed, 29 Nov 2023 06:27:26 +1030
Qu Wenruo <wqu@suse.com> wrote:

> > Reminder that the Raspberry Pi 5 is also shipping with 16K pages by
> > default now. The clock is ticking for an ever-growing stream of people
> > upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an
> > x86 machine ;)
> 
> As long as they are using 5.15+ kernel, they should be able to mount and 
> use their RPI NAS with disks from x86 machines.

Doesn't the subpage sectorsize featureset only support sectors less than page
size, not the other way round?

"mkfs.btrfs -s 16K" fails to mount on 6.1.62:

[1077897.120376] BTRFS error (device dm-22): sectorsize 16384 not yet supported for page size 4096
[1077897.120624] BTRFS error (device dm-22): superblock contains fatal errors
[1077897.121394] BTRFS error (device dm-22): open_ctree failed
Qu Wenruo Nov. 28, 2023, 8:31 p.m. UTC | #5
On 2023/11/29 06:39, Roman Mamedov wrote:
> On Wed, 29 Nov 2023 06:27:26 +1030
> Qu Wenruo <wqu@suse.com> wrote:
>
>>> Reminder that the Raspberry Pi 5 is also shipping with 16K pages by
>>> default now. The clock is ticking for an ever-growing stream of people
>>> upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an
>>> x86 machine ;)
>>
>> As long as they are using 5.15+ kernel, they should be able to mount and
>> use their RPI NAS with disks from x86 machines.
>
> Doesn't the subpage sectorsize featureset only support sectors less than page
> size, not the other way round?

Well, if using the existing disks, it's really more common to let 16K
page size systems to mount 4K sector systems.

>
> "mkfs.btrfs -s 16K" fails to mount on 6.1.62:
>
> [1077897.120376] BTRFS error (device dm-22): sectorsize 16384 not yet supported for page size 4096
> [1077897.120624] BTRFS error (device dm-22): superblock contains fatal errors
> [1077897.121394] BTRFS error (device dm-22): open_ctree failed
>

That's always the case.

Although with the recent folio changes, we may add support for
multi-page sectorsizes in the future.

Thanks,
Qu
Neal Gompa Nov. 28, 2023, 9:24 p.m. UTC | #6
On Tue, Nov 28, 2023 at 2:57 PM Qu Wenruo <wqu@suse.com> wrote:
>
>
>
> On 2023/11/29 01:31, Hector Martin wrote:
> >
> >
> > On 2023/11/28 1:07, Josef Bacik wrote:
> >> On Thu, Nov 16, 2023 at 11:02:23AM -0500, Neal Gompa wrote:
> >>> The Fedora Asahi SIG[0] is working on bringing up support for
> >>> Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].
> >>>
> >>> Apple Silicon Macs are unusual in that they currently require 16k
> >>> page sizes, which means that the current default for mkfs.btrfs(8)
> >>> makes a filesystem that is unreadable on x86 PCs and most other ARM
> >>> PCs.
> >>>
> >>> This is now even more of a problem within Apple Silicon Macs as it is now
> >>> possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to
> >>> enable performant x86 emulation[2] and the host storage needs to be compatible
> >>> for both environments.
> >>>
> >>> Thus, I'd like to see us finally make the switchover to 4k sectorsize
> >>> for new filesystems by default, regardless of page size.
> >>>
> >>> The initial test run by Hector Martin[3] at request of Qu Wenruo
> >>> looked promising[4], and we've been running with this behavior on
> >>> Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.
> >>>
> >>
> >> This is a good change and well documented.  This isn't being ignored, it's just
> >> a policy change that we have to be conservative about considering.  We only in
> >> the last 3 months have added a Apple Silicon machine to our testing
> >> infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent
> >> subpage-blocksize testing.  Generally speaking it's been fine, we've fixed a few
> >> things and haven't broken anything, but it's still comes with some risks when
> >> compared to the default of using the pagesize.
> >>
> >> We will continue to discuss this amongst ourselves and figure out what we think
> >> would be a reasonable timeframe to make this switch and let you know what we're
> >> thinking ASAP.  Thanks,
> >
> > Reminder that the Raspberry Pi 5 is also shipping with 16K pages by
> > default now. The clock is ticking for an ever-growing stream of people
> > upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an
> > x86 machine ;)
>
> As long as they are using 5.15+ kernel, they should be able to mount and
> use their RPI NAS with disks from x86 machines.
>
> The change is only for the default mkfs options.
>

Right, and the thing is, it's fairly common for the disks to be
formatted from a Raspberry Pi. So until some kind of support for using
any sector size on any architecture regardless of page size lands,
this is going to be a big problem.
Hector Martin Nov. 29, 2023, 12:58 p.m. UTC | #7
On 2023/11/29 6:24, Neal Gompa wrote:
> On Tue, Nov 28, 2023 at 2:57 PM Qu Wenruo <wqu@suse.com> wrote:
>>
>>
>>
>> On 2023/11/29 01:31, Hector Martin wrote:
>>>
>>>
>>> On 2023/11/28 1:07, Josef Bacik wrote:
>>>> On Thu, Nov 16, 2023 at 11:02:23AM -0500, Neal Gompa wrote:
>>>>> The Fedora Asahi SIG[0] is working on bringing up support for
>>>>> Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].
>>>>>
>>>>> Apple Silicon Macs are unusual in that they currently require 16k
>>>>> page sizes, which means that the current default for mkfs.btrfs(8)
>>>>> makes a filesystem that is unreadable on x86 PCs and most other ARM
>>>>> PCs.
>>>>>
>>>>> This is now even more of a problem within Apple Silicon Macs as it is now
>>>>> possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to
>>>>> enable performant x86 emulation[2] and the host storage needs to be compatible
>>>>> for both environments.
>>>>>
>>>>> Thus, I'd like to see us finally make the switchover to 4k sectorsize
>>>>> for new filesystems by default, regardless of page size.
>>>>>
>>>>> The initial test run by Hector Martin[3] at request of Qu Wenruo
>>>>> looked promising[4], and we've been running with this behavior on
>>>>> Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.
>>>>>
>>>>
>>>> This is a good change and well documented.  This isn't being ignored, it's just
>>>> a policy change that we have to be conservative about considering.  We only in
>>>> the last 3 months have added a Apple Silicon machine to our testing
>>>> infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent
>>>> subpage-blocksize testing.  Generally speaking it's been fine, we've fixed a few
>>>> things and haven't broken anything, but it's still comes with some risks when
>>>> compared to the default of using the pagesize.
>>>>
>>>> We will continue to discuss this amongst ourselves and figure out what we think
>>>> would be a reasonable timeframe to make this switch and let you know what we're
>>>> thinking ASAP.  Thanks,
>>>
>>> Reminder that the Raspberry Pi 5 is also shipping with 16K pages by
>>> default now. The clock is ticking for an ever-growing stream of people
>>> upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an
>>> x86 machine ;)
>>
>> As long as they are using 5.15+ kernel, they should be able to mount and
>> use their RPI NAS with disks from x86 machines.
>>
>> The change is only for the default mkfs options.
>>
> 
> Right, and the thing is, it's fairly common for the disks to be
> formatted from a Raspberry Pi. So until some kind of support for using
> any sector size on any architecture regardless of page size lands,
> this is going to be a big problem.
> 

Yup, I meant what I said.

Someone sets up a rPi5 as a NAS, formats the disk from it, as you would
normally when setting up such a thing from scratch. Later, the rPi stops
working, as rPis often do. This person's data is now *completely
inaccessible* until they find another Raspberry Pi 5 or an Apple Silicon
laptop.

This is going to be *common*. And since the 16K decision is made at
format time, these people are going to be oblivious until they find
themselves with an urgent need to acquire a Raspberry Pi 5 to access
their data at all, and then they're going to be mad. So the longer you
wait to flip the switch, the more people unaware of their own data's
fragile accessibility condition you will build up, and the more upset
people you're going to have even long after the change was finally made.

- Hector
Qu Wenruo Nov. 29, 2023, 8:27 p.m. UTC | #8
On 2023/11/29 23:28, Hector Martin wrote:
>
>
> On 2023/11/29 6:24, Neal Gompa wrote:
>> On Tue, Nov 28, 2023 at 2:57 PM Qu Wenruo <wqu@suse.com> wrote:
>>>
>>>
>>>
>>> On 2023/11/29 01:31, Hector Martin wrote:
>>>>
>>>>
>>>> On 2023/11/28 1:07, Josef Bacik wrote:
>>>>> On Thu, Nov 16, 2023 at 11:02:23AM -0500, Neal Gompa wrote:
>>>>>> The Fedora Asahi SIG[0] is working on bringing up support for
>>>>>> Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].
>>>>>>
>>>>>> Apple Silicon Macs are unusual in that they currently require 16k
>>>>>> page sizes, which means that the current default for mkfs.btrfs(8)
>>>>>> makes a filesystem that is unreadable on x86 PCs and most other ARM
>>>>>> PCs.
>>>>>>
>>>>>> This is now even more of a problem within Apple Silicon Macs as it is now
>>>>>> possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to
>>>>>> enable performant x86 emulation[2] and the host storage needs to be compatible
>>>>>> for both environments.
>>>>>>
>>>>>> Thus, I'd like to see us finally make the switchover to 4k sectorsize
>>>>>> for new filesystems by default, regardless of page size.
>>>>>>
>>>>>> The initial test run by Hector Martin[3] at request of Qu Wenruo
>>>>>> looked promising[4], and we've been running with this behavior on
>>>>>> Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.
>>>>>>
>>>>>
>>>>> This is a good change and well documented.  This isn't being ignored, it's just
>>>>> a policy change that we have to be conservative about considering.  We only in
>>>>> the last 3 months have added a Apple Silicon machine to our testing
>>>>> infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent
>>>>> subpage-blocksize testing.  Generally speaking it's been fine, we've fixed a few
>>>>> things and haven't broken anything, but it's still comes with some risks when
>>>>> compared to the default of using the pagesize.
>>>>>
>>>>> We will continue to discuss this amongst ourselves and figure out what we think
>>>>> would be a reasonable timeframe to make this switch and let you know what we're
>>>>> thinking ASAP.  Thanks,
>>>>
>>>> Reminder that the Raspberry Pi 5 is also shipping with 16K pages by
>>>> default now. The clock is ticking for an ever-growing stream of people
>>>> upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an
>>>> x86 machine ;)
>>>
>>> As long as they are using 5.15+ kernel, they should be able to mount and
>>> use their RPI NAS with disks from x86 machines.
>>>
>>> The change is only for the default mkfs options.
>>>
>>
>> Right, and the thing is, it's fairly common for the disks to be
>> formatted from a Raspberry Pi. So until some kind of support for using
>> any sector size on any architecture regardless of page size lands,
>> this is going to be a big problem.
>>
>
> Yup, I meant what I said.
>
> Someone sets up a rPi5 as a NAS, formats the disk from it, as you would
> normally when setting up such a thing from scratch. Later, the rPi stops
> working, as rPis often do. This person's data is now *completely
> inaccessible* until they find another Raspberry Pi 5 or an Apple Silicon
> laptop.
Got it.

I am putting too much trust on RPI, as my experience is pretty good so
far (just for VM hosting and running fstests), thus I though everyone
would just go x86->aarch64, at least for NAS hosting/VM testing...

>
> This is going to be *common*. And since the 16K decision is made at
> format time, these people are going to be oblivious until they find
> themselves with an urgent need to acquire a Raspberry Pi 5 to access
> their data at all, and then they're going to be mad. So the longer you
> wait to flip the switch, the more people unaware of their own data's
> fragile accessibility condition you will build up, and the more upset
> people you're going to have even long after the change was finally made.

In that case, I'm totally fine to support the switch of default sector
size, sooner than later.

With Asahi already running 4K sector sizes, and I have not received any
death thread for the loss of one's data, I believe the prerequisite for
the switch is already here.

And even if there are hidden bugs, default to 4K is in fact going to
make it faster to get reports and fixed.

Thanks,
Qu
>
> - Hector
Neal Gompa Nov. 30, 2023, 3:38 a.m. UTC | #9
On Wed, Nov 29, 2023 at 3:28 PM Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>
>
>
> On 2023/11/29 23:28, Hector Martin wrote:
> >
> >
> > On 2023/11/29 6:24, Neal Gompa wrote:
> >> On Tue, Nov 28, 2023 at 2:57 PM Qu Wenruo <wqu@suse.com> wrote:
> >>>
> >>>
> >>>
> >>> On 2023/11/29 01:31, Hector Martin wrote:
> >>>>
> >>>>
> >>>> On 2023/11/28 1:07, Josef Bacik wrote:
> >>>>> On Thu, Nov 16, 2023 at 11:02:23AM -0500, Neal Gompa wrote:
> >>>>>> The Fedora Asahi SIG[0] is working on bringing up support for
> >>>>>> Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].
> >>>>>>
> >>>>>> Apple Silicon Macs are unusual in that they currently require 16k
> >>>>>> page sizes, which means that the current default for mkfs.btrfs(8)
> >>>>>> makes a filesystem that is unreadable on x86 PCs and most other ARM
> >>>>>> PCs.
> >>>>>>
> >>>>>> This is now even more of a problem within Apple Silicon Macs as it is now
> >>>>>> possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to
> >>>>>> enable performant x86 emulation[2] and the host storage needs to be compatible
> >>>>>> for both environments.
> >>>>>>
> >>>>>> Thus, I'd like to see us finally make the switchover to 4k sectorsize
> >>>>>> for new filesystems by default, regardless of page size.
> >>>>>>
> >>>>>> The initial test run by Hector Martin[3] at request of Qu Wenruo
> >>>>>> looked promising[4], and we've been running with this behavior on
> >>>>>> Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.
> >>>>>>
> >>>>>
> >>>>> This is a good change and well documented.  This isn't being ignored, it's just
> >>>>> a policy change that we have to be conservative about considering.  We only in
> >>>>> the last 3 months have added a Apple Silicon machine to our testing
> >>>>> infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent
> >>>>> subpage-blocksize testing.  Generally speaking it's been fine, we've fixed a few
> >>>>> things and haven't broken anything, but it's still comes with some risks when
> >>>>> compared to the default of using the pagesize.
> >>>>>
> >>>>> We will continue to discuss this amongst ourselves and figure out what we think
> >>>>> would be a reasonable timeframe to make this switch and let you know what we're
> >>>>> thinking ASAP.  Thanks,
> >>>>
> >>>> Reminder that the Raspberry Pi 5 is also shipping with 16K pages by
> >>>> default now. The clock is ticking for an ever-growing stream of people
> >>>> upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an
> >>>> x86 machine ;)
> >>>
> >>> As long as they are using 5.15+ kernel, they should be able to mount and
> >>> use their RPI NAS with disks from x86 machines.
> >>>
> >>> The change is only for the default mkfs options.
> >>>
> >>
> >> Right, and the thing is, it's fairly common for the disks to be
> >> formatted from a Raspberry Pi. So until some kind of support for using
> >> any sector size on any architecture regardless of page size lands,
> >> this is going to be a big problem.
> >>
> >
> > Yup, I meant what I said.
> >
> > Someone sets up a rPi5 as a NAS, formats the disk from it, as you would
> > normally when setting up such a thing from scratch. Later, the rPi stops
> > working, as rPis often do. This person's data is now *completely
> > inaccessible* until they find another Raspberry Pi 5 or an Apple Silicon
> > laptop.
> Got it.
>
> I am putting too much trust on RPI, as my experience is pretty good so
> far (just for VM hosting and running fstests), thus I though everyone
> would just go x86->aarch64, at least for NAS hosting/VM testing...
>
> >
> > This is going to be *common*. And since the 16K decision is made at
> > format time, these people are going to be oblivious until they find
> > themselves with an urgent need to acquire a Raspberry Pi 5 to access
> > their data at all, and then they're going to be mad. So the longer you
> > wait to flip the switch, the more people unaware of their own data's
> > fragile accessibility condition you will build up, and the more upset
> > people you're going to have even long after the change was finally made.
>
> In that case, I'm totally fine to support the switch of default sector
> size, sooner than later.
>
> With Asahi already running 4K sector sizes, and I have not received any
> death thread for the loss of one's data, I believe the prerequisite for
> the switch is already here.
>
> And even if there are hidden bugs, default to 4K is in fact going to
> make it faster to get reports and fixed.
>

For what it's worth, this change was applied at the Fedora level, so
*all* architectures have been using 4k sectorize by default for some
time now, including Fedora Asahi (ARM 16k) and Fedora POWER (64k).
David Sterba Dec. 13, 2023, 10:25 p.m. UTC | #10
On Thu, Nov 16, 2023 at 11:02:23AM -0500, Neal Gompa wrote:
> The Fedora Asahi SIG[0] is working on bringing up support for
> Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].
> 
> Apple Silicon Macs are unusual in that they currently require 16k
> page sizes, which means that the current default for mkfs.btrfs(8)
> makes a filesystem that is unreadable on x86 PCs and most other ARM
> PCs.
> 
> This is now even more of a problem within Apple Silicon Macs as it is now
> possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to
> enable performant x86 emulation[2] and the host storage needs to be compatible
> for both environments.
> 
> Thus, I'd like to see us finally make the switchover to 4k sectorsize
> for new filesystems by default, regardless of page size.
> 
> The initial test run by Hector Martin[3] at request of Qu Wenruo
> looked promising[4], and we've been running with this behavior on
> Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.
> 
> === Changelog ===
> 
> v4: Fixed minor errors in the cover letter and patch subject
> 
> v3: Refreshed cover letter, rebased to latest, updated doc references for v6.7
> 
> v2: Rebased to latest, updated doc references for v6.6
> 
> Final v1: Collected Reviewed-by tags for inclusion.
> 
> RFC v2: Addressed documentation feedback
> 
> RFC v1: Initial submission
> 
> [0]: https://fedoraproject.org/wiki/SIGs/Asahi
> [1]: https://fedora-asahi-remix.org/
> [2]: https://sinrega.org/2023-10-06-using-microvms-for-gaming-on-fedora-asahi/
> [3]: https://lore.kernel.org/linux-btrfs/fdffeecd-964f-0c69-f869-eb9ceca20263@suse.com/T/#m11d7939de96c43b3a7cdabc7c568d8bcafc7ca83
> [4]: https://lore.kernel.org/linux-btrfs/fdffeecd-964f-0c69-f869-eb9ceca20263@suse.com/T/#mf382b78a8122b0cb82147a536c85b6a9098a2895
> 
> Neal Gompa (1):
>   btrfs-progs: mkfs: Enforce 4k sectorsize by default

FYI, current plan is to add the change to 6.7 release with ETA in
January. We've discussed this and given the increasing demand for that
from various distros and testing coverage so done far it seems that it's
sufficient.
Neal Gompa Jan. 5, 2024, 11:10 p.m. UTC | #11
On Wed, Dec 13, 2023 at 5:32 PM David Sterba <dsterba@suse.cz> wrote:
>
> On Thu, Nov 16, 2023 at 11:02:23AM -0500, Neal Gompa wrote:
> > The Fedora Asahi SIG[0] is working on bringing up support for
> > Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].
> >
> > Apple Silicon Macs are unusual in that they currently require 16k
> > page sizes, which means that the current default for mkfs.btrfs(8)
> > makes a filesystem that is unreadable on x86 PCs and most other ARM
> > PCs.
> >
> > This is now even more of a problem within Apple Silicon Macs as it is now
> > possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to
> > enable performant x86 emulation[2] and the host storage needs to be compatible
> > for both environments.
> >
> > Thus, I'd like to see us finally make the switchover to 4k sectorsize
> > for new filesystems by default, regardless of page size.
> >
> > The initial test run by Hector Martin[3] at request of Qu Wenruo
> > looked promising[4], and we've been running with this behavior on
> > Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.
> >
> > === Changelog ===
> >
> > v4: Fixed minor errors in the cover letter and patch subject
> >
> > v3: Refreshed cover letter, rebased to latest, updated doc references for v6.7
> >
> > v2: Rebased to latest, updated doc references for v6.6
> >
> > Final v1: Collected Reviewed-by tags for inclusion.
> >
> > RFC v2: Addressed documentation feedback
> >
> > RFC v1: Initial submission
> >
> > [0]: https://fedoraproject.org/wiki/SIGs/Asahi
> > [1]: https://fedora-asahi-remix.org/
> > [2]: https://sinrega.org/2023-10-06-using-microvms-for-gaming-on-fedora-asahi/
> > [3]: https://lore.kernel.org/linux-btrfs/fdffeecd-964f-0c69-f869-eb9ceca20263@suse.com/T/#m11d7939de96c43b3a7cdabc7c568d8bcafc7ca83
> > [4]: https://lore.kernel.org/linux-btrfs/fdffeecd-964f-0c69-f869-eb9ceca20263@suse.com/T/#mf382b78a8122b0cb82147a536c85b6a9098a2895
> >
> > Neal Gompa (1):
> >   btrfs-progs: mkfs: Enforce 4k sectorsize by default
>
> FYI, current plan is to add the change to 6.7 release with ETA in
> January. We've discussed this and given the increasing demand for that
> from various distros and testing coverage so done far it seems that it's
> sufficient.
>

Is this queued yet for the btrfs-progs v6.7 release? I don't see it in
your devel tree[1] yet...

[1]: https://github.com/kdave/btrfs-progs/commits/devel/