Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp466624ybt; Wed, 8 Jul 2020 04:21:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi9Nm4Ro9J2IqreoSjGYT2JX2AK1Dq8Hrm4J8LKp+9GblKdVX67n2CCVqQWMqoIMqmK/hI X-Received: by 2002:a17:906:ca0e:: with SMTP id jt14mr50238743ejb.325.1594207296109; Wed, 08 Jul 2020 04:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594207296; cv=none; d=google.com; s=arc-20160816; b=swRLJhuPL5VMfANnwIuzNwH35YkOZdOB7RaysEcfii8gcAZGda6S5SI1XF0w/hBEvR jpO7VzLNIVlkOGrW5tjEHHwXCTVAZTelY/oI3HvIGrkyPry7sfPLsDep8Win1PTR5sHA uMt8b0cUCuH+9G5dQcG0HGxQ+wo7+cCczygspfXWEumMLd9ZvjUL12JTzwOTwDfYz0Yy vD0bvWQiSDGTkb+KGedBqYdHNIGb4JY1B3+nVQteEmr4lbFSxWwlRfyK9/PeVtMJYeJF kvgQzF7i1gnG572OPjNqkkLRJ8rHoYkkRHCib3Eb7A0B2a4DsDO+74fYE5h7z1lENWIQ bp8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+Jad/oLl4iQSMjKwqqPy/xOSrWkXYoEY582kJvkl078=; b=dyxUgPOgM+b0kk+Xaa0qzHF4qozrR48nJYiC/rybnxaByEShgaQsOku5iWJ76yIVl1 bTazrZdJMvNGOHxjHoMqKtay87I8DPtRgOofhUZqI2DP4nULSL/4W8mOcdT6fGFWU6uD Tu/cbSn/0ARq7Mv/J6YFEb+vgsaHB0EH0aas1FjJCG1RKOYMpz9G37DEt2tNTBUIMGn+ 5TZAdj+r2aVMs9zEy8ylsutVTt4HDPXSOOEfxOj+H24AWOFdOHQ8S5SzkBHQI9jTjwp3 BHfAOC0yWovHXhkljYu7Pys0fCnQdzxbpC4ZAXlxQSCNOYCqfRKnFgySpRofCHbu2vih 9Ing== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c25si16331136ejd.178.2020.07.08.04.21.12; Wed, 08 Jul 2020 04:21:36 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728633AbgGHLUw (ORCPT + 99 others); Wed, 8 Jul 2020 07:20:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:42982 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728385AbgGHLUw (ORCPT ); Wed, 8 Jul 2020 07:20:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D3B00AD4B; Wed, 8 Jul 2020 11:20:51 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 0E8781E12BF; Wed, 8 Jul 2020 13:20:51 +0200 (CEST) Date: Wed, 8 Jul 2020 13:20:51 +0200 From: Jan Kara To: Ritesh Harjani Cc: Chengguang Xu , jack@suse.com, linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext2: initialize quota info in ext2_xattr_set() Message-ID: <20200708112051.GE25069@quack2.suse.cz> References: <20200626054959.114177-1-cgxu519@mykernel.net> <20200708105202.7AE73A405F@b06wcsmtp001.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200708105202.7AE73A405F@b06wcsmtp001.portsmouth.uk.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed 08-07-20 16:22:01, Ritesh Harjani wrote: > > > 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 Thanks. I've added the patch to my tree. Honza > > > > --- > > 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. */ > > > -- Jan Kara SUSE Labs, CR