[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <babe7ec5-a7a0-f013-8137-2b541f311594@linux.alibaba.com>
Date: Wed, 15 Sep 2021 10:36:27 +0800
From: Joseph Qi <joseph.qi@...ux.alibaba.com>
To: Chenyuan Mi <cymi20@...an.edu.cn>, akpm <akpm@...ux-foundation.org>
Cc: Xin Tan <tanxin.ctf@...il.com>,
Xiyu Yang <xiyuyang19@...an.edu.cn>, yuanxzhang@...an.edu.cn,
linux-kernel@...r.kernel.org, ocfs2-devel@....oracle.com,
Wengang Wang <wen.gang.wang@...cle.com>
Subject: Re: [Ocfs2-devel] [PATCH v2] ocfs2: Fix handle refcount leak in two
exception handling paths
Hi Andrew,
Now there is no objection on this patch.
Would you please pick it into your -mm tree? Thanks.
Joseph
On 9/8/21 6:51 PM, Joseph Qi wrote:
>
>
> On 9/8/21 6:20 PM, Chenyuan Mi wrote:
>> The reference counting issue happens in two exception handling paths
>> of ocfs2_replay_truncate_records(). When executing these two exception
>> handling paths, the function forgets to decrease the refcount of handle
>> increased by ocfs2_start_trans(), causing a refcount leak.
>>
>> Fix this issue by using ocfs2_commit_trans() to decrease the refcount
>> of handle in two handling paths.
>>
>> Signed-off-by: Chenyuan Mi <cymi20@...an.edu.cn>
>> Signed-off-by: Xiyu Yang <xiyuyang19@...an.edu.cn>
>> Signed-off-by: Xin Tan <tanxin.ctf@...il.com>
>
> Reviewed-by: Joseph Qi <joseph.qi@...ux.alibaba.com>
>> ---
>> fs/ocfs2/alloc.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
>> index f1cc8258d34a..b05fde7edc3a 100644
>> --- a/fs/ocfs2/alloc.c
>> +++ b/fs/ocfs2/alloc.c
>> @@ -5940,6 +5940,7 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
>> status = ocfs2_journal_access_di(handle, INODE_CACHE(tl_inode), tl_bh,
>> OCFS2_JOURNAL_ACCESS_WRITE);
>> if (status < 0) {
>> + ocfs2_commit_trans(osb, handle);
>> mlog_errno(status);
>> goto bail;
>> }
>> @@ -5964,6 +5965,7 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
>> data_alloc_bh, start_blk,
>> num_clusters);
>> if (status < 0) {
>> + ocfs2_commit_trans(osb, handle);
>> mlog_errno(status);
>> goto bail;
>> }
>>
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel@....oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-devel
>
Powered by blists - more mailing lists