Yes, this does appear wrong, the Irix man pages say ENAMETOOLONG as
well, but the code says EINVAL, your code should show up in the tree
before too long.
Thanks
Steve
On Mon, 2001-11-05 at 03:58, ASANO Masahiro wrote:
> Hi,
>
> When a file name is longer than 255 bytes, XFS returns with EINVAL.
> Why EINVAL? I guess it should be ENAMETOOLONG.
>
> Here is a patch.
>
> Index: linux/fs/xfs/xfs_vnodeops.c
> ===================================================================
> RCS file:
> /usr/localmnt/xfs/cvsroot/linux-2.4-xfs/linux/fs/xfs/xfs_vnodeops.c,v
> retrieving revision 1.512
> diff -u -r1.512 xfs_vnodeops.c
> --- linux/fs/xfs/xfs_vnodeops.c 2001/09/18 20:56:42 1.512
> +++ linux/fs/xfs/xfs_vnodeops.c 2001/11/05 07:11:31
> @@ -2168,7 +2168,7 @@
> dm_di_mode = vap->va_mode|VTTOIF(vap->va_type);
> namelen = strlen(name);
> if (namelen >= MAXNAMELEN)
> - return XFS_ERROR(EINVAL);
> + return XFS_ERROR(ENAMETOOLONG);
>
> if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) {
> error = xfs_dm_send_create_event(dir_bdp, name,
> @@ -3063,7 +3063,7 @@
>
> namelen = strlen(name);
> if (namelen >= MAXNAMELEN)
> - return XFS_ERROR(EINVAL);
> + return XFS_ERROR(ENAMETOOLONG);
> 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,
> NULL, DM_RIGHT_NULL,
> @@ -3363,7 +3363,7 @@
>
> target_namelen = strlen(target_name);
> if (target_namelen >= MAXNAMELEN)
> - return XFS_ERROR(EINVAL);
> + return XFS_ERROR(ENAMETOOLONG);
> /*
> * Get the real vnode.
> */
> @@ -3601,7 +3601,7 @@
>
> dir_namelen = strlen(dir_name);
> if (dir_namelen >= MAXNAMELEN)
> - return XFS_ERROR(EINVAL);
> + return XFS_ERROR(ENAMETOOLONG);
>
> tp = NULL;
> dp_joined_to_trans = B_FALSE;
> @@ -3866,7 +3866,7 @@
> return XFS_ERROR(EIO);
> namelen = strlen(name);
> if (namelen >= MAXNAMELEN)
> - return XFS_ERROR(EINVAL);
> + return XFS_ERROR(ENAMETOOLONG);
>
> if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) {
> error = dm_send_namesp_event(DM_EVENT_REMOVE,
> @@ -4221,7 +4221,7 @@
>
> link_namelen = strlen(link_name);
> if (link_namelen >= MAXNAMELEN)
> - return XFS_ERROR(EINVAL);
> + return XFS_ERROR(ENAMETOOLONG);
> /*
> * Check component lengths of the target path name.
> */
> --
> masano
--
Steve Lord voice: +1-651-683-3511
Principal Engineer, Filesystem Software email: lord@xxxxxxx
|