xfs
[Top] [All Lists]

[RFC] directory quota survey on xfs

To: linux-ext4@xxxxxxxxxxxxxxx
Subject: [RFC] directory quota survey on xfs
From: Zheng Liu <gnehzuil.liu@xxxxxxxxx>
Date: Sun, 22 Dec 2013 17:59:29 +0800
Cc: Theodore Ts'o <tytso@xxxxxxx>, Andreas Dilger <adilger.kernel@xxxxxxxxx>, Dmitry Monakhov <dmonakhov@xxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, Ben Myers <bpm@xxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=OjRxZTolKGRXrH3x0+fQpoiNEqSb44ESIQgJpVfnrpY=; b=naL8EeUDM1/g0gyOD4EysJk/1zK6stCXRCRmcUIUy5cKyT28KFb+c5YscWTf+0e2ir ESkJjZ75DO79LVWsx/RIxoq8ecEXzWm2QqnK1NGxU3j9nBHwYcww9dH1D21g0CzRkw2I lHsxLmb5iOqcX+ygnkE8Fvnfy4ArW/sBT1MsAqBu8iZX4mXt2Ox3nAHm6BQtwORTAm1h 3Tz7hwILYPtke7RtKKhnhwJmWO6pI3R9u/83BKHoNHMvx56CWC4CDaD1ZIiz8fPPFngh 6RwG+HvkRXGkchS1dlJjEhyt38BUwdnub+gQwXzV5RToVff+V1Vms9Hu5QcNGEbx0+im /hhw==
Mail-followup-to: linux-ext4@xxxxxxxxxxxxxxx, Theodore Ts'o <tytso@xxxxxxx>, Andreas Dilger <adilger.kernel@xxxxxxxxx>, Dmitry Monakhov <dmonakhov@xxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, Ben Myers <bpm@xxxxxxx>, xfs@xxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
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

<Prev in Thread] Current Thread [Next in Thread>