linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Xi <pkuelelixi@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"hch@infradead.org" <hch@infradead.org>,
	Andreas Dilger <adilger@dilger.ca>,
	"Niu, Yawei" <yawei.niu@intel.com>
Subject: Re: [PATCH v2 0/4] quota: add project quota support
Date: Mon, 11 Aug 2014 22:16:05 +0800	[thread overview]
Message-ID: <CAPTn0cBAYxCX0w3uiT1FLi2Nw4R+AFj2whouD4jr5tbZsFqaUw@mail.gmail.com> (raw)

>   So I actually don't think project quota as implemented by XFS (and with
> which me and Ted want to stay compatible with) isn't different from what you
> want. Let me explain what XFS does:
>   1) Each file has an additional ID - the project ID
>   2) Each dir can have XFS_DIFLAG_PROJINHERIT flag set. When this flag is
>      set, all files and directories created in the directory inherit project
>      ID, directories also inherit XFS_DIFLAG_PROJINHERIT - this is
>      equivalent of sgid bit on directories for gids.
>   3) When you hard-link a file into directory with XFS_DIFLAG_PROJINHERIT
>      set, the file already has to have the same project ID as the directory
>      you are linking into.
>   4) When you rename a file into a directory with XFS_DIFLAG_PROJINHERIT
>      set, the file already has to have the same project ID as the directory
>      you are renaming into.
>   5) If you call statfs() on a directory with XFS_DIFLAG_PROJINHERIT set
>      and project quota is being enforced, statfs() will return free/used
>      blocks of the corresponding project instead of number of free/used
>      blocks in the filesystem.
>
> Now if, as an administrator, you decide you need completely generic
> additional ID, you can do so. You just never set XFS_DIFLAG_PROJINHERIT.
> Quota accounting and enforcement works just fine without that flag.
>
> So the discussion really is about the semantics of the
> XFS_DIFLAG_PROJINHERIT flag. If you want automatic inheritance of project
> ids, you set XFS_DIFLAG_PROJINHERIT.  With that you'll get additional
> limitations described in 3) and 4). And I am of the opinion that these
> limitations help to maintain sanity in a system where project quotas are
> used. I can imagine XFS_DIFLAG_PROJINHERIT would be split in two flags
> for ext4 - one controlling whether project ID is inherited, another
> controlling whether we enforce rules 3) and 4) but such difference from XFS
> would have to be very well justified because different filesystems having
> subtly different semantics is a real administrative nightmare, much worse
> than the additional cp + unlink done when rename() returns EXDEV because
> you tried to rename from one project to another.
Thank you so much for your detailed introduction! I didn't know there
is a tunable
XFS_DIFLAG_PROJINHERIT flag and I thought that rule 3) and 4) always
took effect. I would like to keep everything compatible with XFS if
this flag can
turn on/off rule 3) and 4) freely. I will check the implement details of XFS in
case of making similar mistakes.

Regards,
Li Xi

             reply	other threads:[~2014-08-11 14:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11 14:16 Li Xi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-08-14  1:34 [PATCH v2 0/4] quota: add project quota support Li Xi
2014-08-13  2:32 Li Xi
2014-08-13 13:22 ` Theodore Ts'o
2014-08-11 15:03 Li Xi
2014-08-11 14:40 Li Xi
2014-08-11 14:45 ` Theodore Ts'o
2014-08-11 14:49   ` Li Xi
2014-08-11 10:23 Li Xi
2014-08-11 13:48 ` Theodore Ts'o
2014-08-11  0:19 Li Xi
2014-08-11  0:06 Li Xi
2014-08-10  0:38 Li Xi
2014-08-08 16:58 Li Xi
2014-08-08 16:39 Li Xi
2014-08-08 22:33 ` Theodore Ts'o
2014-08-09 14:24   ` Li Xi
2014-08-09 17:24     ` Theodore Ts'o
2014-08-09 22:17       ` Theodore Ts'o
2014-08-09 23:38         ` Dave Chinner
2014-08-10  0:09           ` Theodore Ts'o
2014-08-10 22:18             ` Dave Chinner
2014-08-10  2:15         ` Li Xi
2014-08-11 10:49           ` Jan Kara
2014-08-10  8:38         ` Shuichi Ihara
2014-08-10 16:52           ` Theodore Ts'o
2014-08-10 20:47       ` James Bottomley
2014-08-10 21:49         ` Theodore Ts'o
2014-08-09 22:14   ` Dave Chinner
2014-08-11 14:41 ` Theodore Ts'o
2014-08-12 15:35 ` Dmitry Monakhov

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=CAPTn0cBAYxCX0w3uiT1FLi2Nw4R+AFj2whouD4jr5tbZsFqaUw@mail.gmail.com \
    --to=pkuelelixi@gmail.com \
    --cc=adilger@dilger.ca \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yawei.niu@intel.com \
    /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).