From: Greg KH <gregkh@linuxfoundation.org>
To: Chandan Babu R <chandan.babu@oracle.com>
Cc: sashal@kernel.org, mcgrof@kernel.org, linux-xfs@vger.kernel.org,
stable@vger.kernel.org, djwong@kernel.org, amir73il@gmail.com,
leah.rumancik@gmail.com
Subject: Re: [PATCH 5.4 V2] xfs: redesign the reflink remap loop to fix blkres depletion crash
Date: Mon, 21 Nov 2022 13:13:04 +0100 [thread overview]
Message-ID: <Y3trUDu2Y0LqQOot@kroah.com> (raw)
In-Reply-To: <20221121095506.1190043-1-chandan.babu@oracle.com>
On Mon, Nov 21, 2022 at 03:25:06PM +0530, Chandan Babu R wrote:
> From: "Darrick J. Wong" <darrick.wong@oracle.com>
>
> commit 00fd1d56dd08a8ceaa9e4ee1a41fefd9f6c6bc7d upstream.
>
> The existing reflink remapping loop has some structural problems that
> need addressing:
>
> The biggest problem is that we create one transaction for each extent in
> the source file without accounting for the number of mappings there are
> for the same range in the destination file. In other words, we don't
> know the number of remap operations that will be necessary and we
> therefore cannot guess the block reservation required. On highly
> fragmented filesystems (e.g. ones with active dedupe) we guess wrong,
> run out of block reservation, and fail.
>
> The second problem is that we don't actually use the bmap intents to
> their full potential -- instead of calling bunmapi directly and having
> to deal with its backwards operation, we could call the deferred ops
> xfs_bmap_unmap_extent and xfs_refcount_decrease_extent instead. This
> makes the frontend loop much simpler.
>
> Solve all of these problems by refactoring the remapping loops so that
> we only perform one remapping operation per transaction, and each
> operation only tries to remap a single extent from source to dest.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Brian Foster <bfoster@redhat.com>
> Reported-by: Edwin Török <edwin@etorok.net>
> Tested-by: Edwin Török <edwin@etorok.net>
> [backported to 5.4.y - Tested-by above does not refer to the backport]
> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
> Acked-by: Darrick J. Wong <djwong@kernel.org>
> ---
> Changelog:
> V1 -> V2:
> 1. Add a note in the commit message to indicate that the Tested-by
> tag from the original commit is not applicable to the backport.
Text now updated, thanks.
next prev parent reply other threads:[~2022-11-21 12:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-11 4:10 [PATCH 5.4 0/6] xfs stable candidate patches for 5.4.y (from v5.9) Chandan Babu R
2022-11-11 4:10 ` [PATCH 5.4 1/6] xfs: preserve rmapbt swapext block reservation from freed blocks Chandan Babu R
2022-11-11 4:10 ` [PATCH 5.4 2/6] xfs: rename xfs_bmap_is_real_extent to is_written_extent Chandan Babu R
2022-11-11 4:10 ` [PATCH 5.4 3/6] xfs: redesign the reflink remap loop to fix blkres depletion crash Chandan Babu R
2022-11-21 9:55 ` [PATCH 5.4 V2] " Chandan Babu R
2022-11-21 12:13 ` Greg KH [this message]
2022-11-11 4:10 ` [PATCH 5.4 4/6] xfs: use MMAPLOCK around filemap_map_pages() Chandan Babu R
2022-11-11 4:10 ` [PATCH 5.4 5/6] xfs: preserve inode versioning across remounts Chandan Babu R
2022-11-11 4:10 ` [PATCH 5.4 6/6] xfs: drain the buf delwri queue before xfsaild idles Chandan Babu R
2022-11-11 9:04 ` [PATCH 5.4 0/6] xfs stable candidate patches for 5.4.y (from v5.9) Greg KH
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=Y3trUDu2Y0LqQOot@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=amir73il@gmail.com \
--cc=chandan.babu@oracle.com \
--cc=djwong@kernel.org \
--cc=leah.rumancik@gmail.com \
--cc=linux-xfs@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=sashal@kernel.org \
--cc=stable@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