From: Jan Kara <jack@suse.cz>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Zheng Liu <gnehzuil.liu@gmail.com>, Jan Kara <jack@suse.cz>,
linux-ext4 <linux-ext4@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
xfs@oss.sgi.com, Theodore Ts'o <tytso@mit.edu>,
Dmitry Monakhov <dmonakhov@openvz.org>,
Li Xi <pkuelelixi@gmail.com>, Dave Chinner <david@fromorbit.com>,
Ben Myers <bpm@sgi.com>
Subject: Re: [RFC] A draft for making ext4 support project quota
Date: Thu, 30 Jan 2014 20:42:24 +0100 [thread overview]
Message-ID: <20140130194224.GA22955@quack.suse.cz> (raw)
In-Reply-To: <A5AD0D66-C4F5-4177-9F87-E3BC59B348B8@dilger.ca>
On Thu 30-01-14 11:57:10, Andreas Dilger wrote:
> On Jan 28, 2014, at 8:48 PM, Zheng Liu <gnehzuil.liu@gmail.com> wrote:
> > On Tue, Jan 28, 2014 at 03:35:14PM +0100, Jan Kara wrote:
> >> On Tue 28-01-14 14:42:49, Zheng Liu wrote:
> >>> For project quota, the key issue is how to handle link(2)/rename(2). We
> >>> summarize the behaviour in xfs as following.
> >>>
> >>> *Note*
> >>> + unaccounted dir
> >>> x accounted dir
> >>>
> >>> link(2)
> >>> -------
> >>> + x
> >>> + ok error (EXDEV)
> >>> x ok error (EXDEV)
>
> Presumably this accounted-to-accounted link() is only an error if
> it is between directories of two different projects?
Yes, I understand it that way.
> >>> rename(2)
> >>> ---------
> >>> + x
> >>> + ok ok
> >>> x wrong ok
> >>
> >> So moving unaccounted file/dir into an accounted dir would be OK? How is
> >> that?
> >
> > Actually xfs will return EXDEV error when we try to move unaccounted
> > file/dir into an accounted dir. Then userspace tools (e.g. mv(1)) will
> > use create(2)/read(2)/write(2) syscalls to create these files/dirs from
> > scratch, and get the same id from their parent.
>
> Why wouldn't renaming an unaccounted file into an accounted directory
> just be implemented by doing the equivalent of chown() to change the
> project ID and setting the quota? That could avoid a HUGE amount of
> data copying for large files.
Well, the trouble is not so much with a file but with a directory. If you
move an unaccounted directory in an accounted dir, you would have to
recursively go through it and account each file. That isn't possible to do
reliably from the kernel... And allowing files but disallowing dirs seems
inconsistent so I'm in favor of a simple API.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2014-01-30 19:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 6:42 [RFC] A draft for making ext4 support project quota Zheng Liu
2014-01-28 14:35 ` Jan Kara
2014-01-29 3:48 ` Zheng Liu
2014-01-29 10:53 ` Jan Kara
2014-01-30 18:57 ` Andreas Dilger
2014-01-30 19:42 ` Jan Kara [this message]
2014-01-30 20:19 ` Dave Chinner
2014-01-29 19:20 ` Darrick J. Wong
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=20140130194224.GA22955@quack.suse.cz \
--to=jack@suse.cz \
--cc=adilger@dilger.ca \
--cc=bpm@sgi.com \
--cc=david@fromorbit.com \
--cc=dmonakhov@openvz.org \
--cc=gnehzuil.liu@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=pkuelelixi@gmail.com \
--cc=tytso@mit.edu \
--cc=xfs@oss.sgi.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).