linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Jan Kara <jack@suse.cz>
Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
	Andy Lutomirski <luto@amacapital.net>,
	Li Xi <pkuelelixi@gmail.com>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	Linux API <linux-api@vger.kernel.org>,
	Theodore Ts'o <tytso@mit.edu>, Andreas Dilger <adilger@dilger.ca>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>,
	dmonakhov@openvz.org, "Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [v8 4/5] ext4: adds FS_IOC_FSSETXATTR/FS_IOC_FSGETXATTR interface support
Date: Fri, 6 Feb 2015 08:05:01 +1100	[thread overview]
Message-ID: <20150205210501.GR4251@dastard> (raw)
In-Reply-To: <20150205163815.GK4258@quack.suse.cz>

On Thu, Feb 05, 2015 at 05:38:15PM +0100, Jan Kara wrote:
>   Hello,
> 
> > Users have *always* been allowed to set the project ID of
> > their own files. How else are they going to set the project ID on
> > files they create in random directories so to account them to the
> > correct project they are working on?
> > 
> > However, you keep making the assumption that project quotas ==
> > directory subtree quotas.  Project quotas are *not limited* to
> > directory subtrees - the subtree quota implementation is just an
> > implementation that *sets the default project ID* on files as they
> > are created.
> > 
> > e.g. there are production systems out there where project quotas are
> > used to track home directory space usage rather than user quotas.
> > This means users can take actions like "this file actually belongs
> > to project X and it shouldn't be accounted against my home
> > directory". Users can create their own sub directories that account
> > everything by default to project X rather than their own home
> > directory.
> > 
> > Again: project quotas are an *accounting* mechanism, not a security
> > mechanism.
>   OK, but now I got confused ;) So if users can change project ID of files
> they own, what's the point of project quotas? If I need to create a file
> and project quota doesn't allow me, I just set its project ID to some
> random number and I'm done with that...

Sure, but the admin is going to notice those random numbers in the
next quota report they run and then a user is going to get
re-educated with a clue bat.

> So are really project quotas just
> "advisory" - i.e., all users of a system cooperate so that project X
> doesn't use more space than it should (and project quotas make this
> cooperation somewhat simpler) or is there something which limits which
> project IDs user can set? I didn't find anything...

Not directly.  Project quotas have historically been used in tandem
with user quotas - user quotas cannot be escaped and that puts a
limit on the shenanigans that users can play with project quota.

[ Indeed, Irix only had user and project quotas - it *never* had group
quotas. e.g. when XFS was ported to Linux the project quota inode
was re-purposed for group quotas in 2001:

http://oss.sgi.com/cgi-bin/gitweb.cgi?p=archive/xfs-import.git;a=commitdiff;h=749b2bf3ed5ff064efd69370e6b31ea44c4a78a6
]

However, if you have a fileystem system that users can't directly
access (e.g. an NFS server) then you can use project quotas as a
space enforcement mechanism because users can't change the project
ID on the files on the server. We've used the same model with
containers - for the host to be able to use project quotas as space
resource controller, users inside a container must not be able to
change the project ID of a file....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2015-02-05 21:05 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09  5:22 [v8 0/5] ext4: add project quota support Li Xi
2014-12-09  5:22 ` [v8 1/5] vfs: adds general codes to enforces project quota limits Li Xi
2014-12-09  5:22 ` [v8 2/5] ext4: adds project ID support Li Xi
2015-01-07 23:11   ` Andreas Dilger
2015-01-08  8:51     ` Jan Kara
2015-01-15  7:52     ` Li Xi
     [not found]   ` <1418102548-5469-3-git-send-email-lixi-LfVdkaOWEx8@public.gmane.org>
2015-01-08  8:26     ` Jan Kara
2015-01-08 22:20       ` Andreas Dilger
2015-01-09  9:47         ` Jan Kara
     [not found]           ` <20150109094758.GA2576-+0h/O2h83AeN3ZZ/Hiejyg@public.gmane.org>
2015-01-09 23:46             ` Dave Chinner
2015-01-12 17:01               ` Jan Kara
2014-12-09  5:22 ` [v8 3/5] ext4: adds project quota support Li Xi
2015-01-06 20:01   ` Andreas Dilger
2015-01-06 21:52     ` Jan Kara
2014-12-09  5:22 ` [v8 4/5] ext4: adds FS_IOC_FSSETXATTR/FS_IOC_FSGETXATTR interface support Li Xi
2014-12-09 22:57   ` Dave Chinner
2015-01-22 15:20     ` Konstantin Khlebnikov
2015-01-22 15:59       ` Jan Kara
2015-01-22 18:35         ` Konstantin Khlebnikov
     [not found]         ` <20150122155900.GB3062-+0h/O2h83AeN3ZZ/Hiejyg@public.gmane.org>
2015-01-23  1:39           ` Dave Chinner
2015-01-22 15:28   ` Konstantin Khlebnikov
     [not found]     ` <54C11733.7080801-XoJtRXgx1JseBXzfvpsJ4g@public.gmane.org>
2015-01-23  1:53       ` Dave Chinner
2015-01-23 11:58         ` Konstantin Khlebnikov
2015-01-23 23:30           ` Dave Chinner
2015-01-23 23:59             ` Andy Lutomirski
     [not found]               ` <CALCETrXPCrOTrkoAMuW2os=z6anaEfv4F4D2yDxo6VtCuEtRZw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-27  8:02                 ` Dave Chinner
2015-01-27 10:45                   ` Konstantin Khlebnikov
2015-01-28  0:37                     ` Dave Chinner
2015-02-04 15:22                       ` Konstantin Khlebnikov
     [not found]                         ` <20150204225844.GA12722@dastard>
2015-02-05  9:32                           ` Konstantin Khlebnikov
2015-02-05 16:38                           ` Jan Kara
2015-02-05 21:05                             ` Dave Chinner [this message]
2015-01-28  0:45                   ` Andy Lutomirski
     [not found] ` <1418102548-5469-1-git-send-email-lixi-LfVdkaOWEx8@public.gmane.org>
2014-12-09  5:22   ` [v8 5/5] ext4: cleanup inode flag definitions Li Xi
     [not found]     ` <1418102548-5469-6-git-send-email-lixi-LfVdkaOWEx8@public.gmane.org>
2015-01-06 20:05       ` 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20150205210501.GR4251@dastard \
    --to=david@fromorbit.com \
    --cc=adilger@dilger.ca \
    --cc=dmonakhov@openvz.org \
    --cc=ebiederm@xmission.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=pkuelelixi@gmail.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).