Skip to content

Commit

Permalink
[XFS] Fix a project quota space accounting leak on rename.
Browse files Browse the repository at this point in the history
SGI-PV: 951636
SGI-Modid: xfs-linux-melb:xfs-kern:25811a

Signed-off-by: Nathan Scott <nathans@sgi.com>
  • Loading branch information
natoscott committed May 8, 2006
1 parent d08d389 commit b1ecdda
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions fs/xfs/xfs_rename.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_vnodeops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b1ecdda

Please sign in to comment.