From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: fix quotacheck dquot id overflow infinite loop
Date: Mon, 24 Jul 2017 08:33:36 -0700 [thread overview]
Message-ID: <20170724153336.GA4352@magnolia> (raw)
In-Reply-To: <20170724150229.12549-1-bfoster@redhat.com>
On Mon, Jul 24, 2017 at 11:02:29AM -0400, Brian Foster wrote:
> If a dquot has an id of U32_MAX, the next lookup index increment
> overflows the uint32_t back to 0. This starts the lookup sequence
> over from the beginning, repeats indefinitely and results in a
> livelock.
>
> Update xfs_qm_dquot_walk() to explicitly check for the lookup
> overflow and exit the loop.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/xfs_qm.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index 6ce948c..15751dc 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -111,6 +111,9 @@ xfs_qm_dquot_walk(
> skipped = 0;
> break;
> }
> + /* we're done if id overflows back to zero */
> + if (!next_index)
> + break;
> }
>
> if (skipped) {
> --
> 2.9.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-07-24 15:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-24 15:02 [PATCH] xfs: fix quotacheck dquot id overflow infinite loop Brian Foster
2017-07-24 15:33 ` Darrick J. Wong [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=20170724153336.GA4352@magnolia \
--to=darrick.wong@oracle.com \
--cc=bfoster@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/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