Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1132540ybt; Sat, 11 Jul 2020 00:33:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSX7rx86CcHTCtl5sGB35aGYsNnI3CJlAgaqGwHMwgYrhiv4ca3yuH/lVE9tQVcWM1bwjr X-Received: by 2002:a17:906:e210:: with SMTP id gf16mr54459181ejb.386.1594452839445; Sat, 11 Jul 2020 00:33:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594452839; cv=pass; d=google.com; s=arc-20160816; b=oWc8uthV6rvjrkNRmgU7mZ6/EuBcciPADBtSK3UD2sDclYShAdwKX8niM8bWQ0oSLA hOFogkaZMJ39gsRyNK6aYQpuyxv3CcTF1G6zQxh04O2HOAqjTksUbmFNlwj8LP+bP6Ej weASTH3s6vP63VMd2Rx1R2XmKbYvaFEDzoI0q7hKi0ZkxU+f9vUZEH7mZgg5pqZTUjRF U/KpbscOvRgD4XDGHYDlY6cig2c7Slv/TxUsWkenoJDe/soiiPfg0IPdNyldl6cQxMUO l6NhZ5aY2nEQ6F0J6cV5OoZu5EDy34q8L8dhRiSg0Ca8aTT4XK79b5UUk8d/NRXX+7rZ +PnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject:dkim-signature; bh=LlxI+xhhbaNqR3A672B1fiq0MKfW9jkWMb2zP3rGVK0=; b=0/zDpf+H9atHr6JQgP+PFHx3/LqyavQtGGfUFaIFOq6cxTByi7xgji7DfT6hyOIfCA xUDP3NHUDuKN+iPzo9J4KOqBvOda9L08WhWiLfxJ3DoH8rrZktGNtxbbkjMHQ1rNfoIG iLtckNw3LoQ0CaeumRCIi4HUctowNaovZVNxwUthdy0++TecRJfEtZa28fwfNGLsrJdR gXSwCDRWaXk67RPLY+kBfYCiM5HKZSS7/RiCrZyOsOxPaz1jGm5yefQcryPtmf61dKyl IfMsk3C0g2Zhpmn/HNZ0Woyq/a1UYQrsENP9547/EvB8Mtj/eMom05WxqJLyjiGsyUbH 3Lhw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=UKm5W7Vr; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si5113252ejy.311.2020.07.11.00.33.24; Sat, 11 Jul 2020 00:33:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=UKm5W7Vr; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727944AbgGKH2Z (ORCPT + 99 others); Sat, 11 Jul 2020 03:28:25 -0400 Received: from sender2-op-o12.zoho.com.cn ([163.53.93.243]:17107 "EHLO sender2-op-o12.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726958AbgGKH2Y (ORCPT ); Sat, 11 Jul 2020 03:28:24 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1594452487; cv=none; d=zoho.com.cn; s=zohoarc; b=WKWE3bVeXz5BUZpTqZpuy0JcdOxKuW14NTl/NoW7Ec9sZYAihZmwAoTE/PIEFexsXNwe8KAATX/3JcILqi9rxQ1ZnV7eC4+HxhVauYugd+HmBDDLT0SSYdoHVhCKVi34yugL5xJo2g2d9/Zi+dt54b6ujCYZZld+oXg8rd0yPSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1594452487; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=LlxI+xhhbaNqR3A672B1fiq0MKfW9jkWMb2zP3rGVK0=; b=K94aft54caCskHniBSpp6phkuWnxrdpCisy9iJkxgalqlcl9PEiJDPIeToDEvpNX6AigyLcgb3R6qHtw3yIZAFVZNyh9X1jq+GI0zFdzYAZo3UumndAqoYSQZV2jG35Th9jCMW/ZINyEPyfRRtGLT9mnEuMjf8C2UePrZ/wtXO8= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1594452487; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=LlxI+xhhbaNqR3A672B1fiq0MKfW9jkWMb2zP3rGVK0=; b=UKm5W7Vrv/gwXyVd6LkGxQOQHfg8LK0yo7rGQ1vWAoVbVPiNo0bugqjktaihjnu3 m3Jfo247fd1z4pWoNsIIX9zQKUKFeP0pAofLDjSrMVqKeorU544p10KGBOUGjPaY5ed JXJFxbUr1hNTZ98bt7GZIpsZtrhVxlO1Zw6E83hs= Received: from [10.0.0.5] (113.87.90.223 [113.87.90.223]) by mx.zoho.com.cn with SMTPS id 1594452485309823.4562675062915; Sat, 11 Jul 2020 15:28:05 +0800 (CST) Subject: Re: [PATCH] ext2: initialize quota info in ext2_xattr_set() To: Ritesh Harjani , jack@suse.com Cc: linux-ext4@vger.kernel.org References: <20200626054959.114177-1-cgxu519@mykernel.net> <20200708105202.7AE73A405F@b06wcsmtp001.portsmouth.uk.ibm.com> From: Chengguang Xu Message-ID: <38909abd-c180-8e04-216c-24755d1ca582@mykernel.net> Date: Sat, 11 Jul 2020 15:27:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200708105202.7AE73A405F@b06wcsmtp001.portsmouth.uk.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org =E5=9C=A8 7/8/2020 6:52 PM, Ritesh Harjani =E5=86=99=E9=81=93: > > > On 6/26/20 11:19 AM, Chengguang Xu wrote: >> In order to correctly account/limit space usage, should initialize >> quota info before calling quota related functions. > > How did you encounter the problem? > Any test case got hit? I found the issue by code inspecting when I was learning mbcache logic. Thanks, cgxu > >> >> Signed-off-by: Chengguang Xu > > LGTM, feel free to add > Reviewed-by: Reviewed-by: Ritesh Harjani > > >> --- >> =C2=A0 fs/ext2/xattr.c | 3 +++ >> =C2=A0 1 file changed, 3 insertions(+) >> >> diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c >> index 943cc469f42f..913e5c4921ec 100644 >> --- a/fs/ext2/xattr.c >> +++ b/fs/ext2/xattr.c >> @@ -437,6 +437,9 @@ ext2_xattr_set(struct inode *inode, int=20 >> name_index, const char *name, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 name_len =3D strlen(name); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (name_len > 255 || value_len > sb->s_b= locksize) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -ERANGE; >> +=C2=A0=C2=A0=C2=A0 error =3D dquot_initialize(inode); >> +=C2=A0=C2=A0=C2=A0 if (error) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return error; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 down_write(&EXT2_I(inode)->xattr_sem); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (EXT2_I(inode)->i_file_acl) { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* The inode alre= ady has an extended attribute block. */ >>