All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sherry Yang <sherry.yang@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>,
	"dchinner@redhat.com" <dchinner@redhat.com>,
	Allison Henderson <allison.henderson@oracle.com>,
	"chandanrlinux@gmail.com" <chandanrlinux@gmail.com>,
	"bfoster@redhat.com" <bfoster@redhat.com>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] xfs: initialize error in xfs_defer_finish_one
Date: Wed, 3 Aug 2022 23:42:21 +0000	[thread overview]
Message-ID: <DB9D3780-165D-4E49-823D-4D5253E64905@oracle.com> (raw)
In-Reply-To: <Yun6I/drpxG4L4RO@magnolia>


> On Aug 2, 2022, at 9:31 PM, Darrick J. Wong <djwong@kernel.org> wrote:
> 
> 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.

Hi Darrick, 

You’re correct. This is a false positive bug detected by our static code 
analysis tool. Sorry for the noise.

Sherry
> 
> --D
> 
>> Cheers,
>> 
>> Dave.
>> -- 
>> Dave Chinner
>> david@fromorbit.com


  reply	other threads:[~2022-08-03 23:42 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
2022-08-03 23:42     ` Sherry Yang [this message]
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=DB9D3780-165D-4E49-823D-4D5253E64905@oracle.com \
    --to=sherry.yang@oracle.com \
    --cc=allison.henderson@oracle.com \
    --cc=bfoster@redhat.com \
    --cc=chandanrlinux@gmail.com \
    --cc=david@fromorbit.com \
    --cc=dchinner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.