From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Sherry Yang <sherry.yang@oracle.com>,
dchinner@redhat.com, allison.henderson@oracle.com,
chandanrlinux@gmail.com, bfoster@redhat.com,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] xfs: initialize error in xfs_defer_finish_one
Date: Tue, 2 Aug 2022 21:31:31 -0700 [thread overview]
Message-ID: <Yun6I/drpxG4L4RO@magnolia> (raw)
In-Reply-To: <20220801204902.GA3600936@dread.disaster.area>
On Tue, Aug 02, 2022 at 06:49:02AM +1000, Dave Chinner wrote:
> On Mon, Aug 01, 2022 at 12:03:11PM -0700, Sherry Yang wrote:
> > Path through non-void function 'xfs_defer_finish_one' may return error
> > uninitialized if no iteration of 'list_for_each_safe' occurs. Fix this
> > by initializing error.
>
> I didn't think this situation was possible - how do we get deferred
> work queued with no work items on it?
>
> If we can return an uninitialised error from xfs_defer_finish_one()
> because of an empty queued work, then something else has gone wrong
> earlier in the work deferral process. If this can actually happen,
> then we need to fix whatever is creating the empty work rather than
> paper over it by initialising the error being returned for empty
> works...
/me bets this is a response to a static checker that doesn't know that
list_empty(&dfp->dfp_work) == false in all circumstances. It's not
possible for tp->t_dfops to contain an xfs_defer_pending with no work
items.
--D
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com
next prev parent reply other threads:[~2022-08-03 4:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-01 19:03 [PATCH v1] xfs: initialize error in xfs_defer_finish_one Sherry Yang
2022-08-01 20:49 ` Dave Chinner
2022-08-03 4:31 ` Darrick J. Wong [this message]
2022-08-03 23:42 ` Sherry Yang
2022-08-04 5:07 ` Darrick J. Wong
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=Yun6I/drpxG4L4RO@magnolia \
--to=djwong@kernel.org \
--cc=allison.henderson@oracle.com \
--cc=bfoster@redhat.com \
--cc=chandanrlinux@gmail.com \
--cc=david@fromorbit.com \
--cc=dchinner@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=sherry.yang@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