The strdup()s not freed are reported as memory leaks by valgrind.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
cmds-subvolume.c | 48 ++--
1 file changed, 34 insertions(+), 14 deletions(-)
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
Originally the local pending_list is not guaranteed to be freed upon fails, it
should be emptyed and the elements should be freed.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
utils.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/utils.c b/utils.c
The local probe variable in is_ssd() freed upon unsuccessful return;
The local dir_head list in make_image() freed upon unsuccessful return.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
mkfs.c | 12 +++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/mkfs.c b
The seen cache_tree in run_next_block freed.
Originally, this missing causes memory leaks, reported by valgrind.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
cmds-check.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/cmds-check.c b/cmds-check.c
index 6cbd5a6..0cba4cc
Memory leaks found by the tool--valgrind along with static reviewing.
Based on Daivd's branch 'integration-20130903'.
Gui Hecheng (5):
btrfs-progs:free local variable buf upon unsuccessful returns
btrfs-progs:local variable memory freed
btrfs-progs: missing tree-freeing statements added
The variable buf passed into find_collision() as parameter name should be
freed on unsuccessful returns.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs-image.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/btrfs-image.c b/btrfs-image.c
index 3ea3730..1a52aa6 100644
The strdup()s not freed are reported as memory leaks by valgrind.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
Changelog V1 - V2:
- None
---
cmds-subvolume.c | 40 ++--
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/cmds
The strdup()s not freed are reported as memory leaks by valgrind.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
Changelog V1 - V2:
- remove the if decision before free()
Changelog V2 - V3:
- correct confusing subject and add changelog
---
cmds-subvolume.c | 40
On Thu, 2013-09-05 at 09:10 +0200, Stefan Behrens wrote:
On Thu, 05 Sep 2013 09:00:07 +0200, Stefan Behrens wrote:
On Thu, 5 Sep 2013 10:38:58 +0800, Gui Hecheng wrote:
The strdup()s not freed are reported as memory leaks by valgrind.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
(in kernel/git/torvalds/linux.git)
handled by the patch:
[PATCH 2/3] Btrfs: fix oops caused by the space balance
and dead roots
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
tests/btrfs/319 | 71 +
tests/btrfs/319.out | 2 ++
tests
On Tue, 2013-10-08 at 13:21 -0400, Josef Bacik wrote:
On Tue, Oct 08, 2013 at 09:21:15AM +0800, Gui Hecheng wrote:
Originally, when executing btrfs balance right after
btrfs subvolume snaphot btrfs subvolume delete,
a kernel BUG arises.
This problem is caused by the patch:
[PATCH 1
(in kernel/git/torvalds/linux.git)
handled by the patch:
[PATCH 2/3] Btrfs: fix oops caused by the space balance
and dead roots
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
Reviewed-by: Josef Bacik jba...@fusionio.com
---
Changelog V1-V2
change test number 319 - 012
---
tests/btrfs/012
On Fri, 2014-02-14 at 18:30 +0100, David Sterba wrote:
On Thu, Feb 13, 2014 at 11:16:38AM +0800, Gui Hecheng wrote:
@@ -6460,6 +6460,7 @@ int cmd_check(int argc, char **argv)
!extent_buffer_uptodate(info-dev_root-node) ||
!extent_buffer_uptodate(info-chunk_root-node
Add close_ctree()s before the returns on errors after open_ctree()
Also merge the err returns into the goto + single return pattern.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog:
v1-v2: merge err returns into goto + single return pattern
---
cmds-check.c | 32
When exec btrfs-debug-tree as non-root user, we get a segment fault.
Because the btrfs_scan_block_devices return a success 0 when we fail
to open a device. Now we just return the errno if this case happens.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
utils.c | 3 ++-
1 file changed
-ENOENT.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils.c b/utils.c
index 1878abc..12ed2f4 100644
--- a/utils.c
+++ b/utils.c
@@ -1114,7 +1114,7 @@ again:
dirp = opendir(dirname);
if (!dirp
outputs. Showing an error msg together with
the right result is really awkward.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
utils.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/utils.c b/utils.c
index 12ed2f4..9408885 100644
--- a/utils.c
+++ b/utils.c
@@ -2206,8 +2206,6 @@ again
of check_mounted.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs-convert.c | 7 ++-
btrfstune.c | 7 ++-
cmds-rescue.c | 14 +++---
3 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/btrfs-convert.c b/btrfs-convert.c
index 1b66de7..a8b2c51 100644
1. use usage() to replace the fprintf()
2. use check_argc_exact() to replace argc != ...
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
cmds-device.c | 13 -
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/cmds-device.c b/cmds-device.c
index ad59600..5009d9a
The usage() calls exit() internally, so remove the return after it.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
cmds-fi-disk_usage.c | 12 +++-
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/cmds-fi-disk_usage.c b/cmds-fi-disk_usage.c
index e4eb72b..a3b06be
seems a little confusing.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
cmds-device.c | 61 ++-
1 file changed, 39 insertions(+), 22 deletions(-)
diff --git a/cmds-device.c b/cmds-device.c
index 5009d9a..d79732f 100644
--- a/cmds
On Mon, 2014-03-10 at 16:25 -0700, Saul Wold wrote:
Hi There
There seems to be an issue if we try to build a btrfs based FS that is
less than 70M, we get the following assertion failure:
mkfs.btrfs: extent-tree.c:2682: btrfs_reserve_extent: Assertion `!(ret)'
failed.
I tried to do a
On Mon, 2014-03-10 at 20:16 -0700, Saul Wold wrote:
On 03/10/2014 07:38 PM, Gui Hecheng wrote:
On Mon, 2014-03-10 at 16:25 -0700, Saul Wold wrote:
Hi There
There seems to be an issue if we try to build a btrfs based FS that is
less than 70M, we get the following assertion failure
On Mon, 2014-03-10 at 23:41 -0700, Saul Wold wrote:
On 03/10/2014 10:47 PM, Gui Hecheng wrote:
On Mon, 2014-03-10 at 20:16 -0700, Saul Wold wrote:
On 03/10/2014 07:38 PM, Gui Hecheng wrote:
On Mon, 2014-03-10 at 16:25 -0700, Saul Wold wrote:
Hi There
There seems to be an issue if we
Wold s...@linux.intel.com
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
mkfs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/mkfs.c b/mkfs.c
index 2dc90c2..1bd3069 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -756,6 +756,7 @@ static int traverse_directory(struct
If the list is not initialized, don't try to free it.
Otherwise it will cause segmentfault.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
mkfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mkfs.c b/mkfs.c
index d7049c9..df22c3a 100644
--- a/mkfs.c
+++ b
and adopt the single return + goto out pattern
Reported-by: Saul Wold s...@linux.intel.com
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
change log
v1-v2: 1. add check for realpath() return value
2. fix memory leaks for dir_entry
3. adopt single
On Thu, 2014-03-27 at 16:27 +0100, David Sterba wrote:
On Thu, Mar 27, 2014 at 09:35:41AM +0200, Brendan Hide wrote:
On 2014/03/27 04:51 AM, Gui Hecheng wrote:
[snip]
We add t/p/e support by replacing lib/cmdline.c:memparse
with btrfs_memparse. The btrfs_memparse copies memparse's code
For modern filesystems such as btrfs, t/p/e size level operations
are common.
add size unit t/p/e parsing to memparse
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
lib/cmdline.c | 23 +++
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/lib/cmdline.c
btrfs resize now support size unit parse of k/m/g/t/p/e in kernel space,
adopt the changes in userspace manpage.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
cmds-filesystem.c | 3 ++-
man/btrfs.8.in| 9 +
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git
Originally following cmds will work:
# btrfs fi resize -10A mnt
# btrfs fi resize -10Gaha mnt
Filter the arg by checking the return pointer of memparse.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 5 +++--
1 file changed, 3 insertions(+), 2
On Mon, 2014-03-31 at 13:17 +0200, Brendan Hide wrote:
On 31/03/14 12:03, Gui Hecheng wrote:
- * potentially suffixed with %K (for kilobytes, or 1024 bytes),
- * %M (for megabytes, or 1048576 bytes), or %G (for gigabytes, or
- * 1073741824). If the number is suffixed with K, M, or G
For modern filesystems such as btrfs, t/p/e size level operations
are common.
add size unit t/p/e parsing to memparse
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog
v1-v2: replace kilobyte with kibibyte, and others
---
lib/cmdline.c | 25 -
1
btrfs resize now support size unit parse of k/m/g/t/p/e in kernel space,
adopt the changes in userspace manpage.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog
v1-v2: replace kilobyte with kibibyte, and others
---
cmds-filesystem.c | 3 ++-
man/btrfs.8.in| 9
For modern filesystems such as btrfs, t/p/e size level operations
are common.
add size unit t/p/e parsing to memparse
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog
v1-v2: replace kilobyte with kibibyte, and others
v2-v3: add missing unit bytes in comment
For btrfs,
Raid5 can't go below 2 devs, not 3;
Raid6 can't go below 3 devs, not 4.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
ioctl.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ioctl.h b/ioctl.h
index c3ee270..6742ba6 100644
--- a/ioctl.h
+++ b/ioctl.h
For system chunk array,
We copy a disk_key and an chunk item each time,
so there should be enough space to hold both of them,
not only the chunk item.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
volumes.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
For RAID0,5,6,10,
For system chunk, there shouldn't be too many stripes to
make a btrfs_chunk that exceeds BTRFS_SYSTEM_CHUNK_ARRAY_SIZE
For data/meta chunk, there shouldn't be too many stripes to
make a btrfs_chunk that exceeds a leaf.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
fs
For RAID0,5,6,10,
For system chunk, there shouldn't be too many stripes to
make a btrfs_chunk that exceeds BTRFS_SYSTEM_CHUNK_ARRAY_SIZE
For data/meta chunk, there shouldn't be too many stripes to
make a btrfs_chunk that exceeds a leaf.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
For system chunk array,
We copy a disk_key and an chunk item each time,
so there should be enough space to hold both of them,
not only the chunk item.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
fs/btrfs/volumes.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
Originally only if 'block_only' is specified, the 'fs_root == NULL'
will be checked. But if 'block_only' is not specified and close_root
will be called blindly without checking 'fs_root == NULL', which is
unsafe.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs-debug-tree.c | 9
Add '-f' option for btrfs-show-super manpage,
This option implies that sys chunk array and backup roots info
will show up.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
Documentation/btrfs-show-super.txt | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git
Add '-h' option for help for super-recover,
update the manpage at the same time.
---
Documentation/btrfs-rescue.txt | 2 ++
cmds-rescue.c | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/btrfs-rescue.txt b/Documentation/btrfs-rescue.txt
index
The btrfs-rescue accepts exactly one arg for both
chunk-recover super-recover, use check_argc_exact clearly.
---
cmds-rescue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmds-rescue.c b/cmds-rescue.c
index 9491d0c..3629141 100644
--- a/cmds-rescue.c
+++
On Wed, 2014-04-02 at 16:54 +0800, Gui Hecheng wrote:
For modern filesystems such as btrfs, t/p/e size level operations
are common.
add size unit t/p/e parsing to memparse
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog
v1-v2: replace kilobyte with kibibyte
On Thu, 2014-05-15 at 18:35 +0200, David Sterba wrote:
On Thu, May 08, 2014 at 11:03:57AM +0800, Gui Hecheng wrote:
Add sys chunk array and backup roots info if the new option '-f'
if specified.
This may be useful for debugging sys_chunk related issues.
Sounds useful. One comment below
Add sys chunk array and backup roots info if the new option '-f'
if specified.
This may be useful for debugging sys_chunk related issues.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
Changelog:
v1-v2: add malloc failure check
---
btrfs-show-super.c | 142
On Fri, 2014-05-16 at 18:41 +0200, David Sterba wrote:
On Fri, May 16, 2014 at 06:37:27PM +0200, David Sterba wrote:
On Thu, May 15, 2014 at 09:29:08AM +0800, Gui Hecheng wrote:
Add '-h' option for help for super-recover,
update the manpage at the same time.
We don't have the short
The btrfstune -S option accepts a positive value to enable seeding,
and a zero to disable seeding, negtive is not allowed.
Add positive, zero, negative sentences to btrfstune manpage.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
Documentation/btrfstune.txt | 5 +++--
btrfstune.c
When count the number of unordered device extents in chunk-recover,
the counter should be reinitialized to be used.
Also, introduce a new function for the counting job.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
chunk-recover.c | 20 ++--
1 file changed, 14
To be accurate about the error case,
if the new size is beyond ULLONG_MAX, return ERANGE instead of EINVAL.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index
On Wed, 2014-05-28 at 18:24 +0200, David Sterba wrote:
On Thu, May 15, 2014 at 09:29:07AM +0800, Gui Hecheng wrote:
Use enum defined error codes to represent different kinds of errs
for super-recover and chunk-recover.
I think this change hides the low-level errors (like ENOMEM) that can
To return EOPNOTSUPP is more user friendly than to return EINVAL,
and then user-space tool will show that the dev_replace operation
for raid56 is not currently supported rather than showing that
there is an invalid argument.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
fs/btrfs/dev
-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
cmds-replace.c | 4
1 file changed, 4 insertions(+)
diff --git a/cmds-replace.c b/cmds-replace.c
index 9eb981b..8b18110 100644
--- a/cmds-replace.c
+++ b/cmds-replace.c
@@ -301,6 +301,10 @@ static int cmd_start_replace(int argc, char **argv
Based on Documentation/filesystems/btrfs.txt
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
sys-utils/mount.8 | 186 ++
1 file changed, 186 insertions(+)
diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index efa1ae8..ec8eab3
On Wed, 2014-04-02 at 16:54 +0800, Gui Hecheng wrote:
For modern filesystems such as btrfs, t/p/e size level operations
are common.
add size unit t/p/e parsing to memparse
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog
v1-v2: replace kilobyte with kibibyte
On Thu, 2014-06-05 at 10:03 +0200, Karel Zak wrote:
On Thu, Jun 05, 2014 at 10:05:19AM +0800, Gui Hecheng wrote:
Based on Documentation/filesystems/btrfs.txt
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
sys-utils/mount.8 | 186
On Fri, 2014-06-06 at 11:44 +0200, Karel Zak wrote:
On Fri, Jun 06, 2014 at 02:32:39PM +0800, Gui Hecheng wrote:
But for now, there are btrfs *users* complaining that they cannot find
any help by refering to the mount manpage when they want to mount their
btrfs. Actually, not every btrfs
On Fri, 2014-06-06 at 12:03 +0200, Karel Zak wrote:
On Fri, Jun 06, 2014 at 11:44:28AM +0200, Karel Zak wrote:
I personally have no problem to maintain information about arbitrary
FS in mount.8, the problem are updates. Unfortunately, kernel FS developers
don't care about the man page at
chunk-recover.c : BTRFS_NUM_MIRRORS 2
just change BTRFS_NUM_MIRRORS to 3, and everything goes well.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
chunk-recover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chunk-recover.c b/chunk-recover.c
index
When deal with the p q stripes for data profile raid6, chunk-recover
forgets to insert them into the chunk record. Just insert them back
freely.
Also wrap the inert procedure into a new function, fill_chunk_up.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
chunk-recover.c | 30
The 'num_unordered' will be recounted after 'goto out',
just remove it.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
chunk-recover.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/chunk-recover.c b/chunk-recover.c
index d5a688e..8bc5bc3 100644
--- a/chunk-recover.c
+++ b/chunk
When deal with the p q stripes for data profile raid6, chunk-recover
forgets to insert them into the chunk record. Just insert them back
freely.
Also wrap the insert procedure into a new function, fill_chunk_up.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog:
v1-v2
On Thu, 2014-06-12 at 14:15 -0700, Andrew Morton wrote:
On Wed, 2 Apr 2014 16:54:37 +0800 Gui Hecheng guihc.f...@cn.fujitsu.com
wrote:
For modern filesystems such as btrfs, t/p/e size level operations
are common.
add size unit t/p/e parsing to memparse
Signed-off-by: Gui Hecheng
On Fri, 2014-06-13 at 07:55 +0200, Brendan Hide wrote:
On 13/06/14 03:42, Gui Hecheng wrote:
For modern filesystems such as btrfs, t/p/e size level operations
are common.
add size unit t/p/e parsing to memparse
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog
On Fri, 2014-06-13 at 14:58 -0700, David Rientjes wrote:
On Fri, 13 Jun 2014, Gui Hecheng wrote:
diff --git a/lib/cmdline.c b/lib/cmdline.c
index d4932f7..76a712e 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -121,11 +121,7 @@ EXPORT_SYMBOL(get_options);
* @retptr: (output
On Mon, 2014-06-16 at 18:29 -0700, David Rientjes wrote:
On Tue, 17 Jun 2014, Gui Hecheng wrote:
diff --git a/lib/cmdline.c b/lib/cmdline.c
index d4932f7..76a712e 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -121,11 +121,7 @@ EXPORT_SYMBOL(get_options
normally,
the free inode generation will be 0.
In this condition, no noise should be outputed.
Also, check 0-sized inode eariler together with 0-generationed inode.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
free-space-cache.c | 10 +++---
1 file changed, 7 insertions(+), 3
The value of variable leaf in while loop don't have to be set
for every round. Just move it outside.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs-image.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/btrfs-image.c b/btrfs-image.c
index cf1fe2d
The btrfs-image support multiple devices with -m specified.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
Documentation/btrfs-image.txt | 3 +++
btrfs-image.c | 1 +
2 files changed, 4 insertions(+)
diff --git a/Documentation/btrfs-image.txt b/Documentation/btrfs
For btrfs-image,
dumpmay not come with option '-o'
-r may not come with option '-c', '-s', '-w', dev_cnt != 1
-m may not come with dev_cnt 2
All of the above should be regarded as invalid combinations,
and the usage will show up.
Signed-off-by: Gui Hecheng
When btrfs-image failed to create an image, the invalid output file
had better be deleted to prevent being used mistakenly in the future.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs-image.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/btrfs
On Mon, 2014-06-23 at 16:15 +0200, David Sterba wrote:
On Thu, Jun 19, 2014 at 09:46:02AM +0800, Gui Hecheng wrote:
When btrfs-image failed to create an image, the invalid output file
had better be deleted to prevent being used mistakenly in the future.
Signed-off-by: Gui Hecheng guihc.f
On Mon, 2014-06-23 at 16:12 +0200, David Sterba wrote:
On Thu, Jun 19, 2014 at 09:46:01AM +0800, Gui Hecheng wrote:
For btrfs-image,
dumpmay not come with option '-o'
-r may not come with option '-c', '-s', '-w', dev_cnt != 1
-m may not come with dev_cnt 2
All
For btrfs-image,
dumpmay not come with option '-o'
-r may not come with option '-c', '-s', '-w', dev_cnt != 1
-m may not come with dev_cnt 2
All of the above should be regarded as invalid combinations,
and the usage will show up.
Signed-off-by: Gui Hecheng
When btrfs-image failed to create an image, the invalid output file
had better be deleted to prevent being used mistakenly in the future.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog
v1-v2: use a new local variable to avoid return value overwritten
---
btrfs-image.c
On Tue, 2014-06-24 at 10:36 +0800, Gui Hecheng wrote:
For btrfs-image,
dumpmay not come with option '-o'
-r may not come with option '-c', '-s', '-w', dev_cnt != 1
-m may not come with dev_cnt 2
All of the above should be regarded as invalid combinations
On Tue, 2014-06-24 at 10:38 +0800, Gui Hecheng wrote:
When btrfs-image failed to create an image, the invalid output file
had better be deleted to prevent being used mistakenly in the future.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog
v1-v2: use a new local
For btrfs-image,
dumpmay not come with option '-o'
-r may not come with option '-c', '-s', '-w', dev_cnt != 1
-m may not come with dev_cnt 2
All of the above should be regarded as invalid combinations,
and the usage will show up.
Signed-off-by: Gui Hecheng
When btrfs-image failed to create an image, the invalid output file
had better be deleted to prevent being used mistakenly in the future.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog
v1-v2: use a new local variable to avoid return value overwritten
v2-v3: fix
On Tue, 2014-06-24 at 15:43 +0200, Karl-Philipp Richter wrote:
Hi together,
I wondered whether
$ sudo btrfs rescue chunk-recover -y /dev/loop2p1
btrfs: chunk-recover.c:124: process_extent_buffer: Assertion
`!(exist-nmirrors = 2)' failed.
$ echo $?
134
Hi, Karl
For the
On Tue, 2014-06-24 at 21:17 -0500, Eric Sandeen wrote:
On 6/11/14, 9:25 PM, Gui Hecheng wrote:
When run chunk-recover on a health btrfs(data profile raid0, with
plenty of data), the program has a chance to abort on the number
of mirrors of an extent.
According to the kernel code
On Wed, 2014-06-25 at 00:25 -0500, Eric Sandeen wrote:
On 6/25/14, 12:14 AM, Eric Sandeen wrote:
On 6/24/14, 9:22 PM, Gui Hecheng wrote:
On Tue, 2014-06-24 at 21:17 -0500, Eric Sandeen wrote:
On 6/11/14, 9:25 PM, Gui Hecheng wrote:
When run chunk-recover on a health btrfs(data profile
/BTRFS_MAX_MIRRORS
This provides convenience for future use.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
chunk-recover.c | 8 +++-
ctree.h | 2 ++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/chunk-recover.c b/chunk-recover.c
index 8bc5bc3..b638ada 100644
The btrfs-image requires at least 2 args to run,
one for the source dev/file, the other for the target dev/file.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs-image.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/btrfs-image.c b/btrfs-image.c
index e0aabfd..b13f236
Steps to reproduce:
# mkfs.btrfs -f dev1
# btrfs-image dev1 image_file
# btrfs-image -r -o image_file dev2
# btrfs check dev2
btrfs check output:
: read block failed check_tree_block
: Couldn't read tree root
: Couldn't open file system
The
Handle the malloc failure for dump_worker in the same way as
the restore worker.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs-image.c | 19 ++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/btrfs-image.c b/btrfs-image.c
index c90bca8..7131001
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs-image.c | 17 +
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/btrfs-image.c b/btrfs-image.c
index b13f236..ed0b6ec 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -1163,7 +1163,7 @@ static int
If the malloc above fails, the btrfs-image will exit directly
without any error messages.
Now just return the ENOMEM errno and let the caller prompt the
error message.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs-image.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion
Don't bother free the buffer if the malloc failed.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs-image.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/btrfs-image.c b/btrfs-image.c
index 7131001..2d482c3 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
On Fri, 2014-06-27 at 14:35 +0200, David Sterba wrote:
On Thu, Jun 26, 2014 at 10:53:05AM +0800, Gui Hecheng wrote:
@@ -2521,6 +2521,9 @@ int main(int argc, char *argv[])
}
argc = argc - optind;
+ if (argc 2)
Please use the check_argc_min helper instead. Thanks.
Yes
The btrfs-image requires at least 2 args to run,
one for the source dev/file, the other for the target dev/file.
This patch depends on patch:
btrfs-progs: move the check_argc_* functions into utils.c
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
changelog
v1-v2: use
.
Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com
---
btrfs.c | 41 +
utils.c | 47 +++
utils.h | 7 +++
3 files changed, 55 insertions(+), 40 deletions(-)
diff --git a/btrfs.c b/btrfs.c
index 25257b6..685455f
On Wed, 2014-07-02 at 01:11 +0200, David Sterba wrote:
On Mon, Jun 30, 2014 at 11:54:11AM +0800, Gui Hecheng wrote:
To let the independent tools(e.g. btrfs-image, btrfs-convert, etc.)
share the convenience of check_argc_* functions, just move it into
utils.c.
Also add a new function
Clear the seeding flag may cause the original filesystem to be writable,
which is dangerous.
In this case, add user confirmation check when clearing seeding flag.
Also warn the user that the fs is in a dangerous condition when
the seeding flag is cleared if it it forced to.
Signed-off-by: Gui
On Thu, 2014-07-03 at 20:10 +0200, David Sterba wrote:
On Thu, Jul 03, 2014 at 10:06:35AM +0800, Gui Hecheng wrote:
After dev replace, we should not select the superblock of the
replaced dev. Otherwise, all the superblokcs will be overwritten
by this invalid superblock.
To prevent
On Thu, 2014-07-03 at 18:58 +0200, David Sterba wrote:
On Thu, Jul 03, 2014 at 10:06:34AM +0800, Gui Hecheng wrote:
The btrfs-image tool should not be run on a mounted filesystem.
Should not, but for some values of sometimes it makes sense, eg.
capturing image of an otherwise quiescent
On Thu, 2014-07-03 at 18:51 +0200, David Sterba wrote:
On Thu, Jul 03, 2014 at 10:06:33AM +0800, Gui Hecheng wrote:
Clear the seeding flag may cause the original filesystem to be writable,
which is dangerous.
Can you please describe the dangerous scenario a bit more? This would
also go
,
the new device will not be mountable. Even set the seeding
flag back will not recovery this problem, because the generation
has been changed. So clear the seeding flag has the chance to
damage the derived new fs.
So I add user confirmation check when clearing seeding flag.
Signed-off-by: Gui Hecheng
The new option -f will force to do dangerous changes.
e.g. clear the seeding flag.
---
changelog
v1-v2: use -f instead of -y
---
Documentation/btrfstune.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/btrfstune.txt b/Documentation/btrfstune.txt
1 - 100 of 238 matches
Mail list logo