[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200626054959.114177-1-cgxu519@mykernel.net>
Date: Fri, 26 Jun 2020 13:49:59 +0800
From: Chengguang Xu <cgxu519@...ernel.net>
To: jack@...e.com
Cc: linux-ext4@...r.kernel.org, Chengguang Xu <cgxu519@...ernel.net>
Subject: [PATCH] ext2: initialize quota info in ext2_xattr_set()
In order to correctly account/limit space usage, should initialize
quota info before calling quota related functions.
Signed-off-by: Chengguang Xu <cgxu519@...ernel.net>
---
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. */
--
2.26.2
Powered by blists - more mailing lists