* [PATCH 0/1] Btrfs support for RAID1C34
@ 2019-11-04 16:22 David Sterba
2019-11-04 16:23 ` [PATCH 1/1] btrfs: add support for new raid1c34 profiles David Sterba
0 siblings, 1 reply; 5+ messages in thread
From: David Sterba @ 2019-11-04 16:22 UTC (permalink / raw)
To: grub-devel
Hi,
btrfs is going to get support for 3- and 4-copy RAID1,
https://lore.kernel.org/linux-btrfs/cover.1572534591.git.dsterba@suse.com/
This patch adds the support. The code changes are minimal, it's
essentially only extension of what RAID1 does.
I haven't tested it though, the docs don't see to cover filesystem
support testing. What I tried:
* make btrfs_test
* ./btrfs_test
It did not find any compressible file from the candidate list, I wonder
why a dummy zero-filled file cannot be created instead.
Then running it seems to create only the default profile of the images
(mkfs prints only single/dup for data and metadata), the following
message seems to repeat without any real progress:
--
Label: grub_;/testé莭莽😁киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoi
UUID: f6d3e26c-4d6c-407d-b981-7aa6d842578a
Node size: 16384
Sector size: 4096
Filesystem size: 5.66GiB
Block group profiles:
Data: single 8.00MiB
Metadata: DUP 256.00MiB
System: DUP 8.00MiB
SSD detected: no
Incompat features: extref, skinny-metadata
Number of devices: 1
Devices:
ID SIZE PATH
1 5.66GiB /dev/loop0
Device proc: Filesystem type procfs - Sector size 512B - Total size 0KiB
Device loop0: Filesystem type btrfs - Label `grub_;/testé莭莽😁киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoi', UUID f6d3e26c-4d6c-407d-b981-7aa6d842578a - Sector size 512B - Total size 5939200KiB
Device host: Filesystem type hostfs - Sector size 512B - Total size 0KiB
umount: /tmp/tmp.1I3JDrkI64/btrfs_zstd_rw: not mounted.
--
There must be something I'm missing, please advise. Thanks.
David Sterba (1):
btrfs: add support for new raid1c34 profiles
grub-core/fs/btrfs.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--
2.23.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] btrfs: add support for new raid1c34 profiles
2019-11-04 16:22 [PATCH 0/1] Btrfs support for RAID1C34 David Sterba
@ 2019-11-04 16:23 ` David Sterba
2019-11-05 12:18 ` Daniel Kiper
0 siblings, 1 reply; 5+ messages in thread
From: David Sterba @ 2019-11-04 16:23 UTC (permalink / raw)
To: grub-devel
There are new 3- and 4-copy variants of RAID1, estimated to be merged to
kernel 5.5. Add the two new profiles to the list of recognized ones. As
this builds on the same code as RAID1, only the redundancy level needs
to be adjusted, the rest is done by the existing code.
Signed-off-by: David Sterba <dsterba@suse.com>
---
grub-core/fs/btrfs.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index 48bd3d04a5e6..66e301b3f13c 100644
--- a/grub-core/fs/btrfs.c
+++ b/grub-core/fs/btrfs.c
@@ -136,6 +136,8 @@ struct grub_btrfs_chunk_item
#define GRUB_BTRFS_CHUNK_TYPE_RAID10 0x40
#define GRUB_BTRFS_CHUNK_TYPE_RAID5 0x80
#define GRUB_BTRFS_CHUNK_TYPE_RAID6 0x100
+#define GRUB_BTRFS_CHUNK_TYPE_RAID1C3 0x200
+#define GRUB_BTRFS_CHUNK_TYPE_RAID1C4 0x400
grub_uint8_t dummy2[0xc];
grub_uint16_t nstripes;
grub_uint16_t nsubstripes;
@@ -964,14 +966,20 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr,
csize = (stripen + 1) * stripe_length - off;
break;
}
+ case GRUB_BTRFS_CHUNK_TYPE_RAID1C4:
+ redundancy++;
+ /* fall through */
+ case GRUB_BTRFS_CHUNK_TYPE_RAID1C3:
+ redundancy++;
+ /* fall through */
case GRUB_BTRFS_CHUNK_TYPE_DUPLICATED:
case GRUB_BTRFS_CHUNK_TYPE_RAID1:
{
- grub_dprintf ("btrfs", "RAID1\n");
+ redundancy++;
+ grub_dprintf ("btrfs", "RAID1 (copies: %d)\n", redundancy);
stripen = 0;
stripe_offset = off;
csize = grub_le_to_cpu64 (chunk->size) - off;
- redundancy = 2;
break;
}
case GRUB_BTRFS_CHUNK_TYPE_RAID0:
--
2.23.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] btrfs: add support for new raid1c34 profiles
2019-11-04 16:23 ` [PATCH 1/1] btrfs: add support for new raid1c34 profiles David Sterba
@ 2019-11-05 12:18 ` Daniel Kiper
2019-11-27 12:56 ` David Sterba
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Kiper @ 2019-11-05 12:18 UTC (permalink / raw)
To: David Sterba; +Cc: grub-devel
On Mon, Nov 04, 2019 at 05:23:22PM +0100, David Sterba wrote:
> There are new 3- and 4-copy variants of RAID1, estimated to be merged to
> kernel 5.5. Add the two new profiles to the list of recognized ones. As
> this builds on the same code as RAID1, only the redundancy level needs
> to be adjusted, the rest is done by the existing code.
>
> Signed-off-by: David Sterba <dsterba@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> but I will apply it
if patches are in Linux kernel 5.5 (or later). So, please drop me a line
when it happens.
Daniel
> ---
> grub-core/fs/btrfs.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
> index 48bd3d04a5e6..66e301b3f13c 100644
> --- a/grub-core/fs/btrfs.c
> +++ b/grub-core/fs/btrfs.c
> @@ -136,6 +136,8 @@ struct grub_btrfs_chunk_item
> #define GRUB_BTRFS_CHUNK_TYPE_RAID10 0x40
> #define GRUB_BTRFS_CHUNK_TYPE_RAID5 0x80
> #define GRUB_BTRFS_CHUNK_TYPE_RAID6 0x100
> +#define GRUB_BTRFS_CHUNK_TYPE_RAID1C3 0x200
> +#define GRUB_BTRFS_CHUNK_TYPE_RAID1C4 0x400
> grub_uint8_t dummy2[0xc];
> grub_uint16_t nstripes;
> grub_uint16_t nsubstripes;
> @@ -964,14 +966,20 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr,
> csize = (stripen + 1) * stripe_length - off;
> break;
> }
> + case GRUB_BTRFS_CHUNK_TYPE_RAID1C4:
> + redundancy++;
> + /* fall through */
> + case GRUB_BTRFS_CHUNK_TYPE_RAID1C3:
> + redundancy++;
> + /* fall through */
> case GRUB_BTRFS_CHUNK_TYPE_DUPLICATED:
> case GRUB_BTRFS_CHUNK_TYPE_RAID1:
> {
> - grub_dprintf ("btrfs", "RAID1\n");
> + redundancy++;
> + grub_dprintf ("btrfs", "RAID1 (copies: %d)\n", redundancy);
> stripen = 0;
> stripe_offset = off;
> csize = grub_le_to_cpu64 (chunk->size) - off;
> - redundancy = 2;
> break;
> }
> case GRUB_BTRFS_CHUNK_TYPE_RAID0:
> --
> 2.23.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] btrfs: add support for new raid1c34 profiles
2019-11-05 12:18 ` Daniel Kiper
@ 2019-11-27 12:56 ` David Sterba
2019-11-29 15:38 ` Daniel Kiper
0 siblings, 1 reply; 5+ messages in thread
From: David Sterba @ 2019-11-27 12:56 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: David Sterba
On Tue, Nov 05, 2019 at 01:18:41PM +0100, Daniel Kiper wrote:
> On Mon, Nov 04, 2019 at 05:23:22PM +0100, David Sterba wrote:
> > There are new 3- and 4-copy variants of RAID1, estimated to be merged to
> > kernel 5.5. Add the two new profiles to the list of recognized ones. As
> > this builds on the same code as RAID1, only the redundancy level needs
> > to be adjusted, the rest is done by the existing code.
> >
> > Signed-off-by: David Sterba <dsterba@suse.com>
>
> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> but I will apply it
> if patches are in Linux kernel 5.5 (or later). So, please drop me a line
> when it happens.
FYI, the kernel code has been merged, first milestone will be 5.5-rc1
in a week o so.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] btrfs: add support for new raid1c34 profiles
2019-11-27 12:56 ` David Sterba
@ 2019-11-29 15:38 ` Daniel Kiper
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Kiper @ 2019-11-29 15:38 UTC (permalink / raw)
To: David Sterba; +Cc: The development of GNU GRUB
On Wed, Nov 27, 2019 at 01:56:56PM +0100, David Sterba wrote:
> On Tue, Nov 05, 2019 at 01:18:41PM +0100, Daniel Kiper wrote:
> > On Mon, Nov 04, 2019 at 05:23:22PM +0100, David Sterba wrote:
> > > There are new 3- and 4-copy variants of RAID1, estimated to be merged to
> > > kernel 5.5. Add the two new profiles to the list of recognized ones. As
> > > this builds on the same code as RAID1, only the redundancy level needs
> > > to be adjusted, the rest is done by the existing code.
> > >
> > > Signed-off-by: David Sterba <dsterba@suse.com>
> >
> > Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> but I will apply it
> > if patches are in Linux kernel 5.5 (or later). So, please drop me a line
> > when it happens.
>
> FYI, the kernel code has been merged, first milestone will be 5.5-rc1
> in a week o so.
Great! I will merge this patch next week or so.
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-11-29 15:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-04 16:22 [PATCH 0/1] Btrfs support for RAID1C34 David Sterba
2019-11-04 16:23 ` [PATCH 1/1] btrfs: add support for new raid1c34 profiles David Sterba
2019-11-05 12:18 ` Daniel Kiper
2019-11-27 12:56 ` David Sterba
2019-11-29 15:38 ` Daniel Kiper
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.