public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Alistair Popple <apopple@nvidia.com>, linux-xfs@vger.kernel.org
Subject: Re: [bug report] fs/dax: create a common implementation to break DAX layouts
Date: Fri, 10 Jan 2025 08:57:45 -0800	[thread overview]
Message-ID: <20250110165745.GS1306365@frogsfrogsfrogs> (raw)
In-Reply-To: <accc103b-01c9-49a5-b840-43f55c91b1bb@stanley.mountain>

On Fri, Jan 10, 2025 at 10:03:18AM +0300, Dan Carpenter wrote:
> Hello Alistair Popple,
> 
> Commit 738ec092051b ("fs/dax: create a common implementation to break
> DAX layouts") from Jan 7, 2025 (linux-next), leads to the following
> Smatch static checker warning:
> 
> 	fs/xfs/xfs_inode.c:3034 xfs_break_layouts()
> 	error: uninitialized symbol 'error'.
> 
> fs/xfs/xfs_inode.c
>     3009 int
>     3010 xfs_break_layouts(
>     3011         struct inode                *inode,
>     3012         uint                        *iolock,
>     3013         enum layout_break_reason reason)
>     3014 {
>     3015         bool                        retry;
>     3016         int                        error;
>     3017 
>     3018         xfs_assert_ilocked(XFS_I(inode), XFS_IOLOCK_SHARED | XFS_IOLOCK_EXCL);
>     3019 
>     3020         do {
>     3021                 retry = false;
>     3022                 switch (reason) {
>     3023                 case BREAK_UNMAP:
>     3024                         if (xfs_break_dax_layouts(inode))
>     3025                                 break;
> 
> What about if we hit this break on the first iteration?

I think that's a bug, thanks for the wakeup, Dan. :)

--D

>     3026                         fallthrough;
>     3027                 case BREAK_WRITE:
>     3028                         error = xfs_break_leased_layouts(inode, iolock, &retry);
>     3029                         break;
>     3030                 default:
>     3031                         WARN_ON_ONCE(1);
>     3032                         error = -EINVAL;
>     3033                 }
> --> 3034         } while (error == 0 && retry);
>     3035 
>     3036         return error;
>     3037 }
> 
> regards,
> dan carpenter
> 

      reply	other threads:[~2025-01-10 16:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-10  7:03 [bug report] fs/dax: create a common implementation to break DAX layouts Dan Carpenter
2025-01-10 16:57 ` 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=20250110165745.GS1306365@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=apopple@nvidia.com \
    --cc=dan.carpenter@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox