aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rename.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-02-06 12:45:27 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-03-20 21:29:32 -0400
commit8de52778798fe39660a8d6b26f290e0c93202761 (patch)
tree56384beb7863c1f338f2b66b509bf58eea5a99c2 /fs/xfs/xfs_rename.c
parentc16fa4f2ad19908a47c63d8fa436a1178438c7e7 (diff)
vfs: check i_nlink limits in vfs_{mkdir,rename_dir,link}
New field of struct super_block - ->s_max_links. Maximal allowed value of ->i_nlink or 0; in the latter case all checks still need to be done in ->link/->mkdir/->rename instances. Note that this limit applies both to directoris and to non-directories. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/xfs/xfs_rename.c')
-rw-r--r--fs/xfs/xfs_rename.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index 866de277079a..e44ef7ee8ce8 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -118,17 +118,6 @@ xfs_rename(
118 new_parent = (src_dp != target_dp); 118 new_parent = (src_dp != target_dp);
119 src_is_directory = S_ISDIR(src_ip->i_d.di_mode); 119 src_is_directory = S_ISDIR(src_ip->i_d.di_mode);
120 120
121 if (src_is_directory) {
122 /*
123 * Check for link count overflow on target_dp
124 */
125 if (target_ip == NULL && new_parent &&
126 target_dp->i_d.di_nlink >= XFS_MAXLINK) {
127 error = XFS_ERROR(EMLINK);
128 goto std_return;
129 }
130 }
131
132 xfs_sort_for_rename(src_dp, target_dp, src_ip, target_ip, 121 xfs_sort_for_rename(src_dp, target_dp, src_ip, target_ip,
133 inodes, &num_inodes); 122 inodes, &num_inodes);
134 123