From patchwork Wed Sep 6 04:18:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yu X-Patchwork-Id: 720758 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1612EB8FA5 for ; Wed, 6 Sep 2023 04:18:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbjIFESv (ORCPT ); Wed, 6 Sep 2023 00:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjIFESu (ORCPT ); Wed, 6 Sep 2023 00:18:50 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93A98B2; Tue, 5 Sep 2023 21:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693973927; x=1725509927; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=riQzctx+Sg+R9UfUX4B/xGeJX17wKAuZ+VBM9nHly9Y=; b=mtCJDmOmTbpFEeorPv/iTKYcVOvsNvArnL8g+m/7HmYK+n55KcfqsBjo GQ/0hHT2QlK/aIar4tOrumSjn3rrRgendTowO9DCDwvNUGfD6OVZOUw+B lm5u0LFLK4tImfAkcIDnGjm4Z9DxicIpo88CeDFUfbTf6h18dU4eSdxID tysfmEbkN6UrSwHCm9obS21r+2WQWLf4dtMLpQ50RX2Cj58qQyOdo1pGb sgq6mIih2FduGxNFoVAgVesaQGqI6ZEE0pnAH0ihW2aFTHYFh7Xt04D74 kjqRZfqLy0uhNmteiEu0R8NvRJm+DivOHw8fJJDlezmRvGThe7PTCHMJ3 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10824"; a="407967839" X-IronPort-AV: E=Sophos;i="6.02,231,1688454000"; d="scan'208";a="407967839" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2023 21:18:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10824"; a="831483414" X-IronPort-AV: E=Sophos;i="6.02,231,1688454000"; d="scan'208";a="831483414" Received: from chenyu-dev.sh.intel.com ([10.239.62.164]) by FMSMGA003.fm.intel.com with ESMTP; 05 Sep 2023 21:18:45 -0700 From: Chen Yu To: "Rafael J. Wysocki" , Len Brown , Pavel Machek Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Chenzhou Feng , Pengfei Xu , Chen Yu Subject: [PATCH v2 0/2] Fix the hibernation test_resume's swapfile open mode Date: Wed, 6 Sep 2023 12:18:27 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Fix the regression brought by commit 5904de0d735b ("PM: hibernate: Do not get block device exclusively in test_resume mode"), which incorrectly open the swapfile in a wrong mode, and causes unexpected behavior during non-hibernation operation. Fix it by really disabling exclusive mode under test_resume. This is the v2 of the fix for a hibernation test_resume swapfile open issue. Chenzhou found that v1 has a warning during the stress test. It was due to broken open mode in swsusp_write(), fixes it in v2. patch 1 is a renaming of the function parameter, to better reflects the swap device open mode. patch 2 is to fix the open mode on the swap device. v1: https://lore.kernel.org/lkml/20230823161329.7348-1-yu.c.chen@intel.com/ Chen Yu (2): PM: hibernate: Rename the function parameter from snapshot_test to exclusive PM: hibernate: Fix the exclusive get block device in test_resume mode kernel/power/hibernate.c | 12 ++++++------ kernel/power/power.h | 4 ++-- kernel/power/swap.c | 14 ++++++++------ 3 files changed, 16 insertions(+), 14 deletions(-)