From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Yu Subject: Re: [PATCH v2] f2fs: correct removexattr behavior for null valued extended attribute Date: Sat, 20 Jan 2018 15:50:28 +0800 Message-ID: <446b267f-7017-7df8-93d9-c0ead3f5ab0b@kernel.org> References: <1515551087-24651-1-git-send-email-daeho.jeong@samsung.com> <6b2070c9-8c4b-ac8c-9346-e21bc99e7dc7@huawei.com> <20180120042417.GA20450@jaegeuk-macbookpro.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1ecnvF-0007dB-Ij for linux-f2fs-devel@lists.sourceforge.net; Sat, 20 Jan 2018 07:50:41 +0000 Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) id 1ecnvE-0007Hv-Lm for linux-f2fs-devel@lists.sourceforge.net; Sat, 20 Jan 2018 07:50:41 +0000 In-Reply-To: <20180120042417.GA20450@jaegeuk-macbookpro.roam.corp.google.com> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Jaegeuk Kim , Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net On 2018/1/20 12:24, Jaegeuk Kim wrote: > On 01/17, Chao Yu wrote: >> Hi Jaegeuk, >> >> Forgot to merge this patch? ;) > > Weird. I didn't get this patch before. I'm sure it has been sent to f2fs mailing list, may be it's been junked? Anyway, I just resent it for Daeho Jeong, please check it. > Is this a full patch? > >> >> On 2018/1/10 10:24, Daeho Jeong wrote: >>> __vfs_removexattr() transfers "NULL" value to the setxattr handler of >>> the f2fs filesystem in order to remove the extended attribute. But, >>> __f2fs_setxattr() just ignores the removal request when the value of >>> the extended attribute is already NULL. We have to remove the extended >>> attribute itself even if the value of that is already NULL. >>> >>> We can reporduce this bug with the below: >>> >>> 1. touch file >>> 2. setfattr -n "user.foo" file >>> 3. setfattr -x "user.foo" file >>> 4. getfattr -d file >>>> user.foo >>> >>> Signed-off-by: Daeho Jeong >>> Signed-off-by: Youngjin Gil >>> Tested-by: Hobin Woo >>> Tested-by: Chao Yu >>> Reviewed-by: Chao Yu >>> --- >>> fs/f2fs/xattr.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c >>> index ec8961e..2776618 100644 >>> --- a/fs/f2fs/xattr.c >>> +++ b/fs/f2fs/xattr.c >>> @@ -598,7 +598,7 @@ static int __f2fs_setxattr(struct inode *inode, int index, >>> goto exit; >>> } >>> >>> - if (f2fs_xattr_value_same(here, value, size)) >>> + if (value && f2fs_xattr_value_same(here, value, size)) >>> goto exit; >>> } else if ((flags & XATTR_REPLACE)) { >>> error = -ENODATA; >>> > > ------------------------------------------------------------------------------ > 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 > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot