From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Ye Bin <yebin10@huawei.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Linux PM <linux-pm@vger.kernel.org>, "Ted Ts'o" <tytso@mit.edu>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Jan Kara <jack@suse.cz>
Subject: Re: [PATCH -next] PM:hibernate:fix miss close 'hib_resume_bdev' in load_image_and_restore
Date: Wed, 16 Feb 2022 19:48:58 +0100 [thread overview]
Message-ID: <CAJZ5v0iMOJ-mHL6hUUWs+kuq=4C=_DGUM5b9=jHUp=qnEB2Gqg@mail.gmail.com> (raw)
In-Reply-To: <20220209112951.3073370-1-yebin10@huawei.com>
On Wed, Feb 9, 2022 at 12:13 PM Ye Bin <yebin10@huawei.com> wrote:
>
> As 'swsusp_check' open 'hib_resume_bdev', if call 'create_basic_memory_bitmaps'
> failed, we need to close 'hib_resume_bdev' in 'load_image_and_restore' function.
>
> Signed-off-by: Ye Bin <yebin10@huawei.com>
> ---
> kernel/power/hibernate.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index e6af502c2fd7..49d1df0218cb 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -689,8 +689,10 @@ static int load_image_and_restore(void)
>
> lock_device_hotplug();
> error = create_basic_memory_bitmaps();
> - if (error)
> + if (error) {
> + swsusp_close(FMODE_READ | FMODE_EXCL);
> goto Unlock;
> + }
>
> error = swsusp_read(&flags);
> swsusp_close(FMODE_READ | FMODE_EXCL);
> --
Applied as 5.18 material, thanks!
prev parent reply other threads:[~2022-02-16 18:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 11:29 [PATCH -next] PM:hibernate:fix miss close 'hib_resume_bdev' in load_image_and_restore Ye Bin
2022-02-16 18:48 ` Rafael J. Wysocki [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='CAJZ5v0iMOJ-mHL6hUUWs+kuq=4C=_DGUM5b9=jHUp=qnEB2Gqg@mail.gmail.com' \
--to=rafael@kernel.org \
--cc=jack@suse.cz \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=tytso@mit.edu \
--cc=yebin10@huawei.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;
as well as URLs for NNTP newsgroup(s).