From: Zheng Liu <gnehzuil.liu@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: Theodore Ts'o <tytso@mit.edu>,
xfs@oss.sgi.com, Ben Myers <bpm@sgi.com>,
Dmitry Monakhov <dmonakhov@openvz.org>,
Andreas Dilger <adilger.kernel@dilger.ca>
Subject: [RFC] directory quota survey on xfs
Date: Sun, 22 Dec 2013 17:59:29 +0800 [thread overview]
Message-ID: <20131222095929.GA11444@gmail.com> (raw)
Hi all,
As discussed with ext4 folks, I will try to make ext4 file system support
directory quota (a.k.a., project id in xfs). For keeping consistency
with xfs's implementation, I did some tests on xfs, and I summarized the
result as following. This will help us understand what we can do and
what we can't do. Please correct me if I miss doing some tests or mis-
understand something.
I just do some tests about rename/hardlink because they are the key
issue from our discussion.
+ unaccounted dir
x accounted dir
rename(mv)
==========
+ -> +: ok
+ -> x: ok
I use strace(1) to lookup which syscall is used, and I found that xfs
will return EXDEV when mv(1) tries to use rename(2) to move a dir from
a unaccounted dir to a accounted dir. Then mv uses creat(2)/read(2)/
write(2) syscalls to move this dir.
x -> +: wrong (design by feature?)
If we move a dir from a accounted dir to a unaccounted dir, the quota is
still accounted. It seems that xfs don't remove project id from this
dir and its subdirs/files on this case.
x -> x: ok
Xfs returns EXDEV error when mv(1) uses rename(2) to move a dir from a
accounted dir to another accounted dir (These dirs have different
project ids). Then mv(1) uses creat(1)/read(1)/write(1) syscalls to
move this dir.
summary:
rename + x
+ ok ok (EXDEV)
x wrong ok (EXDEV)
hardlink(ln)
========
+ -> +: ok
+ -> x: error
Xfs also returns EXDEV error to forbid this operation. So that means
that we don't allow users to do a hardlink for a file from a unaccount
dir to a accounted dir.
x -> +: ok
This operation can be executed and no any error is reported. After that
the quota doesn't be changed. When both of two hardlinks are removed,
the quota will be discharged.
x -> x: error
Xfs returns EXDEV error to forbid this operation.
summary:
hardlink + x
+ ok error (EXDEV)
x ok error (EXDEV)
As always, any comment or idea are welcome.
Thanks,
- Zheng
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2013-12-22 9:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-22 9:59 Zheng Liu [this message]
2013-12-23 1:42 ` [RFC] directory quota survey on xfs Dave Chinner
2013-12-23 1:42 ` Dave Chinner
2013-12-23 9:12 ` Arkadiusz Miśkiewicz
2013-12-23 23:43 ` Dave Chinner
2013-12-23 23:43 ` Dave Chinner
2014-01-15 8:12 ` Zheng Liu
2014-01-15 8:12 ` Zheng Liu
2014-01-15 18:03 ` Andreas Dilger
2014-01-15 21:32 ` Dave Chinner
2014-01-21 7:07 ` Zheng Liu
2014-01-21 7:07 ` Zheng Liu
2014-01-23 22:32 ` Dave Chinner
2014-01-23 22:32 ` Dave Chinner
2014-01-24 0:06 ` Darrick J. Wong
2014-01-24 0:06 ` 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=20131222095929.GA11444@gmail.com \
--to=gnehzuil.liu@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=bpm@sgi.com \
--cc=dmonakhov@openvz.org \
--cc=linux-ext4@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.