]> git.baikalelectronics.ru Git - kernel.git/commit
PM: hibernate: use correct mode for swsusp_close()
authorThomas Zeitlhofer <thomas.zeitlhofer+lkml@ze-it.at>
Tue, 23 Nov 2021 19:18:43 +0000 (20:18 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 Nov 2021 12:45:54 +0000 (13:45 +0100)
commit4eb731035da67c81f13ec73e1a30d04893ca742b
tree6c80bb144f690bb6c449e550d323c156c0f2ea4a
parent183b8c70348e8991bc1bb81710777587b8549f2a
PM: hibernate: use correct mode for swsusp_close()

Commit 1874ebf348ca ("PM: hibernate: Get block device exclusively in
swsusp_check()") changed the opening mode of the block device to
(FMODE_READ | FMODE_EXCL).

In the corresponding calls to swsusp_close(), the mode is still just
FMODE_READ which triggers the warning in blkdev_flush_mapping() on
resume from hibernate.

So, use the mode (FMODE_READ | FMODE_EXCL) also when closing the
device.

Fixes: 1874ebf348ca ("PM: hibernate: Get block device exclusively in swsusp_check()")
Signed-off-by: Thomas Zeitlhofer <thomas.zeitlhofer+lkml@ze-it.at>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/hibernate.c