public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Donald Douwsma <donaldd@sgi.com>
To: "Jahnke, Steffen" <Steffen.Jahnke@vs-hydro.com>
Cc: xfs@oss.sgi.com
Subject: Re: XFS with project quota under linux?
Date: Wed, 13 Jun 2007 12:53:57 +1000	[thread overview]
Message-ID: <466F5C45.6040306@sgi.com> (raw)
In-Reply-To: <950DD867A5E1B04ABE82A56FCDC03A5E9CE8CF@HDHS0111.euro1.voith.net>

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;
         }

      parent reply	other threads:[~2007-06-13  2:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=466F5C45.6040306@sgi.com \
    --to=donaldd@sgi.com \
    --cc=Steffen.Jahnke@vs-hydro.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