From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Taesoo Kim <tsgatesv@gmail.com>
Cc: cm224.lee@samsung.com, linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, taesoo@gatech.edu,
changwoo@gatech.edu, sanidhya@gatech.edu, blee@gatech.edu,
csong84@gatech.edu
Subject: Re: [PATCH 1/1] f2fs: correctly check empty xattr key
Date: Fri, 20 Mar 2015 13:52:01 -0700 [thread overview]
Message-ID: <20150320205201.GC19413@jaegeuk-mac02.mot.com> (raw)
In-Reply-To: <1426825147-26981-1-git-send-email-tsgatesv@gmail.com>
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 <tsgatesv@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
next prev parent reply other threads:[~2015-03-20 20:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-20 4:19 Taesoo Kim
2015-03-20 20:52 ` Jaegeuk Kim [this message]
2015-03-23 1:13 ` Taesoo Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150320205201.GC19413@jaegeuk-mac02.mot.com \
--to=jaegeuk@kernel.org \
--cc=blee@gatech.edu \
--cc=changwoo@gatech.edu \
--cc=cm224.lee@samsung.com \
--cc=csong84@gatech.edu \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sanidhya@gatech.edu \
--cc=taesoo@gatech.edu \
--cc=tsgatesv@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®