Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp363398ybt; Mon, 6 Jul 2020 11:09:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKJd18IuMBNx0e3Wq0YtbXYQ6BDt4cU+ceVVVW5hj9AZENqdtZdgX27tSJ29IJAY66r0sQ X-Received: by 2002:a17:906:40d3:: with SMTP id a19mr45794056ejk.474.1594058969276; Mon, 06 Jul 2020 11:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594058969; cv=none; d=google.com; s=arc-20160816; b=lxSBpmrIq67EtmiEAxAcHQuVn38cXxsRmckilEi1SCqXAsVautxZGP5u4kUNkuSTx0 jnmxkAv0JAYPCjmoLvJVn1vZb8tm2MprGPl1Dx4lA3B7nxolg6e9EG7s9Ep2JfoNgSzj NE6pPZ5Q7mon3mP5GnEK/zOHhmN7l2bEkKnEFKMXQajYh+IJfBqRPBdkLBpCVRhrBmLW d+U5unhXdkDNeuJyt8XdIgsbQ2UMTRd6fh3tOzBxVkyKZzB69fxBSy8uhn8MTdtUW0Cn ilAgMcly7EvaARfaUfh81H9D6+x252uzZWnohCea6T7xQrdsQgLFxTYSlWsZkqYAIDYR UA0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=lQCZlvushcOD69EcXhMHyrU/TPLV5UJPHlxcyr/r1Xg=; b=WI/Se4oeIhoCfW2zTqdU6kG4WPkU7ysu2h2JwfZI4kkDa6gJdBVSifAP7EStJocXxR pBlTK64V5Qu+7ewF5btG2cpeP2Bik1XrK6GPB52w9dEEcI1q+YDwqdLY59tzmAHDuoOm 9wbElJMyBjjBKACnIN0YCKq/mQTvKYfyQtqtHo4VMK3RAVORmXjneRWURCowDWP817Ns evaAHYtqxt7MbBF6z0HPoByAttKGdemf+F+I8upoeXys5PFAPRYyOM1pgM78XpTabpGS cooPStc0i4V7rBQZvG4RO7ZwdNMIqLOM6UtWU61h7EDci6Kt7zkyJF5HOUl3MMAYv8R9 g+IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PYmDnfr2; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m8si13337392ejq.294.2020.07.06.11.09.05; Mon, 06 Jul 2020 11:09:29 -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=@gmail.com header.s=20161025 header.b=PYmDnfr2; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729793AbgGFSIL (ORCPT + 99 others); Mon, 6 Jul 2020 14:08:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729785AbgGFSIJ (ORCPT ); Mon, 6 Jul 2020 14:08:09 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA49AC061755 for ; Mon, 6 Jul 2020 11:08:09 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id j7so2285290plk.13 for ; Mon, 06 Jul 2020 11:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lQCZlvushcOD69EcXhMHyrU/TPLV5UJPHlxcyr/r1Xg=; b=PYmDnfr2KReJ6L3ka/pFQ5TCVzJeDABsscKdIo2hVK+g6RynNJZXKJA8nKzjJjOnq0 L2VdcsAO3SDozGKprBlSPKVlFyWx7ATEpTpHPmuQpqv+2Av+4+UtEMqP4nkiI/TBFFud YrT89cUVzUAujSFRvMPiwbghNFNc5iir/1aAB3zwSpXHvBizJQ+zLqhEevq9ZGMXUgDo /5JbKtwsVXV5OZ84G6tunl9EnJlXINSomZ+kuBkCV+2h8io0Gx75UW8PzdiOGLFGAV3E N4+IHa22YZq1UWZL12+aqy8rW4h9Ghp2VSD7l8bky+RMlBK5Ez4iWmccWaS138Ltdd4F J8rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lQCZlvushcOD69EcXhMHyrU/TPLV5UJPHlxcyr/r1Xg=; b=OkpFreQGaaPlKDiuMeYD4FO1ZeR8LjpjwoIzaeJ083aRi9Ts28XUtByWZh+XpaapcW oUjYDZf+BNAYded0vcY5pKJCTKdj4vcoiDK+I2Se1nLng6nkJnFxRUGPo7Q3Rz5nGml+ qO1YrF7Q3bOvG6KmdYomr0J0mF+PqQV8yUpXqUlwLIV83/94rYPfGj6vh6ZB0rtIrqSm rdszJE7IVORrQ3pwyZaCAe7mirHAEVTPMXieX7feLWgBAWPnH01iz10GwaPuKeDQvgeB dtQJ5laByP7R3UQySBdiuTW2mWGTY3zBIAFcdqr9AnnYiyN7X6zwj8TIEDKH7RrZGfTj 7Ddw== X-Gm-Message-State: AOAM532MXOOnxKkTF8w2wuv3CLD39tBfx8/R1G2chCezOTRgyBclT5er 5HIF62R+PL9UvHqGbi86Pt8= X-Received: by 2002:a17:90a:ff92:: with SMTP id hf18mr461075pjb.10.1594058889231; Mon, 06 Jul 2020 11:08:09 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC.domain.name ([122.171.43.125]) by smtp.gmail.com with ESMTPSA id 199sm20425544pgc.79.2020.07.06.11.08.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2020 11:08:08 -0700 (PDT) From: Souptick Joarder To: boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Souptick Joarder , John Hubbard , Paul Durrant Subject: [PATCH v2 2/3] xen/privcmd: Mark pages as dirty Date: Mon, 6 Jul 2020 23:46:11 +0530 Message-Id: <1594059372-15563-3-git-send-email-jrdr.linux@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1594059372-15563-1-git-send-email-jrdr.linux@gmail.com> References: <1594059372-15563-1-git-send-email-jrdr.linux@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pages need to be marked as dirty before unpinned it in unlock_pages() which was oversight. This is fixed now. Signed-off-by: Souptick Joarder Suggested-by: John Hubbard Cc: John Hubbard Cc: Boris Ostrovsky Cc: Paul Durrant --- drivers/xen/privcmd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 33677ea..f6c1543 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -612,8 +612,11 @@ static void unlock_pages(struct page *pages[], unsigned int nr_pages) { unsigned int i; - for (i = 0; i < nr_pages; i++) + for (i = 0; i < nr_pages; i++) { + if (!PageDirty(pages[i])) + set_page_dirty_lock(pages[i]); put_page(pages[i]); + } } static long privcmd_ioctl_dm_op(struct file *file, void __user *udata) -- 1.9.1