Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7401478ybp; Wed, 16 Oct 2019 08:08:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxovDFbvrSjp5hNAdviCq7RvsK4cYIi5oorKpvIn1/UNKobdIUfCLhzyJyhXOdXWQ/BX/dJ X-Received: by 2002:a17:906:e82:: with SMTP id p2mr40067332ejf.237.1571238520187; Wed, 16 Oct 2019 08:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571238520; cv=none; d=google.com; s=arc-20160816; b=NG/btM1fQpzbRGBTOPu17SqW5g5Mi1fNzIB28g7m7kVbnQD8bhC413TS0Y9GR3xq8e ZMNENenxKTpx7NlePi+F2JyP6Bqn3aqdvV592LsjMVwNgOBcpZ2RYsTM4DyOphWRmtx5 VrdEwRWAzjV1N+BgyMJF7se0y8eM03HAxKjPtHdNQZIKc1HYX92gVoWNOGM9Y8d3eAte 4Esty9T48gkPho8gGbJ0Pq3L6RhW8bS7F872aTdYxJUVIXzHkCcwxbyY7Sbh6qrs75wM LcU6wcelVGPsYPVsHsGFKcFBTQQsiHyLpDlLDD2gaiIKCLQzHlSm/2SVVYa3OQgzMxVD JJkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=iFLLQScTxl1Kxv46iUCfFAsgppvcBNhe7F96dYnGJQ4=; b=NVgAHemXk5fJAQhbgTmhaXtusXB6Mp+Ev3cLI1ypw6hKwEcHsT+Sg4uqLp23qhyVpO TkICUEN1wPYBvDlZDb+NbkJcQdtqo+90ENEDJiuPPa32g9cRhWd6G4JT0+UeQzOVcfjj 9QbZr0oosGxxYHVN8bq4q0ruWSM6ZLBQ44paXBkm67GkFmOFUl6KJYaFO/+72pYFJYRt WRRlNuvy8EDmFd4RsvB+M3EvFMxu174o02MptX+Cj+C3F4ls7GLj6q7R1UJP0cg3at+c LW0DntjKnV2lMsUN2z7EiElw2YTDxj8kEvxEA7HdssrQgV+7SxkGdS6A6D7ak5HtAqoG zOCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M6eTKyA9; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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. [209.132.180.67]) by mx.google.com with ESMTP id o14si14993450ejc.421.2019.10.16.08.08.08; Wed, 16 Oct 2019 08:08:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M6eTKyA9; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 S1732465AbfJPLwj (ORCPT + 99 others); Wed, 16 Oct 2019 07:52:39 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:39554 "EHLO mail-wm1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728515AbfJPLwJ (ORCPT ); Wed, 16 Oct 2019 07:52:09 -0400 Received: by mail-wm1-f54.google.com with SMTP id v17so2425604wml.4; Wed, 16 Oct 2019 04:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iFLLQScTxl1Kxv46iUCfFAsgppvcBNhe7F96dYnGJQ4=; b=M6eTKyA9F9F7Kqy+qseqIK+ejOB+jYYhW3znesf9bpLgfDbAv7iRDzuSiVE8G4kyLj v2w4chGyfNM9SE7SYpZ1fMigJPR7Xgu6OmS/g/2/MRuIWA93cCPQHZ9sa3tfSFOMj2hG R/cDGX3Me8iWggaGjAA5CXzSf5UyiioXmkzSN8J8gO8pQ554oUcVCeoPkEp3lXraR2Cz A+Wp0vTJIQTd31oNYsnSfsRxeaD8FGvGzDkbMgKhpCKc2OvQ7vWs61wFrq95mBU45hwG NBwgdVQLiTL8pL85a+DHDJ/KHTNvT45oAAzqR1oeSnlvxQbWCO4xqAJ1Do735N+ZzfOS V8Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iFLLQScTxl1Kxv46iUCfFAsgppvcBNhe7F96dYnGJQ4=; b=kUu79M/0kc/eaEqTTu5eUglMD3k+o+IeT9PpKoqmOvdpdb9SEm+9ACc6v1vMWyPwcA BYQEhVatbd5U4h+IdGvEqUIVLu722OZ5Frh89tNRH3RVM2FvPZkHtZHgYOzD9LJSluAX rFDu1qagvicqk7jJMbCVB0SvXHUIVCMK1jmhz+fMdZCJc7ZqWLA1vJeZT853HMdTwU1G eXeFJKDY+v+nAqy2EYyyT7MAuCWsCBmn3o4AVoYnsO5DSoTgIPMnAxB/LceP7fNV2eah oZ542P1fdEjtae+LJ4AeyndBEYYIpGeO132ekvKrwW6l6RTjZI83KL9PXX/mm8G4ncli 7YcA== X-Gm-Message-State: APjAAAXetMA23ZdERVWeDUa9OHhEKecdf2sB41ilXisYyDLhSj9kOhtM PBmufbO7SWGc+s5H3VhGEnEYqxqM9rLpz8nC9yKYxA== X-Received: by 2002:a1c:f00a:: with SMTP id a10mr3194598wmb.89.1571226726484; Wed, 16 Oct 2019 04:52:06 -0700 (PDT) MIME-Version: 1.0 References: <20191013164124.GR13108@magnolia> In-Reply-To: <20191013164124.GR13108@magnolia> From: Wang Shilong Date: Wed, 16 Oct 2019 19:51:15 +0800 Message-ID: Subject: Re: [Project Quota]file owner could change its project ID? To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Ext4 Developers List , Andreas Dilger , Li Xi , Wang Shilong Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Oct 14, 2019 at 12:41 AM Darrick J. Wong wrote: > > On Sat, Oct 12, 2019 at 02:33:36PM +0800, Wang Shilong wrote: > > Steps to reproduce: > > [wangsl@localhost tmp]$ mkdir project > > [wangsl@localhost tmp]$ lsattr -p project -d > > 0 ------------------ project > > [wangsl@localhost tmp]$ chattr -p 1 project > > [wangsl@localhost tmp]$ lsattr -p -d project > > 1 ------------------ project > > [wangsl@localhost tmp]$ chattr -p 2 project > > [wangsl@localhost tmp]$ lsattr -p -d project > > 2 ------------------ project > > [wangsl@localhost tmp]$ df -Th . > > Filesystem Type Size Used Avail Use% Mounted on > > /dev/sda3 xfs 36G 4.1G 32G 12% / > > [wangsl@localhost tmp]$ uname -r > > 5.4.0-rc2+ > > > > As above you could see file owner could change project ID of file its self. > > As my understanding, we could set project ID and inherit attribute to account > > Directory usage, and implement a similar 'Directory Quota' based on this. > > So the problem here is that the admin sets up a project quota on a > directory, then non-container users change the project id and thereby > break quota enforcement? Dave didn't sound at all enthusiastic, but I'm > still wondering what exactly you're trying to prevent. Yup, we are trying to prevent no-root users to change their project ID. As we want to implement 'Directory Quota': If non-root users could change their project ID, they could always try to change its project ID to steal space when EDQUOT returns. Yup, if mount option could be introduced to make this case work, that will be nice. > > (Which is to say, maybe we introduce a mount option to prevent changing > projid if project quota *enforcement* is enabled?) > > --D >