summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rename.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-05-08 19:51:42 +1000
committerNathan Scott <nathans@sgi.com>2006-05-08 19:51:42 +1000
commitb1ecdda9313ec5d2f971993f44f6b657acf70cff (patch)
treea6ae6305952ad79e7e75f66598b4ba5c60146b4f /fs/xfs/xfs_rename.c
parentd08d389d5aef0509edba7ee42cd6c6a3998fee22 (diff)
downloadop-kernel-dev-b1ecdda9313ec5d2f971993f44f6b657acf70cff.zip
op-kernel-dev-b1ecdda9313ec5d2f971993f44f6b657acf70cff.tar.gz
[XFS] Fix a project quota space accounting leak on rename.
SGI-PV: 951636 SGI-Modid: xfs-linux-melb:xfs-kern:25811a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_rename.c')
-rw-r--r--fs/xfs/xfs_rename.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index 81a05cf..1f14876 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -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);
OpenPOWER on IntegriCloud