From patchwork Mon Mar 1 16:12:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 390217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 664C7C433E0 for ; Mon, 1 Mar 2021 16:35:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C11C64FD5 for ; Mon, 1 Mar 2021 16:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231908AbhCAQfq (ORCPT ); Mon, 1 Mar 2021 11:35:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:36264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbhCAQ3f (ORCPT ); Mon, 1 Mar 2021 11:29:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A574264F53; Mon, 1 Mar 2021 16:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614615834; bh=fSi0IQR8VkifieCtuCA1OdSgP1hC6blVO0eHirRxd9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f5IPKmT/jM8KVwZAtQNRvOWZY8KKM6N89IkZxuJKrZtU1OfM+8ZrwxXsjaYepYnXT uI98CATI+fm7Am1kWaBQBG59czFtAVApYir53Y0K3h2/bGVnmRbTQKFBOLZI0ZdKM6 iyaUfA8iDRnBUrrvb/46yll+qdaqBN0bh+8P9CvY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vishnu Dasa , Jorgen Hansen , Sasha Levin Subject: [PATCH 4.9 077/134] VMCI: Use set_page_dirty_lock() when unregistering guest memory Date: Mon, 1 Mar 2021 17:12:58 +0100 Message-Id: <20210301161017.359165240@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161013.585393984@linuxfoundation.org> References: <20210301161013.585393984@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jorgen Hansen [ Upstream commit 5a16c535409f8dcb7568e20737309e3027ae3e49 ] When the VMCI host support releases guest memory in the case where the VM was killed, the pinned guest pages aren't locked. Use set_page_dirty_lock() instead of set_page_dirty(). Testing done: Killed VM while having an active VMCI based vSocket connection and observed warning from ext4. With this fix, no warning was observed. Ran various vSocket tests without issues. Fixes: 06164d2b72aa ("VMCI: queue pairs implementation.") Reviewed-by: Vishnu Dasa Signed-off-by: Jorgen Hansen Link: https://lore.kernel.org/r/1611160360-30299-1-git-send-email-jhansen@vmware.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/misc/vmw_vmci/vmci_queue_pair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c index 6ac3c59c9ae78..7c7ed3f8441ab 100644 --- a/drivers/misc/vmw_vmci/vmci_queue_pair.c +++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c @@ -732,7 +732,7 @@ static void qp_release_pages(struct page **pages, for (i = 0; i < num_pages; i++) { if (dirty) - set_page_dirty(pages[i]); + set_page_dirty_lock(pages[i]); put_page(pages[i]); pages[i] = NULL;