[Stgt-devel] [Patch 2/2] Move lu_phy_attr struct into scsi_lu struct.
Mark Harvey
markh794
Thu Jun 14 06:06:12 CEST 2007
On 6/13/07, Ming Zhang <blackmagic02881 at gmail.com> wrote:
> On Wed, 2007-06-13 at 18:04 +1000, Mark Harvey wrote:
> > Re-arrange lu_phy_attr structure into scsi_lu struct.
> >
> > Signed-off-by: Mark Harvey <markh794 at gmail.com>
> >
> > diff --git a/usr/mmc.c b/usr/mmc.c
> > index a8aced5..0ac5f72 100644
> > --- a/usr/mmc.c
> > +++ b/usr/mmc.c
> > @@ -126,11 +126,11 @@ static int mmc_lu_init(struct scsi_lu *lu)
> > if (spc_lu_init(lu))
> > return -ENOMEM;
> >
> > - memcpy(lu->attrs->product_id, "VIRTUAL-CDROM", 16);
> > - lu->attrs->sense_format = 0;
> > - lu->attrs->version_desc[0] = 0x02A0; /* MMC3, no version claimed */
> > - lu->attrs->version_desc[1] = 0x0960; /* iSCSI */
> > - lu->attrs->version_desc[2] = 0x0300; /* SPC-3 */
> > + memcpy(lu->attrs.product_id, "VIRTUAL-CDROM", 16);
>
> access the memory over boundary. strncpy is better.
Cheers.
I'll get a patch together to fix very soon.
Mark Harvey
More information about the stgt
mailing list