Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp885988ybt; Tue, 7 Jul 2020 02:41:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1S8eoIOOV2/JFbEYC7U9AZFrnBI1py0HzPk7+k0kG5jhHgCeTR4R/6XQdvH7eq3TPbkWd X-Received: by 2002:a05:6402:203a:: with SMTP id ay26mr48327061edb.276.1594114903156; Tue, 07 Jul 2020 02:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594114903; cv=none; d=google.com; s=arc-20160816; b=a3HuIvNleYF0QMPslidITsEyI/nntIJJZ7aJbgL63jovAcPCp/eyDCsux8uYiQv+ln gOpYalmwVblkX5p/iY/6QV4ycjErMFgZ6jV9KuRPQkgGi0Xkwi36sSTjyIruVQ8C9lzT MQQTyK4asVWvLVle0Ew3TqB4kAf6TjdKkyic5o9lNi0IS6dmurdXIYrGyx0CZvmQUjQB AWb3i4HYBsu8UHKmqDeOPaLiY7+5olRSewSfW3hteBW85UkfHamgncZ9k++Q7nOvWHe8 nDStkC7xX9I9wcqlmaBtzPva+Hg1nFA1k4pogntNDI8A52wYhTTaNdS14MRt5qtkU9sX z03A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ehd6XleqaBn5WZPTFzFlaKuSC92ghqAOu7hdjCyKU2A=; b=t3hJr1yE2YIYPidPyG9qzag0oDld3VG7AscWNLxiIfCqS8B0CQR61hgVfxsVVWsUwe dsnK0wQgpqDMlIbPWtP5kg7mBAQDlEQ+4DQf8HufwSxCkGa3Y38EBw9A/DhaWl+5Svrd TPL/6Zy7WHH5i/YgUdZ/R+0JBuWjnCtABC7AAqgh0J+aHXChXvcTSdGybnJEqqezVLDP ZiZ1yY2S2tmiHFgIZQL0OyWn6tCJ6+zgyOpk0twwmfWsGteZ07PH6E5uhpyadAic2ZEl ABl46wER0KvY26lR39GNDi1SmRNucYqR4cp6m1wgw/7p/csJ46cbXDNYbLLwhQKABsMC wyzQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx23si14497845ejb.273.2020.07.07.02.41.19; Tue, 07 Jul 2020 02:41:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbgGGJi4 (ORCPT + 99 others); Tue, 7 Jul 2020 05:38:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:47784 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbgGGJi4 (ORCPT ); Tue, 7 Jul 2020 05:38:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B7BE1AB3D; Tue, 7 Jul 2020 09:38:55 +0000 (UTC) Subject: Re: [PATCH v2 2/3] xen/privcmd: Mark pages as dirty To: Souptick Joarder , boris.ostrovsky@oracle.com, sstabellini@kernel.org Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, John Hubbard , Paul Durrant References: <1594059372-15563-1-git-send-email-jrdr.linux@gmail.com> <1594059372-15563-3-git-send-email-jrdr.linux@gmail.com> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: <8fdd8c77-27dd-2847-7929-b5d3098b1b45@suse.com> Date: Tue, 7 Jul 2020 11:38:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <1594059372-15563-3-git-send-email-jrdr.linux@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06.07.20 20:16, Souptick Joarder wrote: > 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]); With put_page() directly following I think you should be able to use set_page_dirty() instead, as there is obviously a reference to the page existing. > put_page(pages[i]); > + } > } > > static long privcmd_ioctl_dm_op(struct file *file, void __user *udata) > Juergen