In update_super() 'chunk->stripe.devid' and 'super->dev_item.devid' both
are little endian. So we should not use endian helper
btrfs_set_stack_stripe_devid().
Signed-off-by: Byongho Lee
---
btrfs-image.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --g
This is a same patch as Zach Brown's but we lost so I resend it based on
current code.
- 'commit 2cd95f945a61 ("fix endian bugs in chunk rebuilding")'
Signed-off-by: Zach Brown
Signed-off-by: Byongho Lee
---
chunk-recover.c | 8
1 file changed, 4 insertions
Fix the code assigning 0 to pointer instead of NULL.
Signed-off-by: Byongho Lee
---
cmds-fi-usage.c | 12 ++--
props.c | 2 +-
qgroup.c| 6 --
utils.c | 4 ++--
4 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/cmds-fi-usage.c b/cmds-fi
Signed-off-by: Byongho Lee
---
btrfs-show-super.c | 4 ++--
qgroup-verify.c| 8
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/btrfs-show-super.c b/btrfs-show-super.c
index c0ffeacb928c..f11701539d1a 100644
--- a/btrfs-show-super.c
+++ b/btrfs-show-super.c
@@ -334,7
emory data and replace on-disk structure
'btrfs_qgroup_info_item' by 'qgroup_info'. In addition in alloc_cnt()
'generation' is set but not used after that so remove the relevant code.
Signed-off-by: Byongho Lee
---
v2:
remove, "Signed-off-by: Zach Brown " which was for
FLAGS)'.
BTW, I'm not familiar with make tool so there could be some my
misunderstanding and better solution.
Signed-off-by: Byongho Lee
---
Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 85b45e5bee3b..3b98709f31a5 10
store in memory data:
remove, "Signed-off-by: Zach Brown " which was for
below patch but added by mistake.
'[PATCH 4/6] btrfs-progs: fix endian bugs in chunk rebuilding'
Byongho Lee (6):
btrfs-progs: get sparse checking working
btrfs-progs: use NULL instead of 0
I'ms sorry.
While writing cover-letter I missed to add prefix 'btrfs-progs' in subject.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
emory data and replace on-disk structure
'btrfs_qgroup_info_item' by 'qgroup_info'. In addition in alloc_cnt()
'generation' is set but not used after that so remove the relevant code.
Signed-off-by: Zach Brown
Signed-off-by: Byongho Lee
---
qgroup-verify.c | 28 +++
Fix the code assigning 0 to pointer instead of NULL.
Signed-off-by: Byongho Lee
---
cmds-fi-usage.c | 12 ++--
props.c | 2 +-
qgroup.c| 6 --
utils.c | 4 ++--
4 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/cmds-fi-usage.c b/cmds-fi
In update_super() 'chunk->stripe.devid' and 'super->dev_item.devid' both
are little endian. So we should not use endian helper
btrfs_set_stack_stripe_devid().
Signed-off-by: Byongho Lee
---
btrfs-image.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --g
GS)'.
BTW, I'm not familiar with make tool so there could be some my
misunderstanding and better solution.
Signed-off-by: Byongho Lee
---
Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 85b45e5bee3b..3b98709f31a5 10
This is a same patch as Zach Brown's but we lost so I resend it based on
current code.
- 'commit 2cd95f945a61 ("fix endian bugs in chunk rebuilding")'
Signed-off-by: Zach Brown
Signed-off-by: Byongho Lee
---
chunk-recover.c | 8
1 file changed, 4 insertions
Signed-off-by: Byongho Lee
---
btrfs-show-super.c | 4 ++--
qgroup-verify.c| 8
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/btrfs-show-super.c b/btrfs-show-super.c
index c0ffeacb928c..f11701539d1a 100644
--- a/btrfs-show-super.c
+++ b/btrfs-show-super.c
@@ -334,7
This is a patch-set after getting running sparse.
There are two endian patches one is new and the other is Zach Brown's work
but we lost. And rest are just for clean-ups.
Byongho Lee (6):
btrfs-progs: get sparse checking working
btrfs-progs: use NULL instead of 0
btrfs-progs: make pr
'.
So this patch replaces 'xxx * 1024 * 1024' kind of expression with
single 'SZ_xxxMB' if 'xxx' is a power of 2 then 'xxx * SZ_1M' if 'xxx' is
not a power of 2. And I haven't touched to '4096' & '8192' because it&
comp_workspace_wait[BTRFS_COMPRESS_TYPES]
BTW, while accessing one compress type of these variables, the next or
before address is other compress types of it.
So this patch puts these variables in a struct to make cache friendly.
Signed-off-by: Byongho Lee
---
V2: Apply David's review co
David Sterba writes:
>
>> +static struct {
>> +struct list_head idle_workspace;
>> +spinlock_t workspace_lock;
>> +int num_workspace;
>> +atomic_t alloc_workspace;
>> +wait_queue_head_t workspace_wait;
>> +} comp[BTRFS_COMPRESS_TYPES];
>
> The name became too generic, please r
comp_workspace_wait[BTRFS_COMPRESS_TYPES]
BTW, while accessing one compress type of these variables, the next or
before address is other compress types of it.
So this patch puts these variables in a struct to make cache friendly.
Signed-off-by: Byongho Lee
---
fs/btrfs/compression.c | 46
This patch eliminates the last item of prop_handlers array which is used
to check end of array and instead uses ARRAY_SIZE macro.
Though this is a very tiny optimization, using ARRAY_SIZE macro is a
good practice to iterate array.
Signed-off-by: Byongho Lee
---
fs/btrfs/props.c | 13
We can safely iterate whole list items, without using list_del macro.
So remove the list_del call.
Signed-off-by: Byongho Lee
---
fs/btrfs/inode.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index bda3c41dc9d5..fe42e339efec 100644
--- a/fs/btrfs
There is no removing list element while iterating over list.
So, replace list_for_each_entry_safe to list_for_each_entry.
Signed-off-by: Byongho Lee
---
fs/btrfs/ioctl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 0adf5422fce9
In btrfs_add_to_fsid(), strdup() allocates memory to device->name, but
the return value is not checked.
So add the return value check and error handling code.
And clean-up error handling code for ENOMEM case.
Signed-off-by: Byongho Lee
---
utils.c | 20
1 file changed,
In btrfs-map-logical main(), strdup() allocates memory to output_file,
but that memory is not freed.
So add missing free() calls before return.
Signed-off-by: Byongho Lee
---
btrfs-map-logical.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c
1. fix memory leak in btrfs-convert main()
2. fix memory leak in btrfs-map-logical main()
3. add memory allocation fail check in btrfs_add_to_fsid()
Byongho Lee (3):
btrfs-progs: fix memory leak in btrfs-convert main()
btrfs-progs: fix memory leak in btrfs-map-logical main()
btrfs-progs
strncpy().
And btrfs-convert main() guarantees that string length of fslabel is not
to exceed 'BTRFS_LABEL_SIZE', so it's enough to use strcpy() instead of
strncpy() to copy fslabel in do_convert().
Signed-off-by: Byongho Lee
---
btrfs-convert.c | 9 +
1 file changed, 5 i
This patch includes below fixes in error path:
1. fix memory leaks if realloc() fails
2. add missing call free_history() before return error in scrub_read_file()
Signed-off-by: Byongho Lee
---
changelog:
v2:
Add one more fix for memory leak when realloc() fails by Zhao Lei's co
Zhao Lei writes:
> Hi, Byongho Lee
>
>> -Original Message-
>> From: linux-btrfs-ow...@vger.kernel.org
>> [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Byongho Lee
>> Sent: Friday, August 21, 2015 11:10 AM
>> To: linux-btrfs@vger.kernel.org
This patch includes below fixes in error path:
1. fix memory leaks if realloc() fails
2. add missing call free_history() before return error in scrub_read_file()
Signed-off-by: Byongho Lee
---
btrfs-list.c | 8
cmds-scrub.c | 18 ++
qgroup.c | 8
3 files
he mutex from struct 'btrfs_fs_info' and its
initialization code.
Signed-off-by: Byongho Lee
---
fs/btrfs/ctree.h | 6 --
fs/btrfs/disk-io.c | 1 -
2 files changed, 7 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index aac314e14188..cdde6d541b3a 100644
--- a/fs/btrfs/
30 matches
Mail list logo