Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1695030ybt; Thu, 2 Jul 2020 11:26:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyOH6JBjWIdLVQqtCaXXTLl8c3s3Z7vgTz6O4jcI6TVkFbJDBn/fxkIYSj9Ote9iuYAsus X-Received: by 2002:a50:d501:: with SMTP id u1mr36260600edi.159.1593714394028; Thu, 02 Jul 2020 11:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593714394; cv=none; d=google.com; s=arc-20160816; b=dMvlMJUGs01Fgq3aBWlQcUa+UisxRYOGlmmUop9QRYuQP2Y2DKF9HUhYY+DlGP3MoB tZXZpthuGqJjWzWDKc2wiHsVaTfdBf2uB+um41ctyZVT1QsLiupl83POLPfBJp5TqTBv OzPouFyUBr/1+DCb1Lv1l2yvOqYMBTc3qBOPvdvcnQ9AzrD9rmU+75L4I3jj3MurEwsE lYwJ1S2DYQ3i4JA7+hHQkjDbfnZSTEYWUgUCeoiWmAWHgIZCt4J0dLU13ojp6Itwfo0o YBv/t5zK5Gd9BuYJTUkcS97CHksFopg3sJSaiWxx5qqwG4so+tU2O1X2DZJHuPJQwlvI ii8w== 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=8xWBYHNSqyc0rRCT8ma4wuwSS0bbWLxvstPp4v8IEIQ=; b=zOfYfkJGBliNBjgwS7gRpMSjQgEYbPgx84s3AOnjyU1ozSa4e2/eAXYPGDhxmbXvP5 H0SlJBK9YqTvFt8IpYdewrmTWmNvBORBQEsUkT4yGa3MWjoxk9rcqlY4BRmjaln0i7ur goqcubAWQFBGhzEJOnjy3hGrT4vLcMpD3KvvHQEbYeKZn1hprzxuISWOUPKXDQzFQ+zk Xp9VEjGf8wlkv44Avame4ER+coVkP50qUk5BmyTbZoJaiaG5lMSMmMA4cHnH+1W/hamv WR+/1HrMoTDYSenetQ4UAYw2WOQu8ADpmNrf94vrDpds8+raleCSzcRLyuMauZhMWKIp wxmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=dKwhQogB; 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 dd7si6631732ejb.615.2020.07.02.11.26.10; Thu, 02 Jul 2020 11:26:34 -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=dKwhQogB; 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 S1728096AbgGBSYF (ORCPT + 99 others); Thu, 2 Jul 2020 14:24:05 -0400 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:64061 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727882AbgGBSYF (ORCPT ); Thu, 2 Jul 2020 14:24:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1593714244; x=1625250244; h=date:from:to:subject:message-id:references:mime-version: in-reply-to; bh=8xWBYHNSqyc0rRCT8ma4wuwSS0bbWLxvstPp4v8IEIQ=; b=dKwhQogBiG38kRTV9cIxd2hom5FJS8v1BFqS6UlOfR57ptUdWzxE/iiV mTxaYJTeEdY9x/aImJn/3xuLNCyKdhwBR3jGW7U/JorU0bhdpGqCosQEg Ncys7NAKZfTYovy7dr2XjxoPh7UQpVSQhu/var/BACXMorIbV8yq9HCm8 8=; IronPort-SDR: sDAToUmcQVKVwVu9eMz0u6grcT4hSIwmjgpl1XIY45YPsfIMhKSq5/2gBLD4pbIvjcoFAEP58A Z+Jgig/wdQNw== X-IronPort-AV: E=Sophos;i="5.75,305,1589241600"; d="scan'208";a="39714105" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1a-715bee71.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 02 Jul 2020 18:24:03 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1a-715bee71.us-east-1.amazon.com (Postfix) with ESMTPS id 23592A25CA; Thu, 2 Jul 2020 18:23:55 +0000 (UTC) Received: from EX13D05UWC001.ant.amazon.com (10.43.162.82) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Jul 2020 18:23:37 +0000 Received: from EX13MTAUWC001.ant.amazon.com (10.43.162.135) by EX13D05UWC001.ant.amazon.com (10.43.162.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Jul 2020 18:23:37 +0000 Received: from dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (172.22.96.68) by mail-relay.amazon.com (10.43.162.232) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 2 Jul 2020 18:23:37 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id 5F90C40844; Thu, 2 Jul 2020 18:23:37 +0000 (UTC) Date: Thu, 2 Jul 2020 18:23:37 +0000 From: Anchal Agarwal To: , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 11/11] PM / hibernate: update the resume offset on SNAPSHOT_SET_SWAP_AREA Message-ID: <20200702182337.GA3762@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/power/user.c b/kernel/power/user.c index d5eedc2baa2a..e1209cefc103 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -242,8 +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); -- 2.20.1