Re: [PATCH 2/4] ufs: don't truncate longer ufs2 fast symlinks

From: Al Viro
Date: Wed Dec 31 2008 - 21:32:45 EST


On Wed, Dec 31, 2008 at 04:50:06PM +0000, Duane Griffin wrote:
> } else {
> - for (i = 0; i < (UFS_NDADDR + UFS_NINDIR) * 4; i++)
> + for (i = 0; i < (UFS_NDADDR + UFS_NINDIR) * 4 * 2; i++)
> ufsi->i_u1.i_symlink[i] = ufs2_inode->ui_u2.ui_symlink[i];

a) that probably ought to be a memcpy()
b) max len is superblock parameter and you've even validated it. Why don't
you use it?

> - for (i = 0; i < (UFS_NDADDR + UFS_NINDIR) * 4; i++)
> + for (i = 0; i < (UFS_NDADDR + UFS_NINDIR) * 4 * 2; i++)
> ufs_inode->ui_u2.ui_symlink[i] = ufsi->i_u1.i_symlink[i];

Ditto.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/