xfs
[Top] [All Lists]

separate project quota from group quota (questions, design issues)

To: xfs@xxxxxxxxxxx
Subject: separate project quota from group quota (questions, design issues)
From: Arkadiusz Miskiewicz <arekm@xxxxxxxx>
Date: Sat, 4 Sep 2010 10:00:55 +0200
User-agent: KMail/1.13.5 (Linux/2.6.35-final-dirty; KDE/4.5.1; x86_64; ; )
Dave thinks that this subject should be discussed first here.

My goal is to be able to use user, group and project quota at the same time. 
Example usage is a web hosting company which gives some space for customer 
(group quota), customer splits it into accounts (user quota) and then each 
account can have multiple vhosts with own quota (project quota).

Since on-disk format keeps group and project quota separate already then why 
not making it usable for a user as separate things, too?

I started doing that by splitting every group+project handling code into 
separate group and project one. Added superblock field for project quota. New 
feature flag (SEPARATEPQUOTA).

If old filesystem (for SEPARATEQUOTA) is mounted then I'll simply load 
sb_gquotino into mp->m_sb.sb_pquotino which I think is enough to handle old fs 
(since new kernel operates on separate structures for project quota).

New filesystem (without quota inodes allocated yet), when mounted, gets new 
quota inode allocated for project quota and SEPARATEQUOTA feature bit set.

Converting old fs to separate quota isn't currently solved. User could need 
two choices - use old group quota still as group or old group as new project 
quota. Not sure how to handle these yet. 
Also, quota data is keept in extents and extents have d_flags representing 
type of quota (user/group/proj). Now what happens (in current code) with 
extents of group/project quota inode if mouting once with grpquota and once 
with projquota? Are the other extent entries ignored? (like mounted with group 
-> extents with proj type ignored or deleted or something else?). 

There is also issue with kernel generic quota interface fs_quota_stat which 
doesn't handle third quota at all. It simply won't be able to operate on 
project quota (as I guess it isn't able to do that even now).

Initial, not working yet (due to locking issues) patch is here (on top of 
projid32bit patch actually, but both features are unrelated):
http://carme.pld-linux.org/~arekm/xfs-parallel-grp-prj-quota-2.patch

My current problem is lack of understanding of locking issues here:
http://pastebin.com/brBHPavR

How locking should look like when there is also project quota? Lines 1390-1397 
and 1419-1428.

With current code as pasted on pastebin mount hangs trying to do lock on 1426 
line which was unlocked just few lines before.
-- 
Arkadiusz Miśkiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/

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