xfs
[Top] [All Lists]

Re: Setting project quotas on special files

To: tiziano.mueller@xxxxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Subject: Re: Setting project quotas on special files
From: Jeff Liu <jeff.liu@xxxxxxxxxx>
Date: Sun, 10 Nov 2013 02:46:20 -0800 (PST)
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1384069188.245087.68.camel@storm>
References: <1384069188.245087.68.camel@storm>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
On 11/10 2013 15:39 PM, Tiziano MÃller wrote:
> Hi everyone
>
> It started with the following error:
>
>    dev # cp -al dvd dvd2
>    cp: cannot create hard link âdvd2â to âdvdâ: Invalid cross-device link
>
> "dvd" is in this case a symlink (but I also did the test with special
> devices).
This definitely would fail if you trying to create hard links across
volumes.
>
> What I did was: copy that symlink from somewhere else, trying to turn on
> project quotas on a parent directoy of that "dev" directory which gives
> me:
>
>   xfs_quota: skipping special file /var/foo/dev/dvd
symlink files will be skipped and xfs_quota consider it as special file
just like fifo, sock, etc...

If xfs_quota do check with follow symlinks, then the project id is potentially
applied to files on another filesystem. 

>
> When I examine the inode using xfs_db I get for my "dvd" symlink:
>
>   core.projid_lo = 0
>   core.projid_hi = 0
>
> When I create a new symlink "foo" (with the same uid+gid as "dvd") and
> examine it's inode using xfs_db:
>
>   core.projid_lo = 2398
>   core.projid_hi = 61
>
> What I therefore seem to encounter is the problem mentioned in xfs_quota
> for the project subcommand:
>
>   An attempt to create a hard link to a file in the tree will only succeed if 
> the project identiâ
>        fier matches the project identifier for the tree.
>
> I could now use xfs_io to fix all special files once (since newly
> created ones will carry the project id directly), but why does
> "xfs_quota -x -c 'project -s test1' /var" skip special files if it is
> clearly possible and required to set the project id on them to have
> hardlinks working again within the project dir?
Sorry if I misunderstood your question, but the existing hard link files
would
notbe skipped IMO.  For the project subcommand, it means we could not create
hardlinks cross different project trees.

Thanks,
-Jeff

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