Hi, Jaegeuk

At 2017-07-01 15:39:32, "Jaegeuk Kim" <[email protected]> wrote:
>On 07/01, Tiezhu Yang wrote:
>> It should call the function fscrypt_fname_free_buffer() in the exception
>> handling only after the function fscrypt_fname_alloc_buffer() returns 0,
>> otherwise it is unnecessary.
>
>Hi, fscrypt_fname_free_buffer returns if crypto_str is null. So, this flow
>has no problem, which would be a quite conventional flow, no?

Understood, just two points of view, both are OK.
In my opinion, I would prefer not to call the function 
fscrypt_fname_free_buffer since I am
absolutely sure that its argument is NULL and it will return directly without 
doing anything,
this patch is to avoid unnecessary function call.

Thanks,

>
>Thanks,
>
>> Signed-off-by: Tiezhu Yang <[email protected]>
>> ---
>>  fs/f2fs/namei.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>> 
>> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
>> index c31b40e..3225a82 100644
>> --- a/fs/f2fs/namei.c
>> +++ b/fs/f2fs/namei.c
>> @@ -1036,12 +1036,12 @@ static const char *f2fs_encrypted_get_link(struct 
>> dentry *dentry,
>>  
>>      res = fscrypt_fname_disk_to_usr(inode, 0, 0, &cstr, &pstr);
>>      if (res)
>> -            goto errout;
>> +            goto out;
>>  
>>      /* this is broken symlink case */
>>      if (unlikely(pstr.name[0] == 0)) {
>>              res = -ENOENT;
>> -            goto errout;
>> +            goto out;
>>      }
>>  
>>      paddr = pstr.name;
>> @@ -1052,8 +1052,9 @@ static const char *f2fs_encrypted_get_link(struct 
>> dentry *dentry,
>>      put_page(cpage);
>>      set_delayed_call(done, kfree_link, paddr);
>>      return paddr;
>> -errout:
>> +out:
>>      fscrypt_fname_free_buffer(&pstr);
>> +errout:
>>      put_page(cpage);
>>      return ERR_PTR(res);
>>  }
>> -- 
>> 1.8.3.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to