> One unrelated thing noted while reviewing:
> 
> ufs/ext2fs/ext2fs_readwrite.c:
> static int
> ext2_ind_read(struct vnode *vp, struct inode *ip, struct m_ext2fs *fs,
>     struct uio *uio)
> {
>       ...
> 
>       if (vp->v_type == VLNK) {
>               if ((int)ext2fs_size(ip) < vp->v_mount->mnt_maxsymlinklen ||
>                     ^^^^^
> 
>                   (vp->v_mount->mnt_maxsymlinklen == 0 &&
>                   ip->i_e2fs_nblock == 0))
>                       panic("%s: short symlink", "ext2fs_read");
> 
> ufs/ffs/ffs_vnops.c:
> int
> ffs_read(void *v)
> {
>       ...
>       if (vp->v_type == VLNK) {
>               if ((int)DIP(ip, size) < vp->v_mount->mnt_maxsymlinklen ||
>                   ^^^^
>                   (vp->v_mount->mnt_maxsymlinklen == 0 &&
>                    DIP(ip, blocks) == 0))
>                       panic("ffs_read: short symlink");
> 
> This code checks that the filesystem read routines are not invoked on
> symlinks where the destination path fits into the inode itself.
> We should get rid of these truncating casts in a separate diff.

I agree, the casts are wrong. Removing them would cause the compare to
be performed with u_int64_t parameters, which is IMHO the right thing to
do.

Reply via email to