From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: lihongweizz <lihongweizz@inspur.com>,
mark@fasheh.com, jlbec@evilplan.org
Cc: ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ocfs2: fix infinite loop for orphan entry list
Date: Fri, 25 Nov 2022 17:41:04 +0800 [thread overview]
Message-ID: <711323de-5a9f-db09-6105-319ff1ff52c1@linux.alibaba.com> (raw)
In-Reply-To: <20221125034118.427-1-lihongweizz@inspur.com>
On 11/25/22 11:41 AM, lihongweizz wrote:
> Orphan file may be in the recover list already when the ip_next_orphan
> is NULL (for example, orphan file is second tail elementof recover
> list). In this scenario, the file could be added to the list twice
> and infinite loop happened. So we need another pointer value here(EFAULT)
> instead of NULL for the list tail element.
>
Don't understand how it happens. Is this a real issue you encountered?
When queue orphans, it will bypass those already in recover list.
Thanks,
Joseph
> Signed-off-by: lihongweizz <lihongweizz@inspur.com>
> ---
> fs/ocfs2/journal.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
> index 126671e..4620013 100644
> --- a/fs/ocfs2/journal.c
> +++ b/fs/ocfs2/journal.c
> @@ -2207,7 +2207,7 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb,
> enum ocfs2_orphan_reco_type orphan_reco_type)
> {
> int ret = 0;
> - struct inode *inode = NULL;
> + struct inode *inode = ERR_PTR(-EFAULT);
> struct inode *iter;
> struct ocfs2_inode_info *oi;
> struct buffer_head *di_bh = NULL;
> @@ -2224,7 +2224,7 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb,
> if (ret)
> mlog_errno(ret);
>
> - while (inode) {
> + while (!IS_ERR(inode)) {
> oi = OCFS2_I(inode);
> trace_ocfs2_recover_orphans_iput(
> (unsigned long long)oi->ip_blkno);
prev parent reply other threads:[~2022-11-25 9:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-25 3:41 lihongweizz
2022-11-25 9:41 ` Joseph Qi [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=711323de-5a9f-db09-6105-319ff1ff52c1@linux.alibaba.com \
--to=joseph.qi@linux.alibaba.com \
--cc=jlbec@evilplan.org \
--cc=lihongweizz@inspur.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@oss.oracle.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
all inboxes | Powered by JetHome®