* [PATCH 0/2] Two small patches for the raid56 code
@ 2013-02-13 20:59 Andreas Philipp
2013-02-13 20:59 ` [PATCH 1/2] Minor format cleanup Andreas Philipp
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Andreas Philipp @ 2013-02-13 20:59 UTC (permalink / raw)
To: linux-btrfs; +Cc: Andreas Philipp, Chris Mason
Hi,
The last few days I have been playing around with Chris Mason's
raid56-experimental branch (Thanks!) and discovered two minor issues.
Thanks,
Andreas
Andreas Philipp (2):
Minor format cleanup.
Correct allowed raid levels on balance.
fs/btrfs/ctree.h | 4 ++--
fs/btrfs/volumes.c | 11 +++++------
2 files changed, 7 insertions(+), 8 deletions(-)
--
1.7.12.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] Minor format cleanup.
2013-02-13 20:59 [PATCH 0/2] Two small patches for the raid56 code Andreas Philipp
@ 2013-02-13 20:59 ` Andreas Philipp
2013-02-13 20:59 ` [PATCH 2/2] Correct allowed raid levels on balance Andreas Philipp
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Andreas Philipp @ 2013-02-13 20:59 UTC (permalink / raw)
To: linux-btrfs; +Cc: Andreas Philipp, Chris Mason
Clean up the format of the definitions of BTRFS_BLOCK_GROUP_RAID5 and
BTRFS_BLOCK_GROUP_RAID6.
Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
---
fs/btrfs/ctree.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index e3a4fd7..ea688aa 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -954,8 +954,8 @@ struct btrfs_dev_replace_item {
#define BTRFS_BLOCK_GROUP_RAID1 (1ULL << 4)
#define BTRFS_BLOCK_GROUP_DUP (1ULL << 5)
#define BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6)
-#define BTRFS_BLOCK_GROUP_RAID5 (1 << 7)
-#define BTRFS_BLOCK_GROUP_RAID6 (1 << 8)
+#define BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7)
+#define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8)
#define BTRFS_BLOCK_GROUP_RESERVED BTRFS_AVAIL_ALLOC_BIT_SINGLE
#define BTRFS_NR_RAID_TYPES 7
--
1.7.12.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] Correct allowed raid levels on balance.
2013-02-13 20:59 [PATCH 0/2] Two small patches for the raid56 code Andreas Philipp
2013-02-13 20:59 ` [PATCH 1/2] Minor format cleanup Andreas Philipp
@ 2013-02-13 20:59 ` Andreas Philipp
2013-05-11 11:12 ` [PATCH RESEND 1/2] Minor format cleanup Andreas Philipp
2013-05-11 11:13 ` [PATCH RESEND 2/2] Correct allowed raid levels on balance Andreas Philipp
3 siblings, 0 replies; 5+ messages in thread
From: Andreas Philipp @ 2013-02-13 20:59 UTC (permalink / raw)
To: linux-btrfs; +Cc: Andreas Philipp, Chris Mason
Raid5 with 3 devices is well defined while the old logic allowed
raid5 only with a minimum of 4 devices when converting the block group
profile via btrfs balance. Creating a raid5 with just three devices
using mkfs.btrfs worked always as expected. This is now fixed and the
whole logic is rewritten.
Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
---
fs/btrfs/volumes.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 8818dc3..6885165 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -3046,13 +3046,12 @@ int btrfs_balance(struct btrfs_balance_control *bctl,
allowed = BTRFS_AVAIL_ALLOC_BIT_SINGLE;
if (num_devices == 1)
allowed |= BTRFS_BLOCK_GROUP_DUP;
- else if (num_devices < 4)
+ if (num_devices > 1)
allowed |= (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1);
- else
- allowed |= (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 |
- BTRFS_BLOCK_GROUP_RAID10 |
- BTRFS_BLOCK_GROUP_RAID5 |
- BTRFS_BLOCK_GROUP_RAID6);
+ if (num_devices > 2)
+ allowed |= BTRFS_BLOCK_GROUP_RAID5;
+ if (num_devices > 3)
+ allowed |= (BTRFS_BLOCK_GROUP_RAID10 | BTRFS_BLOCK_GROUP_RAID6);
if ((bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) &&
(!alloc_profile_is_valid(bctl->data.target, 1) ||
--
1.7.12.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH RESEND 1/2] Minor format cleanup.
2013-02-13 20:59 [PATCH 0/2] Two small patches for the raid56 code Andreas Philipp
2013-02-13 20:59 ` [PATCH 1/2] Minor format cleanup Andreas Philipp
2013-02-13 20:59 ` [PATCH 2/2] Correct allowed raid levels on balance Andreas Philipp
@ 2013-05-11 11:12 ` Andreas Philipp
2013-05-11 11:13 ` [PATCH RESEND 2/2] Correct allowed raid levels on balance Andreas Philipp
3 siblings, 0 replies; 5+ messages in thread
From: Andreas Philipp @ 2013-05-11 11:12 UTC (permalink / raw)
To: linux-btrfs, Hugo Mills, Marcus Lövgren,
Remco Hosman - Yerf IT
Cc: Andreas Philipp, Chris Mason
Clean up the format of the definitions of BTRFS_BLOCK_GROUP_RAID5 and
BTRFS_BLOCK_GROUP_RAID6.
Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
---
fs/btrfs/ctree.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index e3a4fd7..ea688aa 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -954,8 +954,8 @@ struct btrfs_dev_replace_item {
#define BTRFS_BLOCK_GROUP_RAID1 (1ULL << 4)
#define BTRFS_BLOCK_GROUP_DUP (1ULL << 5)
#define BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6)
-#define BTRFS_BLOCK_GROUP_RAID5 (1 << 7)
-#define BTRFS_BLOCK_GROUP_RAID6 (1 << 8)
+#define BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7)
+#define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8)
#define BTRFS_BLOCK_GROUP_RESERVED BTRFS_AVAIL_ALLOC_BIT_SINGLE
#define BTRFS_NR_RAID_TYPES 7
-- 1.7.12.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH RESEND 2/2] Correct allowed raid levels on balance.
2013-02-13 20:59 [PATCH 0/2] Two small patches for the raid56 code Andreas Philipp
` (2 preceding siblings ...)
2013-05-11 11:12 ` [PATCH RESEND 1/2] Minor format cleanup Andreas Philipp
@ 2013-05-11 11:13 ` Andreas Philipp
3 siblings, 0 replies; 5+ messages in thread
From: Andreas Philipp @ 2013-05-11 11:13 UTC (permalink / raw)
To: linux-btrfs, Hugo Mills, Marcus Lövgren,
Remco Hosman - Yerf IT
Cc: Andreas Philipp, Chris Mason
Raid5 with 3 devices is well defined while the old logic allowed
raid5 only with a minimum of 4 devices when converting the block group
profile via btrfs balance. Creating a raid5 with just three devices
using mkfs.btrfs worked always as expected. This is now fixed and the
whole logic is rewritten.
Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
---
fs/btrfs/volumes.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 8818dc3..6885165 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -3046,13 +3046,12 @@ int btrfs_balance(struct btrfs_balance_control
*bctl,
allowed = BTRFS_AVAIL_ALLOC_BIT_SINGLE;
if (num_devices == 1)
allowed |= BTRFS_BLOCK_GROUP_DUP;
- else if (num_devices < 4)
+ if (num_devices > 1)
allowed |= (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1);
- else
- allowed |= (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 |
- BTRFS_BLOCK_GROUP_RAID10 |
- BTRFS_BLOCK_GROUP_RAID5 |
- BTRFS_BLOCK_GROUP_RAID6);
+ if (num_devices > 2)
+ allowed |= BTRFS_BLOCK_GROUP_RAID5;
+ if (num_devices > 3)
+ allowed |= (BTRFS_BLOCK_GROUP_RAID10 | BTRFS_BLOCK_GROUP_RAID6);
if ((bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) &&
(!alloc_profile_is_valid(bctl->data.target, 1) ||
--
1.7.12.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-11 11:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-13 20:59 [PATCH 0/2] Two small patches for the raid56 code Andreas Philipp
2013-02-13 20:59 ` [PATCH 1/2] Minor format cleanup Andreas Philipp
2013-02-13 20:59 ` [PATCH 2/2] Correct allowed raid levels on balance Andreas Philipp
2013-05-11 11:12 ` [PATCH RESEND 1/2] Minor format cleanup Andreas Philipp
2013-05-11 11:13 ` [PATCH RESEND 2/2] Correct allowed raid levels on balance Andreas Philipp
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).