Hi Taesoo,

On Fri, Mar 20, 2015 at 12:19:07AM -0400, Taesoo Kim wrote:
> When xattr name (key) is empty (""), correctly return -EINVAL
> error. xattr_advise_set/get() seem to make the same mistake.

The intention here is to disallow any xattr name, since this is used to get or
set the i_advise value by users.

Thanks,

> 
> Signed-off-by: Taesoo Kim <tsgat...@gmail.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 5072bf9..6b1fbc4 100644
> --- a/fs/f2fs/xattr.c
> +++ b/fs/f2fs/xattr.c
> @@ -132,7 +132,7 @@ static int f2fs_xattr_advise_get(struct dentry *dentry, 
> const char *name,
>  {
>       struct inode *inode = dentry->d_inode;
>  
> -     if (strcmp(name, "") != 0)
> +     if (strcmp(name, "") == 0)
>               return -EINVAL;
>  
>       *((char *)buffer) = F2FS_I(inode)->i_advise;
> @@ -144,7 +144,7 @@ static int f2fs_xattr_advise_set(struct dentry *dentry, 
> const char *name,
>  {
>       struct inode *inode = dentry->d_inode;
>  
> -     if (strcmp(name, "") != 0)
> +     if (strcmp(name, "") == 0)
>               return -EINVAL;
>       if (!inode_owner_or_capable(inode))
>               return -EPERM;
> -- 
> 2.3.3

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to