From: David Sterba <dsterba@suse.cz>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: respect the max size in the header when activating swap file
Date: Mon, 3 Jan 2022 19:30:56 +0100 [thread overview]
Message-ID: <20220103183056.GP28560@twin.jikos.cz> (raw)
In-Reply-To: <639eadb028056b60364ba7461c5e20e5737229a2.1639666714.git.fdmanana@suse.com>
On Thu, Dec 16, 2021 at 03:00:32PM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> If we extended the size of a swapfile after its header was created (by the
> mkswap utility) and then try to activate it, we will map the entire file
> when activating the swap file, instead of limiting to the max size defined
> in the swap file's header.
>
> Currently test case generic/643 from fstests fails because we do not
> respect that size limit defined in the swap file's header.
>
> So fix this by not mapping file ranges beyond the max size defined in the
> swap header.
>
> This is the same type of bug that iomap used to have, and was fixed in
> commit 36ca7943ac18ae ("mm/swap: consider max pages in
> iomap_swapfile_add_extent").
>
> Fixes: ed46ff3d423780 ("Btrfs: support swap files")
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Added to misc-next, thanks.
prev parent reply other threads:[~2022-01-03 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 15:00 [PATCH] btrfs: respect the max size in the header when activating swap file fdmanana
2021-12-17 15:08 ` Josef Bacik
2022-01-03 18:30 ` David Sterba [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=20220103183056.GP28560@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=fdmanana@kernel.org \
--cc=linux-btrfs@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