public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* XFS with project quota under linux?
@ 2007-06-04  8:55 Jahnke, Steffen
  2007-06-05 23:20 ` David Chinner
  2007-06-13  2:53 ` Donald Douwsma
  0 siblings, 2 replies; 3+ messages in thread
From: Jahnke, Steffen @ 2007-06-04  8:55 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: Type: text/plain, Size: 1885 bytes --]

I recently switched the quota usrquota to pquota on our Altix 4700 under SLES10. I then found out that the project quota is not updated if files are moved within the same filesystem. E.g. if I move a file from a different project to a new project it still belongs to the old project. The same thing happens if I move a file which not belongs to any project but which is on the filesystem mounted with pquota.

Some details of our system:

hdhu0250:/home/t # cat /etc/*release
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-ia64:core-3.0-ia64"
SGI ProPack 5SP1 for Linux, Build 501r2-0703010508
SUSE Linux Enterprise Server 10 (ia64)
VERSION = 10

hdhu0250:/home/t # uname -a
Linux hdhu0250 2.6.16.27-0.9-default #1 SMP Tue Feb 13 09:35:18 UTC 2007 ia64 ia64 ia64 GNU/Linux

hdhu0250:/home # rpm -qa |grep xfs
xfsdump-2.2.33-12.2
xfsprogs-2.7.11-18.2

Any help would be very appreciated. Maybe there is a developer version which is already to be able to handle pquota correctly??


Mit freundlichen Grüßen  /  Best regards

Steffen Jahnke

-------------------------------------------------------------------------------
Voith Siemens Hydro Power Generation GmbH & Co. KG
VSEC-International - tts
Alexanderstrasse 11
89522 Heidenheim, Germany

Tel +49 7321 37 2955
Fax +49 7321 37 7601

E-Mail steffen.jahnke@vs-hydro.com
Internet http://www.voithsiemens.com
-------------------------------------------------------------------------------
Handelsregister:  Reg. Gericht Ulm, HRA 661052
Sitz der Gesellschaft: Heidenheim
Geschäftsführung:
Dr. Hermut Kormann (Vorsitzender), Dr. Hermann Jung, 
Dr. Hans-Peter Sollinger, Dr. Hubert Lienhard, Peter Edelmann,
Martin Hennerici, Bertram Staudenmaier, Dr. Roland Münch
Persönlich haftende Gesellschafterin:
J. M. Voith Verwaltungs GmbH
Reg. Gericht Ulm, HRB 661225
 <<Jahnke, Steffen.vcf>> 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Jahnke, Steffen.vcf --]
[-- Type: text/x-vcard; name="Jahnke, Steffen.vcf", Size: 355 bytes --]

BEGIN:VCARD
VERSION:2.1
N:Jahnke;Steffen
FN:Jahnke, Steffen
ORG:VSH;tts
TEL;WORK;VOICE:+49 7321 37 2955
ADR;WORK:;tts;Alexanderstraße 11;Heidenheim;;89522;Germany
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:tts=0D=0AAlexanderstra=DFe 11=0D=0AHeidenheim 89522=0D=0AGermany
EMAIL;PREF;INTERNET:Steffen.Jahnke@vs-hydro.com
REV:20070412T113705Z
END:VCARD

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: XFS with project quota under linux?
  2007-06-04  8:55 XFS with project quota under linux? Jahnke, Steffen
@ 2007-06-05 23:20 ` David Chinner
  2007-06-13  2:53 ` Donald Douwsma
  1 sibling, 0 replies; 3+ messages in thread
From: David Chinner @ 2007-06-05 23:20 UTC (permalink / raw)
  To: Jahnke, Steffen; +Cc: xfs

On Mon, Jun 04, 2007 at 10:55:35AM +0200, Jahnke, Steffen wrote:
> I recently switched the quota usrquota to pquota on our Altix 4700 under
> SLES10. I then found out that the project quota is not updated if files are
> moved within the same filesystem. E.g. if I move a file from a different
> project to a new project it still belongs to the old project. The same thing
> happens if I move a file which not belongs to any project but which is on
> the filesystem mounted with pquota.

Working as designed, by the sounds of it. Moving a file around
the filesystem does not change the project it is assigned to.
Files created (i.e. moved into the filesystem) get assigned a
new project id on create which is why there is different behaviour
there.

Are you trying to use directory quotas here rather than just
plain project quotas?

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: XFS with project quota under linux?
  2007-06-04  8:55 XFS with project quota under linux? Jahnke, Steffen
  2007-06-05 23:20 ` David Chinner
@ 2007-06-13  2:53 ` Donald Douwsma
  1 sibling, 0 replies; 3+ messages in thread
From: Donald Douwsma @ 2007-06-13  2:53 UTC (permalink / raw)
  To: Jahnke, Steffen; +Cc: xfs

Jahnke, Steffen wrote:
> I recently switched the quota usrquota to pquota on our Altix 4700 under SLES10. 
> I then found out that the project quota is not updated if files are moved within 
> the same filesystem. E.g. if I move a file from a different project to a new project 
> it still belongs to the old project. The same thing happens if I move a file which not 
> belongs to any project but which is on the filesystem mounted with pquota.
> 
> Some details of our system:
> 
> hdhu0250:/home/t # cat /etc/*release
> LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-ia64:core-3.0-ia64"
> SGI ProPack 5SP1 for Linux, Build 501r2-0703010508
> SUSE Linux Enterprise Server 10 (ia64)
> VERSION = 10

Hi Steffen,

I've checked and Nathan fixed this bug back in January. The fix is in
mainline and will ship in Sles10sp1 when it releases.

 > Any help would be very appreciated. Maybe there is a developer version
 > which is already to be able to handle pquota correctly?

If you're not able to upgrade to sp1 but don't mind rebuilding the kernel.
the following patch will solve your problem.

Donald


Date: Mon, Jan 15 2007 14:32:14 +1100
Subject: Fix a project quota space accounting leak on rename.

===========================================================================
Index: xfs_rename.c
===========================================================================

--- a/fs/xfs/xfs_rename.c       2007-01-15 14:32:15.000000000 +1100
+++ b/fs/xfs/xfs_rename.c       2007-01-15 14:32:15.000000000 +1100
@@ -316,6 +316,18 @@ xfs_rename(
                 }
         }

+       /*
+        * If we are using project inheritance, we only allow renames
+        * into our tree when the project IDs are the same; else the
+        * tree quota mechanism would be circumvented.
+        */
+       if (unlikely((target_dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) &&
+                    (target_dp->i_d.di_projid != src_ip->i_d.di_projid))) {
+               error = XFS_ERROR(EXDEV);
+               xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED);
+               goto rele_return;
+       }
+
         new_parent = (src_dp != target_dp);
         src_is_directory = ((src_ip->i_d.di_mode & S_IFMT) == S_IFDIR);


===========================================================================
Index: xfs_vnodeops.c
===========================================================================

--- a/fs/xfs/xfs_vnodeops.c     2007-01-15 14:32:15.000000000 +1100
+++ b/fs/xfs/xfs_vnodeops.c     2007-01-15 14:32:15.000000000 +1100
@@ -2663,7 +2663,7 @@ xfs_link(
          */
         if (unlikely((tdp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) &&
                      (tdp->i_d.di_projid != sip->i_d.di_projid))) {
-               error = XFS_ERROR(EPERM);
+               error = XFS_ERROR(EXDEV);
                 goto error_return;
         }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-06-13  2:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-04  8:55 XFS with project quota under linux? Jahnke, Steffen
2007-06-05 23:20 ` David Chinner
2007-06-13  2:53 ` Donald Douwsma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox