[PATCH RESEND] f2fs: optimize f2fs_write_cache_pages

2015-07-16 Thread Tiezhu Yang
appears only once, so it can be optimized to reduce the duplicated code. Signed-off-by: Tiezhu Yang kernelpa...@126.com --- fs/f2fs/data.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index b621c08..0219bd0 100644 --- a/fs/f2fs/data.c +++ b

[PATCH] scsi: ufs: fix potential memory leak

2016-06-07 Thread Tiezhu Yang
There exists potential memory leak in ufshcd_parse_clock_info(), this patch fixes it. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- drivers/scsi/ufs/ufshcd-pltfrm.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/d

Re: [PATCH] scsi: ufs: fix potential memory leak

2016-06-07 Thread Tiezhu Yang
At 2016-06-08 03:12:08, "James Bottomley"  <james.bottom...@hansenpartnership.com> wrote: >On Wed, 2016-06-08 at 02:00 +0800, Tiezhu Yang wrote: >> There exists potential memory leak in ufshcd_parse_clock_info(), >> this patch fixes it. > >What makes you thin

[PATCH v2] scsi: ufs: fix potential memory leak

2016-06-07 Thread Tiezhu Yang
If the function ufshcd_parse_clock_info returns an error, the memory clkfreq allocated by devm_kzalloc will be freed at that time. But when the function ufshcd_parse_clock_info returns 0 on success, there exists potential memory leak, this patch fixes it. Signed-off-by: Tiezhu Yang <kerne

[PATCH] Documentation: fix wrong value in md.txt

2016-06-16 Thread Tiezhu Yang
ing related code: 1) in function 'raid5_set_cache_size': if (size <= 16 || size > 32768) return -EINVAL; 2) #define NR_STRIPES 256 So the lower limit value of stripe_cache_size should be 17 and the default value should be 256. Signed-off-by: Tiezhu Yang <kernelp

[PATCH] f2fs: remove unnecessary goto statement

2016-06-27 Thread Tiezhu Yang
When base_addr is NULL, there is no need to call kzfree, it should return -ENOMEM directly. Additionally, it is better to initialize variable 'error' with 0. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- fs/f2fs/xattr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] scsi: ufs: remove unnecessary goto label

2016-06-24 Thread Tiezhu Yang
When buff_ascii kmalloc failed, there is no need to call kfree, it should return -ENOMEM directly, this patch fixes it. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- drivers/scsi/ufs/ufshcd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufsh

[PATCH] f2fs: make exit_f2fs_fs more clear

2016-05-17 Thread Tiezhu Yang
) register_filesystem 11) f2fs_create_root_stats 12) proc_mkdir exit_f2fs_fs should do cleanup in the reverse order to make the code more clear. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- fs/f2fs/super.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/f

[PATCH] md: make the code more readable in the for-loop

2016-05-08 Thread Tiezhu Yang
This patch modifies raid1.c, raid10.c and raid5.c to make the code more readable in the for-loop and also fixes the scripts/checkpatch.pl error: ERROR: trailing statements should be on next line. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- drivers/md/raid1.c | 6 +++--- driv

Re:Re: [f2fs-dev] [PATCH] f2fs: return proper error code

2016-07-12 Thread Tiezhu Yang
At 2016-07-12 09:45:43, "Chao Yu" <yuch...@huawei.com> wrote: >On 2016/7/11 7:20, Tiezhu Yang wrote: >> When the length of file name is more than F2FS_NAME_LEN, > >Seem @name indicates a xattr/key name, not a file name. Yes, you are right. Sorry for the noise. Thanks,

[PATCH] f2fs: return proper error code

2016-07-10 Thread Tiezhu Yang
When the length of file name is more than F2FS_NAME_LEN, it should return -ENAMETOOLONG. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- fs/f2fs/xattr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 28a5023..b225062

[PATCH] f2fs: fix a typo in f2fs.txt

2017-02-07 Thread Tiezhu Yang
There is a typo "f2f2" in f2fs.txt, this patch fixes it. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- Documentation/filesystems/f2fs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/filesystems/f2fs.txt b/Documentation/filesystem

[PATCH] f2fs: remove dead code f2fs_check_acl

2016-09-13 Thread Tiezhu Yang
The macro f2fs_check_acl is defined but never used since the initial commit, this patch removes the code that has been dead for several years. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- fs/f2fs/acl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/f2fs/acl.h b/fs/f2fs/acl.h

[PATCH v2] f2fs: introduce get_checkpoint_version for cleanup

2016-09-26 Thread Tiezhu Yang
There exists almost same codes when get the value of pre_version and cur_version in function validate_checkpoint, this patch adds get_checkpoint_version to clean up redundant codes. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- fs/f2fs/checkpoint.

Re: [f2fs-dev] [PATCH v2] f2fs: introduce get_checkpoint_version for cleanup

2016-09-27 Thread Tiezhu Yang
Hi Chao, At 2016-09-27 17:46:30, "Chao Yu" <yuch...@huawei.com> wrote: >On 2016/9/27 10:05, Tiezhu Yang wrote: >> There exists almost same codes when get the value of pre_version >> and cur_version in function validate_checkpoint, this patch adds >> get_che

Re: [PATCH] f2fs: introduce get_checkpoint_version for cleanup

2016-09-26 Thread Tiezhu Yang
At 2016-09-27 02:57:16, "Jaegeuk Kim" <jaeg...@kernel.org> wrote: >Hi Tiezhu, > >On Sun, Sep 25, 2016 at 05:50:44PM +0800, Tiezhu Yang wrote: >> There exists almost same codes when get the value of pre_version >> and cur_version in function

[PATCH v3] f2fs: introduce get_checkpoint_version for cleanup

2016-09-27 Thread Tiezhu Yang
There exists almost same codes when get the value of pre_version and cur_version in function validate_checkpoint, this patch adds get_checkpoint_version to clean up redundant codes. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- fs/f2fs/checkpoint.

Re:[PATCH v4] f2fs: introduce get_checkpoint_version for cleanup

2016-09-29 Thread Tiezhu Yang
At 2016-09-30 07:47:58, "Tiezhu Yang" <kernelpa...@126.com> wrote: >There exists almost same codes when get the value of pre_version >and cur_version in function validate_checkpoint, this patch adds >get_checkpoint_version to clean up redundant codes. > >Signed-off-b

[PATCH v4 RESEND] f2fs: introduce get_checkpoint_version for cleanup

2016-09-29 Thread Tiezhu Yang
There exists almost same codes when get the value of pre_version and cur_version in function validate_checkpoint, this patch adds get_checkpoint_version to clean up redundant codes. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- fs/f2fs/checkpoint.

[PATCH v4] f2fs: introduce get_checkpoint_version for cleanup

2016-09-29 Thread Tiezhu Yang
There exists almost same codes when get the value of pre_version and cur_version in function validate_checkpoint, this patch adds get_checkpoint_version to clean up redundant codes. Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- fs/f2fs/checkpoint.

[PATCH] driver core: restrict buffer length in online_store()

2017-07-20 Thread Tiezhu Yang
/devices/system/cpu/cpu1/online bash: echo: write error: Invalid argument Signed-off-by: Tiezhu Yang <kernelpa...@126.com> --- drivers/base/core.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/base/core.c b/drivers/base/core.c index 755451f..6588ed5 100644 --- a/dri