[PATCH] bug fix in function check_should_bypass

2018-09-27 Thread Dongbo Cao
ed-off-by: Dongbo Cao --- drivers/md/bcache/request.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 13d3355a..fb3502da 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -398,8 +398,7 @@ stati

[PATCH] bug fix in function check_should_bypass

2018-09-27 Thread Dongbo Cao
ed-off-by: Dongbo Cao --- drivers/md/bcache/request.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 13d3355a..fb3502da 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -398,8 +398,7 @@ stati

[PATCH] use STORE_LOCKED instead of STORE macro

2018-09-26 Thread Dongbo Cao
merge sysfs_writeback_running attr and sysfs_writeback_percent attr together with other attrs of cached_dev. Signed-off-by: Dongbo Cao --- drivers/md/bcache/sysfs.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md

[PATCH] use STORE_LOCKED instead of STORE macro

2018-09-26 Thread Dongbo Cao
merge sysfs_writeback_running attr and sysfs_writeback_percent attr together with other attrs of cached_dev. Signed-off-by: Dongbo Cao --- drivers/md/bcache/sysfs.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md

[PATCH] split if-condition code in bch_cache_set_alloc

2018-09-26 Thread Dongbo Cao
rebase my local code and commit it again. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 114 +++--- 1 file changed, 93 insertions(+), 21 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index a2cc354c..03099c4c 100644

[PATCH] split if-condition code in bch_cache_set_alloc

2018-09-26 Thread Dongbo Cao
rebase my local code and commit it again. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 114 +++--- 1 file changed, 93 insertions(+), 21 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index a2cc354c..03099c4c 100644

[PATCH 3/3] split original if condition code in function bch_cache_set_alloc

2018-09-25 Thread Dongbo Cao
remove bch_cache_set_unregister because we have not registerd right now Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 102 ++ 1 file changed, 82 insertions(+), 20 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c

[PATCH 3/3] split original if condition code in function bch_cache_set_alloc

2018-09-25 Thread Dongbo Cao
remove bch_cache_set_unregister because we have not registerd right now Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 102 ++ 1 file changed, 82 insertions(+), 20 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c

[PATCH 2/2] panic fix for making cache device

2018-09-25 Thread Dongbo Cao
when the nbuckets of cache device is smaller than 1024, making cache device will trigger BUG_ON in kernel, add a condition to avoid this. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/md/bcache

[PATCH 2/2] panic fix for making cache device

2018-09-25 Thread Dongbo Cao
when the nbuckets of cache device is smaller than 1024, making cache device will trigger BUG_ON in kernel, add a condition to avoid this. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/md/bcache

[PATCH 1/2] split original if-condition code into separate ones

2018-09-25 Thread Dongbo Cao
to make it clearly to debug. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 81 +++ 1 file changed, 66 insertions(+), 15 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index fa4058e4..0c0f6d8f 100644 --- a/drivers

[PATCH 1/2] split original if-condition code into separate ones

2018-09-25 Thread Dongbo Cao
to make it clearly to debug. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 81 +++ 1 file changed, 66 insertions(+), 15 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index fa4058e4..0c0f6d8f 100644 --- a/drivers

[PATCH] bug fix for making cache device failed

2018-09-21 Thread Dongbo Cao
1)when the nbuckets of cache device is smaller than 1024, make cache device will trigger BUG_ON in kernel, add a condition to avoid this. 2)split original if condition code into separate ones to make it clearly to debug. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 87

[PATCH] bug fix for making cache device failed

2018-09-21 Thread Dongbo Cao
1)when the nbuckets of cache device is smaller than 1024, make cache device will trigger BUG_ON in kernel, add a condition to avoid this. 2)split original if condition code into separate ones to make it clearly to debug. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 87

[PATCH 2/2] add some safety checks for label store interface of flash dev in sysfs

2018-09-14 Thread Dongbo Cao
do some checks on the label's length and ending. Signed-off-by: Dongbo Cao --- drivers/md/bcache/sysfs.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index e64c718f..cce793ef 100644 --- a/drivers/md/bcache

[PATCH 2/2] add some safety checks for label store interface of flash dev in sysfs

2018-09-14 Thread Dongbo Cao
do some checks on the label's length and ending. Signed-off-by: Dongbo Cao --- drivers/md/bcache/sysfs.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index e64c718f..cce793ef 100644 --- a/drivers/md/bcache

[PATCH] add label interface for cache device in sysfs

2018-09-14 Thread Dongbo Cao
label interface will be called by bcache tools in user space. Signed-off-by: Dongbo Cao --- drivers/md/bcache/sysfs.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index 225b15aa..e64c718f 100644 --- a/drivers/md

[PATCH] add label interface for cache device in sysfs

2018-09-14 Thread Dongbo Cao
label interface will be called by bcache tools in user space. Signed-off-by: Dongbo Cao --- drivers/md/bcache/sysfs.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index 225b15aa..e64c718f 100644 --- a/drivers/md

[PATCH 3/3] fix some potential memory leak in bcache_device_init

2018-08-15 Thread Dongbo Cao
add some goto label to release memory in case we got wrong return value. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 14c31e03

[PATCH 3/3] fix some potential memory leak in bcache_device_init

2018-08-15 Thread Dongbo Cao
add some goto label to release memory in case we got wrong return value. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 14c31e03

[PATCH 2/2] fix potential memory leak in function "register_bcache"

2018-08-15 Thread Dongbo Cao
if register_cache get error, memory pointed by ca should be released. and also, blkdev_put should be called I think. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache

[PATCH 2/2] fix potential memory leak in function "register_bcache"

2018-08-15 Thread Dongbo Cao
if register_cache get error, memory pointed by ca should be released. and also, blkdev_put should be called I think. Signed-off-by: Dongbo Cao --- drivers/md/bcache/super.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache

[PATCH 2/2] bcache: add undef for macro in function

2018-08-14 Thread Dongbo Cao
add undef for macro d_strtoul,d_strtoul_nonzero and d_strtoi_h Signed-off-by: Dongbo Cao --- drivers/md/bcache/sysfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index 225b15aa..ed67a290 100644 --- a/drivers/md/bcache/sysfs.c

[PATCH 2/2] bcache: add undef for macro in function

2018-08-14 Thread Dongbo Cao
add undef for macro d_strtoul,d_strtoul_nonzero and d_strtoi_h Signed-off-by: Dongbo Cao --- drivers/md/bcache/sysfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index 225b15aa..ed67a290 100644 --- a/drivers/md/bcache/sysfs.c