Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp97168ybk; Tue, 19 May 2020 16:32:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5/TI+uw7GOn/1bgYM8JuSmgqwqHNmDjyupy5ZOzp5S+odPdRlGaO8kIJ5XxsEF4Z0baNh X-Received: by 2002:a17:906:38d6:: with SMTP id r22mr1479052ejd.74.1589931142153; Tue, 19 May 2020 16:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589931142; cv=none; d=google.com; s=arc-20160816; b=MP2aRwkxSEfV2c+TO3r1t3JdcS2O8Z+mSN0aRKSgBo5P0sL7CiUB7Kv6V9Fsl37Kzp vV7ZYjhEqcgsFVEMkn8HskkKoBY9km8eQNOHvpwdebdDOXyEut9GIZxIpJXs8a/dIa03 wRtByTv3RiNAg5rRk+aGf5+WF319JnKyojtZEstuRAbEXwJeou3X4Q/BvxDFAcOWaube ZcxqafjC29G/izacz5Nxs6VrLBsQMDksA9RoxEYQqvN3lZvkjZzi1JYDfFCcP7OaiX2y 5Nf4WZZtyNPhFPXjjcLIEoNiABYvNXsJOvG79JDlSWdQ0uD/XFUTAMB2pzbn7dtqUaZG STAQ== 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:ironport-sdr:dkim-signature; bh=fitAmmYR+siRHznU7MJYKk9c4Tw82/jy6e5chPwlJLw=; b=m0BQo6jr0TgIHohodEUCl6YdacU9hxt7Wd7erZvXhcsT7irSOarjXoUFr0NUueWGqQ 1CBQ5gOHGjjxf91AGwjg8RoaKL7Dk4p7OgGBbz4XSc+qeQOibmKYB+UOoqSdv/1+0Vi9 hKZ/roMiPnaIE6yZBl5bdoRVI0CK0ONHLoa8/IFGCm159/kSgckvBhhqD3diN9c35vi2 YsC3e6Ampp5OLzdjesbdZ3rC9ROBeSaUY5ahEsqcwLi08nJiweQnWhlUjeTJYruxht2j yCmKKVY7ZO175K6+PQQCamaWmejL6P1tJizc3q7rpreiDlx8labjXSwqInL8qft+p7BJ ksTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=YygAM4rx; 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 k3si789678ejk.202.2020.05.19.16.31.59; Tue, 19 May 2020 16:32:22 -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=YygAM4rx; 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 S1728526AbgESXaE (ORCPT + 99 others); Tue, 19 May 2020 19:30:04 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:40836 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728432AbgESXaC (ORCPT ); Tue, 19 May 2020 19:30:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1589931002; x=1621467002; h=date:from:to:subject:message-id:references:mime-version: in-reply-to; bh=fitAmmYR+siRHznU7MJYKk9c4Tw82/jy6e5chPwlJLw=; b=YygAM4rxhevUTIpwXDea+e1znhZ7YOkK+Xbwgvyk2RpqEX1HneGo34qH FUR9cIh77T27+TwpzuT/FfNlYH1JbfxCVlwArylM/KP1tL7hgMuWok+zE H0QLewXYVd0zlqr1NelNitMrBpv7JsNH4728d9RmELnUU2LHe0srjoA2i M=; IronPort-SDR: Wl3dSMwhpOL5k2tH39DJuBMefCB10ew0UQM8WlE40AAwlaQq7gFVjSYFqv7rMMiJuNURig22t8 62l/Qk1vmD/Q== X-IronPort-AV: E=Sophos;i="5.73,411,1583193600"; d="scan'208";a="36216330" Received: from sea32-co-svc-lb4-vlan2.sea.corp.amazon.com (HELO email-inbound-relay-2b-859fe132.us-west-2.amazon.com) ([10.47.23.34]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 19 May 2020 23:30:01 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-859fe132.us-west-2.amazon.com (Postfix) with ESMTPS id C56E42225D4; Tue, 19 May 2020 23:29:59 +0000 (UTC) Received: from EX13D07UWB004.ant.amazon.com (10.43.161.196) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 May 2020 23:29:52 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D07UWB004.ant.amazon.com (10.43.161.196) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 May 2020 23:29:52 +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; Tue, 19 May 2020 23:29:52 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id 847C740712; Tue, 19 May 2020 23:29:52 +0000 (UTC) Date: Tue, 19 May 2020 23:29:52 +0000 From: Anchal Agarwal To: , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 12/12] PM / hibernate: update the resume offset on SNAPSHOT_SET_SWAP_AREA Message-ID: <40de33ca69c0d3bcf8c827862768ae5d399698d6.1589926004.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. [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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/power/user.c b/kernel/power/user.c index 7959449765d9..1afa1f0a223e 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -235,8 +235,12 @@ static int snapshot_set_swap_area(struct snapshot_data *data, return -EINVAL; } data->swap = swap_type_of(swdev, offset, NULL); - if (data->swap < 0) + if (data->swap < 0) { return -ENODEV; + } else { + swsusp_resume_device = swdev; + swsusp_resume_block = offset; + } return 0; } -- 2.24.1.AMZN