Commit 9ba118f5 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Christoph Hellwig

[XFS] remove superlous MAXNAMELEN checks

SGI Modid: 2.5.x-xfs:slinx:135168a
parent 3ddfdcea
...@@ -170,7 +170,6 @@ typedef struct xfs_dirent { /* data from readdir() */ ...@@ -170,7 +170,6 @@ typedef struct xfs_dirent { /* data from readdir() */
#define DEFAULT_PROJID 0 #define DEFAULT_PROJID 0
#define dfltprid DEFAULT_PROJID #define dfltprid DEFAULT_PROJID
#define MAXNAMELEN 256
#define MAXPATHLEN 1024 #define MAXPATHLEN 1024
#define FINVIS 0x0100 /* don't update timestamps - XFS */ #define FINVIS 0x0100 /* don't update timestamps - XFS */
......
...@@ -386,9 +386,6 @@ xfs_dir_lookup(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen, ...@@ -386,9 +386,6 @@ xfs_dir_lookup(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen,
int retval; int retval;
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
if (namelen >= MAXNAMELEN) {
return(XFS_ERROR(EINVAL));
}
XFS_STATS_INC(xfsstats.xs_dir_lookup); XFS_STATS_INC(xfsstats.xs_dir_lookup);
/* /*
...@@ -479,9 +476,6 @@ xfs_dir_replace(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen, ...@@ -479,9 +476,6 @@ xfs_dir_replace(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen,
int retval; int retval;
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
if (namelen >= MAXNAMELEN) {
return(XFS_ERROR(EINVAL));
}
if ((retval = xfs_dir_ino_validate(trans->t_mountp, inum))) if ((retval = xfs_dir_ino_validate(trans->t_mountp, inum)))
return retval; return retval;
......
...@@ -232,10 +232,8 @@ xfs_dir2_lookup( ...@@ -232,10 +232,8 @@ xfs_dir2_lookup(
int v; /* type-checking value */ int v; /* type-checking value */
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
if (namelen >= MAXNAMELEN) {
return XFS_ERROR(EINVAL);
}
XFS_STATS_INC(xfsstats.xs_dir_lookup); XFS_STATS_INC(xfsstats.xs_dir_lookup);
/* /*
* Fill in the arg structure for this request. * Fill in the arg structure for this request.
*/ */
...@@ -395,9 +393,7 @@ xfs_dir2_replace( ...@@ -395,9 +393,7 @@ xfs_dir2_replace(
int v; /* type-checking value */ int v; /* type-checking value */
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
if (namelen >= MAXNAMELEN) {
return XFS_ERROR(EINVAL);
}
if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) { if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) {
return rval; return rval;
} }
......
...@@ -269,11 +269,7 @@ xfs_rename( ...@@ -269,11 +269,7 @@ xfs_rename(
return XFS_ERROR(EXDEV); return XFS_ERROR(EXDEV);
} }
src_namelen = VNAMELEN(src_dentry); src_namelen = VNAMELEN(src_dentry);
if (src_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
target_namelen = VNAMELEN(target_dentry); target_namelen = VNAMELEN(target_dentry);
if (target_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
src_dp = XFS_BHVTOI(src_dir_bdp); src_dp = XFS_BHVTOI(src_dir_bdp);
target_dp = XFS_BHVTOI(target_dir_bdp); target_dp = XFS_BHVTOI(target_dir_bdp);
if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_RENAME) || if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_RENAME) ||
......
...@@ -1935,8 +1935,6 @@ xfs_create( ...@@ -1935,8 +1935,6 @@ xfs_create(
dm_di_mode = vap->va_mode|VTTOIF(vap->va_type); dm_di_mode = vap->va_mode|VTTOIF(vap->va_type);
namelen = VNAMELEN(dentry); namelen = VNAMELEN(dentry);
if (namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) { if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) {
error = dm_send_namesp_event(DM_EVENT_CREATE, error = dm_send_namesp_event(DM_EVENT_CREATE,
...@@ -2433,8 +2431,7 @@ xfs_remove( ...@@ -2433,8 +2431,7 @@ xfs_remove(
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
namelen = VNAMELEN(dentry); namelen = VNAMELEN(dentry);
if (namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) {
error = dm_send_namesp_event(DM_EVENT_REMOVE, dir_bdp, DM_RIGHT_NULL, error = dm_send_namesp_event(DM_EVENT_REMOVE, dir_bdp, DM_RIGHT_NULL,
NULL, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL,
...@@ -2668,8 +2665,6 @@ xfs_link( ...@@ -2668,8 +2665,6 @@ xfs_link(
vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address);
target_namelen = VNAMELEN(dentry); target_namelen = VNAMELEN(dentry);
if (target_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
if (src_vp->v_type == VDIR) if (src_vp->v_type == VDIR)
return XFS_ERROR(EPERM); return XFS_ERROR(EPERM);
...@@ -2857,8 +2852,6 @@ xfs_mkdir( ...@@ -2857,8 +2852,6 @@ xfs_mkdir(
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
dir_namelen = VNAMELEN(dentry); dir_namelen = VNAMELEN(dentry);
if (dir_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
tp = NULL; tp = NULL;
dp_joined_to_trans = B_FALSE; dp_joined_to_trans = B_FALSE;
...@@ -3100,8 +3093,6 @@ xfs_rmdir( ...@@ -3100,8 +3093,6 @@ xfs_rmdir(
if (XFS_FORCED_SHUTDOWN(XFS_BHVTOI(dir_bdp)->i_mount)) if (XFS_FORCED_SHUTDOWN(XFS_BHVTOI(dir_bdp)->i_mount))
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
namelen = VNAMELEN(dentry); namelen = VNAMELEN(dentry);
if (namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) {
error = dm_send_namesp_event(DM_EVENT_REMOVE, error = dm_send_namesp_event(DM_EVENT_REMOVE,
...@@ -3415,8 +3406,7 @@ xfs_symlink( ...@@ -3415,8 +3406,7 @@ xfs_symlink(
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
link_namelen = VNAMELEN(dentry); link_namelen = VNAMELEN(dentry);
if (link_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
/* /*
* Check component lengths of the target path name. * Check component lengths of the target path name.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment