On Thu, 29 Nov 2018 08:32:47 -0800, Bart Van Assche wrote:

> > +   unsigned char buf[INQUIRY_VENDOR_LEN + 1];
> > +
> > +   if (strlen(page) > INQUIRY_VENDOR_LEN) {
> > +           pr_err("Emulated T10 Vendor Identification exceeds"
> > +                   " INQUIRY_VENDOR_LEN: " __stringify(INQUIRY_VENDOR_LEN)
> > +                   "\n");
> > +           return -EOVERFLOW;
> > +   }  
> 
> Does this force users to use "echo -n" to configure vendor IDs that are
> INQUIRY_VENDOR_LEN bytes long?

It does. As mentioned in v3, this follows the convention used in
target_wwn_vpd_unit_serial_store(). I don't feel too strongly about it,
but it does make buf allocation a little less error prone IMO.

Cheers, David

Reply via email to