Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp591208pxa; Fri, 21 Aug 2020 15:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMCG3E1x7TsF81UIy+QH1/XP15k2YBle9O/EvXXSb/pfO6aef8/w+SOLiQPGRXzJSL8mDJ X-Received: by 2002:a17:906:cc4a:: with SMTP id mm10mr4814363ejb.451.1598049253676; Fri, 21 Aug 2020 15:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598049253; cv=none; d=google.com; s=arc-20160816; b=osXpVjSZMcW9FJsBG1Dr1sVW5KnuEBKKZbv4j0e4KSPAPG/DupV0EXJicPpWYW36W9 ndkU23wgkVmHv3skfCOfwzIDni/J78Aehk+7RDvTXj2H/AmPyQz7A1rov2dpL00QIyYd PBOn6TuwH8DieRelUPUXA9YLnQweEfcafZdi2OhPFgJSG8BTq+Guz7bzEXxYfeG/XjeM xc5vmvWh/F6UdtSk7JtY/d118XnthsCkT/9G7WA9+EqPp0kl0aJGPVmlFdnHrJMvvn3z aZQokpPUsyMSQ7Y/V5h+mP11YLQAmUuswJ7prCqampvK70xAVJSyvmPXOrhT67C8N8DY DIcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature; bh=KGOXaiYn1ak+sFNzgNB3oOUptsvwKqYPuda3QEWzejY=; b=R5eOwihhl1xIwVHyF8Il4iRPvTK7+A5fXzIBRH7wUCjIzcEw0R04ovEgEdTo5ufm7a 82IXyuO9IeFhc4Yswt73fxtRhXZIdM00cV6PR+bNUTNJXGTfFJWxmDyHCOynP48Dh88b Ca5nbJvLMU9GEaHTzVvOnbepBIEibYHtyugw+r+9/8LOhHYMpecVvcDuPzzhdf4WiQT6 DUuuPqkXv8vzsvtSfiZVlK5ETCpu+2C0vYQhTocqfpxI/ocpSZvtCmm/t61NvpwuRpJl EvBIWexRgHx8JCg1lZOEoY1Qf2HyHwXv0cIz836FzX7Xa3fYWHEiYGfoAVoIUCEgB6w7 fM8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=YEcRFCcJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si2237617ejf.569.2020.08.21.15.33.50; Fri, 21 Aug 2020 15:34:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=YEcRFCcJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726996AbgHUWbl (ORCPT + 99 others); Fri, 21 Aug 2020 18:31:41 -0400 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:15151 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726747AbgHUWbk (ORCPT ); Fri, 21 Aug 2020 18:31:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1598049100; x=1629585100; h=date:from:to:subject:message-id:references:mime-version: in-reply-to; bh=KGOXaiYn1ak+sFNzgNB3oOUptsvwKqYPuda3QEWzejY=; b=YEcRFCcJF2cjfZEA5BiHSLUVDUmiaHlUkXT44pSgd1ilR2PXaM6YVigX uXxLq/zhKpu3PGJSseEyMpk1VAQh74g3p4yPHul1Y1R+5bMRiQErkELjI ncqGcIaL417ayfK41ljNWARIgm2LbYGVg8h9DWJaid7umV0ikWnUxGfU/ w=; X-IronPort-AV: E=Sophos;i="5.76,338,1592870400"; d="scan'208";a="49307415" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1a-67b371d8.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 21 Aug 2020 22:31:39 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1a-67b371d8.us-east-1.amazon.com (Postfix) with ESMTPS id DEBBDA21BC; Fri, 21 Aug 2020 22:31:32 +0000 (UTC) Received: from EX13D01UWB001.ant.amazon.com (10.43.161.75) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 21 Aug 2020 22:31:14 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13d01UWB001.ant.amazon.com (10.43.161.75) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 21 Aug 2020 22:31:14 +0000 Received: from dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (172.22.96.68) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 21 Aug 2020 22:31:14 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id B096A40362; Fri, 21 Aug 2020 22:31:14 +0000 (UTC) Date: Fri, 21 Aug 2020 22:31:14 +0000 From: Anchal Agarwal To: , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v3 11/11] PM / hibernate: update the resume offset on SNAPSHOT_SET_SWAP_AREA Message-ID: <61d94dd74e238edeb264d8e3aa43847b93f986b6.1598042152.git.anchalag@amazon.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aleksei Besogonov The SNAPSHOT_SET_SWAP_AREA is supposed to be used to set the hibernation offset on a running kernel to enable hibernating to a swap file. However, it doesn't actually update the swsusp_resume_block variable. As a result, the hibernation fails at the last step (after all the data is written out) in the validation of the swap signature in mark_swapfiles(). Before this patch, the command line processing was the only place where swsusp_resume_block was set. [Anchal Agarwal: Changelog: Resolved patch conflict as code fragmented to snapshot_set_swap_area] Signed-off-by: Aleksei Besogonov Signed-off-by: Munehisa Kamata Signed-off-by: Anchal Agarwal --- kernel/power/user.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/power/user.c b/kernel/power/user.c index d5eedc2baa2a..704a7173e99c 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -242,9 +242,12 @@ static int snapshot_set_swap_area(struct snapshot_data *data, return -EINVAL; } data->swap = swap_type_of(swdev, offset, &bdev); - if (data->swap < 0) + if (data->swap < 0) { return -ENODEV; - + } else { + swsusp_resume_device = swdev; + swsusp_resume_block = offset; + } data->bd_inode = bdev->bd_inode; bdput(bdev); return 0; -- 2.16.6