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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C771AC61DA3 for ; Fri, 24 Feb 2023 16:01:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.501245.772906 (Exim 4.92) (envelope-from ) id 1pVaVq-0007B9-Lg; Fri, 24 Feb 2023 16:01:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 501245.772906; Fri, 24 Feb 2023 16:01:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pVaVq-0007B2-IT; Fri, 24 Feb 2023 16:01:34 +0000 Received: by outflank-mailman (input) for mailman id 501245; Fri, 24 Feb 2023 16:01:33 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pVaVp-0007Ar-9T for xen-devel@lists.xenproject.org; Fri, 24 Feb 2023 16:01:33 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pVaVp-0002Sg-6t; Fri, 24 Feb 2023 16:01:33 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] helo=[10.95.156.194]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pVaVp-0004NT-1d; Fri, 24 Feb 2023 16:01:33 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=95FPTHzD+3E2P5+fq2zcpOgCjxu434nv+7It7boYjBE=; b=lDUwy9Pfo5RywqUqStuC/tatNO ieMOhuWyamNSF4GCQu5aZgfmZRcj3L6csvvvX/J5trGT+6XEt0xXg6rYfImdDAXSzo2srXIXj/Xde KgHPUqayC7a7hEs5l27O9LF13LDVhuoe16FU8DtNLksKmULpk96LWfvFTAOd/V7WcLI4=; Message-ID: <3bb3e5d3-06c5-8c06-014e-5aef226b5f31@xen.org> Date: Fri, 24 Feb 2023 16:01:31 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: xenstored: Interaction bettwen SET_PERMS and transaction Content-Language: en-US To: Juergen Gross Cc: "xen-devel@lists.xenproject.org" References: <338d9214-fce4-6158-7696-bf8a7421ee9a@suse.com> From: Julien Grall In-Reply-To: <338d9214-fce4-6158-7696-bf8a7421ee9a@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Juergen, On 24/02/2023 16:00, Juergen Gross wrote: > On 24.02.23 16:00, Julien Grall wrote: >> Hi Juergen, >> >> For some internal purpose, I need to write a script that would do the >> following: >> >>    1) Start a transaction >>    2) Call GET_PERMS >>    3) Call SET_PERMS with the permission just retrieved >>    4) Commit the transaction >> >> (Don't ask why :)) >> >> This was executed from dom0 on every nodes. In some cases, we noticed >> that 4) would return -ENOSPC. >> >> When digging through the code, it looks like this is because >> transaction_fix_domains() (now called acc_fix_domains()) will check >> that the quota is correct. >> >> The domain is question were over its limit, but given this is called >> by dom0, I would have expected that it should not never return -ENOSPC >> (note that a SET_PERMS outside of a transaction would work, but this >> can't be used our case). >> >> Furthermore, the transaction is not changing any accounting. So I find >> a bit strange that we would prevent it even if this was run from an >> unprivileged domain. >> >> Do you know if this issues would be fixed by your current rework? >> >> If not, then I think we at least want to skip the quota check if the >> domain is privileged. >> >> For non-privileged domain, I am not entirely sure what to do. I was >> originally thinking to check if cd->nbentry is 0 and then skip the >> quota check. But this would allow a domain to remove a node and then >> replace by a new one (I think we still want to forbid that). >> >> What do you think? > > Patch sent. Could you please test it with your script? Thanks! I will give a try next week and let you know the result. Cheers, -- Julien Grall