* (RESEND) [PATCH] ocfs2: Fix error handling in ocfs2_setattr()
@ 2019-10-10 8:23 Chengguang Xu
2019-10-10 8:49 ` Joseph Qi
0 siblings, 1 reply; 3+ messages in thread
From: Chengguang Xu @ 2019-10-10 8:23 UTC (permalink / raw)
To: ocfs2-devel, linux-kernel; +Cc: akpm, mark, jlbec, joseph.qi, Chengguang Xu
Should set transfer_to[USRQUOTA/GRPQUOTA] to NULL
on error case before jump to do dqput().
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
---
fs/ocfs2/file.c | 2 ++
1 file changed, 2 insertions(+)
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)
transfer_to[USRQUOTA] = dqget(sb, make_kqid_uid(attr->ia_uid));
if (IS_ERR(transfer_to[USRQUOTA])) {
status = PTR_ERR(transfer_to[USRQUOTA]);
+ transfer_to[USRQUOTA] = NULL;
goto bail_unlock;
}
}
@@ -1239,6 +1240,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
transfer_to[GRPQUOTA] = dqget(sb, make_kqid_gid(attr->ia_gid));
if (IS_ERR(transfer_to[GRPQUOTA])) {
status = PTR_ERR(transfer_to[GRPQUOTA]);
+ transfer_to[GRPQUOTA] = NULL;
goto bail_unlock;
}
}
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: (RESEND) [PATCH] ocfs2: Fix error handling in ocfs2_setattr()
2019-10-10 8:23 (RESEND) [PATCH] ocfs2: Fix error handling in ocfs2_setattr() Chengguang Xu
@ 2019-10-10 8:49 ` Joseph Qi
2019-10-10 10:05 ` [Ocfs2-devel] " Changwei Ge
0 siblings, 1 reply; 3+ messages in thread
From: Joseph Qi @ 2019-10-10 8:49 UTC (permalink / raw)
To: Chengguang Xu, ocfs2-devel, linux-kernel; +Cc: akpm, mark, jlbec, joseph.qi
On 19/10/10 16:23, Chengguang Xu wrote:
> Should set transfer_to[USRQUOTA/GRPQUOTA] to NULL
> on error case before jump to do dqput().
>
> Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
Looks good.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
> fs/ocfs2/file.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> 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)
> transfer_to[USRQUOTA] = dqget(sb, make_kqid_uid(attr->ia_uid));
> if (IS_ERR(transfer_to[USRQUOTA])) {
> status = PTR_ERR(transfer_to[USRQUOTA]);
> + transfer_to[USRQUOTA] = NULL;
> goto bail_unlock;
> }
> }
> @@ -1239,6 +1240,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
> transfer_to[GRPQUOTA] = dqget(sb, make_kqid_gid(attr->ia_gid));
> if (IS_ERR(transfer_to[GRPQUOTA])) {
> status = PTR_ERR(transfer_to[GRPQUOTA]);
> + transfer_to[GRPQUOTA] = NULL;
> goto bail_unlock;
> }
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Ocfs2-devel] (RESEND) [PATCH] ocfs2: Fix error handling in ocfs2_setattr()
2019-10-10 8:49 ` Joseph Qi
@ 2019-10-10 10:05 ` Changwei Ge
0 siblings, 0 replies; 3+ messages in thread
From: Changwei Ge @ 2019-10-10 10:05 UTC (permalink / raw)
To: Joseph Qi, Chengguang Xu, ocfs2-devel, linux-kernel
On 2019/10/10 4:49 下午, Joseph Qi wrote:
>
> On 19/10/10 16:23, Chengguang Xu wrote:
>> Should set transfer_to[USRQUOTA/GRPQUOTA] to NULL
>> on error case before jump to do dqput().
>>
>> Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
> Looks good.
>
> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Also looks sane to me
Reviewed-by: Changwei Ge <chge@linux.alibaba.com>
>> ---
>> fs/ocfs2/file.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> 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)
>> transfer_to[USRQUOTA] = dqget(sb, make_kqid_uid(attr->ia_uid));
>> if (IS_ERR(transfer_to[USRQUOTA])) {
>> status = PTR_ERR(transfer_to[USRQUOTA]);
>> + transfer_to[USRQUOTA] = NULL;
>> goto bail_unlock;
>> }
>> }
>> @@ -1239,6 +1240,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
>> transfer_to[GRPQUOTA] = dqget(sb, make_kqid_gid(attr->ia_gid));
>> if (IS_ERR(transfer_to[GRPQUOTA])) {
>> status = PTR_ERR(transfer_to[GRPQUOTA]);
>> + transfer_to[GRPQUOTA] = NULL;
>> goto bail_unlock;
>> }
>> }
>>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel@oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-10 10:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 8:23 (RESEND) [PATCH] ocfs2: Fix error handling in ocfs2_setattr() Chengguang Xu
2019-10-10 8:49 ` Joseph Qi
2019-10-10 10:05 ` [Ocfs2-devel] " Changwei Ge
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).