From patchwork Thu Mar 11 15:51:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Righi X-Patchwork-Id: 1451359 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DxD2F4WHPz9sWX; Fri, 12 Mar 2021 02:51:17 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lKNai-0004fa-OK; Thu, 11 Mar 2021 15:51:12 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lKNah-0004en-1X for kernel-team@lists.ubuntu.com; Thu, 11 Mar 2021 15:51:11 +0000 Received: from mail-ed1-f70.google.com ([209.85.208.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lKNag-0007gO-O2 for kernel-team@lists.ubuntu.com; Thu, 11 Mar 2021 15:51:10 +0000 Received: by mail-ed1-f70.google.com with SMTP id w16so10090280edc.22 for ; Thu, 11 Mar 2021 07:51:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7pVfrkfHH0sBjXZKbsluuZY7biQ9qpWYleuAuoFcS2E=; b=kuIRacg0mO+HatuqC+0h0/0AOCv6+aZadqwQ4eAiqaSwPGAQ+l0k9Sk44Ig9IGHtee XCSBBbF7n/4qstX9EH1CPowtXOTpxMUlccjjnILWzTulGWuIcwg5tsY6jfNND3SQcaAm EL65i8S3ov46X3UU7LcezgS8S45lAcUij81WQRI2TAS/VQ+IEv4ZQ0qeOZ4LBfHZop1n C4ZdirjJXTDX+4dF/wPCCixV1TIu/H9rkiAEzdprjcWRQl+sw8ipRgxbABFPoL3pgVEn 7ZyTpZMke9HuwbMcd3uFU2PSLfxostJB/LlK2urHfI6qqxxsmP2qfjxAwfTgNr4hD9Br FHcQ== X-Gm-Message-State: AOAM530jYvzGJNsmya+HW6lnU6AE24nhYC6xlv7S9NBa9Hjd//mFn+/4 T6RQUSGLiZXqPEyeQr+mhBA7fbWl9KkLAhMceCneTt91yKi1YSPDEOB5HTUiTmYjDkGe1uXkPg/ 61L/R/pX1zY7ziQpFyUcd3QJkD66P9MRzmhbIqGxnyA== X-Received: by 2002:a17:906:1d4e:: with SMTP id o14mr2964388ejh.549.1615477870474; Thu, 11 Mar 2021 07:51:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzINp8Do4CpuUAvaGaICl/kLSY5ZQR+nkSbHLNBCFbtCr8UsR5i3q6szMCdcNp+pOyyTzz0BA== X-Received: by 2002:a17:906:1d4e:: with SMTP id o14mr2964364ejh.549.1615477870237; Thu, 11 Mar 2021 07:51:10 -0800 (PST) Received: from xps-13-7390.homenet.telecomitalia.it (host-95-235-132-1.retail.telecomitalia.it. [95.235.132.1]) by smtp.gmail.com with ESMTPSA id d19sm1545998edr.45.2021.03.11.07.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:51:10 -0800 (PST) From: Andrea Righi To: kernel-team@lists.ubuntu.com Subject: [SRU][F/aws][PATCH 1/2] PM: hibernate: flush swap writer after marking Date: Thu, 11 Mar 2021 16:51:00 +0100 Message-Id: <20210311155101.98612-2-andrea.righi@canonical.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311155101.98612-1-andrea.righi@canonical.com> References: <20210311155101.98612-1-andrea.righi@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Laurent Badel BugLink: https://bugs.launchpad.net/bugs/1918694 Flush the swap writer after, not before, marking the files, to ensure the signature is properly written. Fixes: 6f612af57821 ("PM / Hibernate: Group swap ops") Signed-off-by: Laurent Badel Cc: All applicable Signed-off-by: Rafael J. Wysocki (cherry picked from commit fef9c8d28e28a808274a18fbd8cc2685817fd62a) Signed-off-by: Andrea Righi --- kernel/power/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 7286fd82d875..b55b59c5336d 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -578,10 +578,10 @@ static int swap_writer_finish(struct swap_map_handle *handle, unsigned int flags, int error) { if (!error) { - flush_swap_writer(handle); pr_info("S"); error = mark_swapfiles(handle, flags); pr_cont("|\n"); + flush_swap_writer(handle); } if (error)