xfs
[Top] [All Lists]

Re: xfs directory quota doesn't work

To: Brian Foster <bfoster@xxxxxxxxxx>
Subject: Re: xfs directory quota doesn't work
From: Simon Xia <simonxiaomg@xxxxxxxxx>
Date: Mon, 24 Aug 2015 14:43:07 +0800
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=onKPkaseVUdMJd6ikCKOMOO1Ms5A8/l5NJG2GuZuy5Q=; b=T+TnE7LYLbghQOapfWwrsNknEpy6feM15ASnQ+hdck630JUNt97u04dN8iFSFXaeJA 6wdY/NC/C0uqAaYjE7wUHBQvE1nLZatXwASSxaYlZTiQLhQP0R4YiChutlj3eM2+YQuq lrGZB0t7/X0QrDgl5x0sYeO001U7a4UEB9gofsc7V3u5NwfoYC60Vw1PG1+QQy5n9KW4 zXdeSyCLd996qN8WkmbupMA1E45wXiZAtIEEgYHInhlycAzvkC7rkmi8as8wetjAXOJK Oz4LopH3hHsVjC8sabTMm5QRILcZyI4x0B6HN2QEF6jcyTXozn6nEfPVunlcFfphzK93 KYKA==
In-reply-to: <20150821112118.GB46372@xxxxxxxxxxxxxxx>
References: <CANX=BtYB4yoGwxz72sUN+6aSVL0fQ1JnS3PEw0zRqTbtO4_KDg@xxxxxxxxxxxxxx> <20150821112118.GB46372@xxxxxxxxxxxxxxx>
I do create two subdirectory for project

and the error maybe caused by this step:
xfs_quota -x -c 'project âc task1' /home/xiameng.xm/xfs_dir

âc - no such project in /etc/projects
Checking project task1 (path /home/xiameng.xm/xfs_dir/task1)...
/home/xiameng.xm/xfs_dir/task1 - project identifier is not set (inode=0, tree=11)
/home/xiameng.xm/xfs_dir/task1 - project inheritance flag is not set
Processed 1 /etc/projects paths for project task1

I'm a little confused about the output message, cause everything is ok in config file

2015-08-21 19:21 GMT+08:00 Brian Foster <bfoster@xxxxxxxxxx>:
On Fri, Aug 21, 2015 at 05:05:00PM +0800, Simon Xia wrote:
> hi, everyone, I encounter a problem when using xfs
>
> now I have two tasks and I wanna run them in different directory and limit
> the directoryâs size. I use xfsâs project quota to achieve this.
>
> I follow the steps from here:
> https://solidlinux.wordpress.com/2012/12/09/xfs-quota-managament/
>
> here is detail of my two config files
>
> /etc/projects:
>
> 11:/home/xiameng.xm/xfs_dir/task1
> 12:/home/xiameng.xm/xfs_dir/task2
>
> /etc/projid:
>
> task1:11
> task2:12
>
> and here is my step:
>
> touch test_xfs
> dd if=/dev/zero of=test_xfs bs=1000000 count=1
> mkfs.xfs test_xfs
>

That looks small, I can't even mkfs a file that small. I ran through
this using 'bs=1M count=100.'

> mkdir xfs_dir
> mount test_xfs ./xfs_dir -o pquota,loop
>
> xfs_quota -xc 'project âs task1' /home/xiameng.xm/xfs_dir
> xfs_quota -xc 'project âs task2' /home/xiameng.xm/xfs_dir
>

I don't see where you've created the directories yet..? I get the
following:

# xfs_quota -xc 'project -s task1' /mnt/
xfs_quota: cannot find mount point for path `/mnt/task1': No such file or directory

... until I create the task1/task2 directories. This is required because
the project quota command has to set the project id on the directory
inode. It won't work if the directory is created after this point,
regardless of whether the quota limit is specified.

Once I create those directories and run the project command, everything
seems to work. I can write up to 2MB to task1 and 10MB to task2.

Brian

> xfs_quota -x -c 'limit -p bhard=2m task1' /home/xiameng.xm/xfs_dir
> xfs_quota -x -c 'limit -p bhard=10m task2' /home/xiameng.xm/xfs_dir
>
> here is the output of xfs_quota -x -c 'report /home/xiameng.xm/xfs_dir'
>
> Project quota on /home/xiameng.xm/xfs_dir (/dev/loop1)
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Blocks
> Project ID   ÂUsed   ÂSoft   ÂHard  Warn/Grace
> ---------- --------------------------------------------------
> task1Â Â Â Â Â Â Â Â0Â Â Â Â Â 0Â Â Â Â2048Â Â Â00 [--------]
> task2Â Â Â Â Â Â Â Â0Â Â Â Â Â 0Â Â Â 10240Â Â Â00 [--------]
>
> the question is no mater how large I create a file in ./xfs_dir/task1 or
> ./xfs_dir/task2, it success!
>
> the quota limit doesnât work!
>
> Any help will be appreciated :)
>
>
> ps: I also post my question here:
> http://unix.stackexchange.com/questions/224606/xfs-directory-quota-doesnt-work
>
> ----
>
> Best Regards
> Simon Xia
> â

> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs




--
Best Regards

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