public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Simon Xia <simonxiaomg@gmail.com>
Cc: xfs@oss.sgi.com
Subject: Re: xfs directory quota doesn't work
Date: Fri, 21 Aug 2015 07:21:18 -0400	[thread overview]
Message-ID: <20150821112118.GB46372@bfoster.bfoster> (raw)
In-Reply-To: <CANX=BtYB4yoGwxz72sUN+6aSVL0fQ1JnS3PEw0zRqTbtO4_KDg@mail.gmail.com>

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@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

  reply	other threads:[~2015-08-21 11:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21  9:05 xfs directory quota doesn't work Simon Xia
2015-08-21 11:21 ` Brian Foster [this message]
2015-08-24  6:43   ` Simon Xia
2015-08-24 12:02     ` Brian Foster

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=20150821112118.GB46372@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=simonxiaomg@gmail.com \
    --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