Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp445130ybt; Wed, 8 Jul 2020 03:53:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTf9seYZTJ2PCsbFG85JEvhjMQusJmYD6QEtHOOgJnO0F0MBHwxPpAplLYHtFZOZHcay5g X-Received: by 2002:a17:906:c259:: with SMTP id bl25mr50952594ejb.303.1594205591098; Wed, 08 Jul 2020 03:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594205591; cv=none; d=google.com; s=arc-20160816; b=W7h9GtLJ86IZCVPX1yMnhxSE27qnyStFGPKlBLnsZTunQKh8TN041GRynoeb8lf3hT dUbxpxXT5hHnIX3WIEguhwkt0k0x3y8vLfeshwty4DDA7AdDUKpyjBPAiMTHRC7jK2Xh M30STDSi3t3CWrJY0rd9rZaufTQqtvWvqXotAfrG4QAumAYRbfG1aGSIT7yPwRToiBOL bjL0FEFjDSax7QhJa7EprPo78EzmSnSwhfdWIuNqVGEXbm4j//ZyW1e2L4gkQKT+UmBm tmGi2KoSh5EFP54G6umJrgr+DcanIEK6gsmIHco3dSd+nMmtarMDt1ecUYOL+lc0AB9R ZNdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=Iw+JnzmWwTs8ErpklzB972ReR5fH5usUUuXJwYKX0lQ=; b=UWNQMPhzY34XrT4m6uqVSTZIJxcVSNujXv5SkigkDK+5qtrvhmGhlMC9/6q048+lqg YSQf9Y4yYCB5Tpf8VlhgSImnMZQvbVr6Jkh7wjC4/lIng+2q5Dr0zUXLBSAyJW0XkcZv Z7JR0GoTe5vMjyuh3fYOBWeEgijzSPTsU2gVz0ULcaNXVZRMcj0S9fcLJMzdhe50mtos qmjojEdUeL8eDqkyj/SF352+AZxkrbt/bCi78gBaLZix1aBrgCoW86nqZIsjc+IX5dDu R2IWbeBUZMUgnYLOUHjBOwZ1kL73PwK6qpy0y2AVAx60lkpC9qWoz0jm3jxEag4SRWXf f2uQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y26si17403444edi.339.2020.07.08.03.52.32; Wed, 08 Jul 2020 03:53:11 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726586AbgGHKwV (ORCPT + 99 others); Wed, 8 Jul 2020 06:52:21 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44118 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgGHKwV (ORCPT ); Wed, 8 Jul 2020 06:52:21 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 068AXJvs051752; Wed, 8 Jul 2020 06:52:07 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 325c6qry9x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 06:52:07 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 068Akaq4023603; Wed, 8 Jul 2020 10:52:05 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma03ams.nl.ibm.com with ESMTP id 322hd7vfft-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jul 2020 10:52:05 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 068Aq3WD63111416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Jul 2020 10:52:03 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26953A405C; Wed, 8 Jul 2020 10:52:03 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AE73A405F; Wed, 8 Jul 2020 10:52:02 +0000 (GMT) Received: from localhost.localdomain (unknown [9.79.222.188]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 8 Jul 2020 10:52:02 +0000 (GMT) Subject: Re: [PATCH] ext2: initialize quota info in ext2_xattr_set() To: Chengguang Xu , jack@suse.com Cc: linux-ext4@vger.kernel.org References: <20200626054959.114177-1-cgxu519@mykernel.net> From: Ritesh Harjani Date: Wed, 8 Jul 2020 16:22:01 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200626054959.114177-1-cgxu519@mykernel.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Message-Id: <20200708105202.7AE73A405F@b06wcsmtp001.portsmouth.uk.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-08_07:2020-07-08,2020-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 suspectscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 cotscore=-2147483648 lowpriorityscore=0 phishscore=0 spamscore=0 adultscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007080073 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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? > > Signed-off-by: Chengguang Xu LGTM, feel free to add Reviewed-by: Reviewed-by: Ritesh Harjani > --- > fs/ext2/xattr.c | 3 +++ > 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 name_index, const char *name, > name_len = strlen(name); > if (name_len > 255 || value_len > sb->s_blocksize) > return -ERANGE; > + error = dquot_initialize(inode); > + if (error) > + return error; > down_write(&EXT2_I(inode)->xattr_sem); > if (EXT2_I(inode)->i_file_acl) { > /* The inode already has an extended attribute block. */ >