aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@mykernel.net>2019-10-18 23:19:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-10-19 06:32:32 -0400
commitce750f43f5790de74c1644c39d78f684071658d1 (patch)
tree0b8994474fa6838a18f11fe8cb19d611db17cad4 /fs/ocfs2/file.c
parentb749ecfaf6c53ce79d6ab66afd2fc34189a073b1 (diff)
ocfs2: fix error handling in ocfs2_setattr()
Should set transfer_to[USRQUOTA/GRPQUOTA] to NULL on error case before jumping to do dqput(). Link: http://lkml.kernel.org/r/20191010082349.1134-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> Cc: Mark Fasheh <mark@fasheh.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Changwei Ge <gechangwei@live.cn> Cc: Gang He <ghe@suse.com> Cc: Jun Piao <piaojun@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r--fs/ocfs2/file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 2e982db3e1ae..53939bf9d7d2 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1230,6 +1230,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
1230 transfer_to[USRQUOTA] = dqget(sb, make_kqid_uid(attr->ia_uid)); 1230 transfer_to[USRQUOTA] = dqget(sb, make_kqid_uid(attr->ia_uid));
1231 if (IS_ERR(transfer_to[USRQUOTA])) { 1231 if (IS_ERR(transfer_to[USRQUOTA])) {
1232 status = PTR_ERR(transfer_to[USRQUOTA]); 1232 status = PTR_ERR(transfer_to[USRQUOTA]);
1233 transfer_to[USRQUOTA] = NULL;
1233 goto bail_unlock; 1234 goto bail_unlock;
1234 } 1235 }
1235 } 1236 }
@@ -1239,6 +1240,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
1239 transfer_to[GRPQUOTA] = dqget(sb, make_kqid_gid(attr->ia_gid)); 1240 transfer_to[GRPQUOTA] = dqget(sb, make_kqid_gid(attr->ia_gid));
1240 if (IS_ERR(transfer_to[GRPQUOTA])) { 1241 if (IS_ERR(transfer_to[GRPQUOTA])) {
1241 status = PTR_ERR(transfer_to[GRPQUOTA]); 1242 status = PTR_ERR(transfer_to[GRPQUOTA]);
1243 transfer_to[GRPQUOTA] = NULL;
1242 goto bail_unlock; 1244 goto bail_unlock;
1243 } 1245 }
1244 } 1246 }