Linux-Fsdevel Archive on
 help / color / Atom feed
From: Dave Chinner <>
To: Wang Shilong <>
	Ext4 Developers List <>,
	Andreas Dilger <>, Li Xi <>,
	Wang Shilong <>
Subject: Re: [Project Quota]file owner could change its project ID?
Date: Sun, 13 Oct 2019 07:51:35 +1100
Message-ID: <20191012205135.GS16973@dread.disaster.area> (raw)
In-Reply-To: <>

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.

Perfectly legal to do this. Working as designed, and intended.
Project quotas have allowed this since they were introduced in the
late 1980s on Irix...

> As my understanding, we could set project ID and inherit attribute to account
> Directory usage, and implement a similar 'Directory Quota' based on this.

Yes, that is a -use- of project quotas, but not the -only- use.
Users have always been allowed to select what project their files
belong to - it's a method of accounting space even when users cannot
access all of the project information.

> But Directories could easily break this limit by change its file to
> other project ID.

Yes. But then users are using the project quotas as traditional
project quotas, which is just fine. There are users out there that
use this mix of behaviours - users have a default directory quota to
limit unbound space usage of home directories, but for files that
belong to a specific project they simply change the project ID and
now the space in their home directory those project files take up is
accounted to the project rather than the user.

> And we used vfs_ioc_fssetxattr_check() to only allow init userspace to
> change project quota:

Right, that's so directory quotas can be enforced for container
use cases, preventing the users inside a container from modifying
the project quota and escaping the space usage limit set for the
container. This means project quotas are unavailable for use
inside user namespaces as they are used for container resource usage

> Shall we have something like following to limit admin change for
> Project state too?

As per above, that will break many existing use cases for project
quotas, so I don't think we will be doing that.


Dave Chinner

  reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-12  6:33 Wang Shilong
2019-10-12 20:51 ` Dave Chinner [this message]
2019-10-13 16:41 ` Darrick J. Wong
2019-10-16 11:51   ` Wang Shilong
2019-10-16 21:22     ` Dave Chinner
2019-10-16 21:37     ` Darrick J. Wong
2019-10-17  0:28       ` Andreas Dilger
2019-10-17 12:12         ` Theodore Y. Ts'o
2019-10-20 20:19           ` Andreas Dilger
2019-10-20 22:25             ` Theodore Y. Ts'o
2019-10-21 21:15               ` Andreas Dilger
2019-10-21 23:35         ` Dave Chinner
2019-10-23 23:01           ` Andreas Dilger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191012205135.GS16973@dread.disaster.area \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Fsdevel Archive on

Archives are clonable:
	git clone --mirror linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ \
	public-inbox-index linux-fsdevel

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone