From: Chengguang Xu <cgxu519@mykernel.net>
To: Ritesh Harjani <riteshh@linux.ibm.com>, jack@suse.com
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext2: initialize quota info in ext2_xattr_set()
Date: Sat, 11 Jul 2020 15:27:59 +0800 [thread overview]
Message-ID: <38909abd-c180-8e04-216c-24755d1ca582@mykernel.net> (raw)
In-Reply-To: <20200708105202.7AE73A405F@b06wcsmtp001.portsmouth.uk.ibm.com>
在 7/8/2020 6:52 PM, Ritesh Harjani 写道:
>
>
> 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 <cgxu519@mykernel.net>
>
> LGTM, feel free to add
> Reviewed-by: Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
>
>
>> ---
>> 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. */
>>
prev parent reply other threads:[~2020-07-11 7:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-26 5:49 [PATCH] ext2: initialize quota info in ext2_xattr_set() Chengguang Xu
2020-07-08 10:52 ` Ritesh Harjani
2020-07-08 11:20 ` Jan Kara
2020-07-11 7:27 ` Chengguang Xu [this message]
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=38909abd-c180-8e04-216c-24755d1ca582@mykernel.net \
--to=cgxu519@mykernel.net \
--cc=jack@suse.com \
--cc=linux-ext4@vger.kernel.org \
--cc=riteshh@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).