[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yg4/fTrGdK1OYai/@kroah.com>
Date: Thu, 17 Feb 2022 13:28:45 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Xiaoguang Wang <xiaoguang.wang@...ux.alibaba.com>
Cc: Guixin Liu <kanie@...ux.alibaba.com>, bostroesser@...il.com,
martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
target-devel@...r.kernel.org, linux-kernel@...r.kernel.org,
xlpang@...ux.alibaba.com
Subject: Re: [PATCH 2/2] scsi:target:tcmu: reduce once copy by using uio ioctl
On Thu, Feb 17, 2022 at 07:13:07PM +0800, Xiaoguang Wang wrote:
> hi,
>
> > On Thu, Feb 17, 2022 at 10:29:22AM +0800, Guixin Liu wrote:
> > > --- a/include/uapi/linux/target_core_user.h
> > > +++ b/include/uapi/linux/target_core_user.h
> > > @@ -185,4 +185,13 @@ enum tcmu_genl_attr {
> > > };
> > > #define TCMU_ATTR_MAX (__TCMU_ATTR_MAX - 1)
> > > +struct tcmu_data_xfer {
> > > + unsigned short cmd_id;
> > > + unsigned long iov_cnt;
> > > + struct iovec __user *iovec;
> > > +};
> > That is no way to define a structure that crosses the user/kernel
> > boundry, it just will not work at all, even if we wanted it to :(
> Sorry, I don't quite understand your comments well, can you explain more why
> this structure
> does not work, except that "unsigned short" or "unsigned long" here isn't
> correct, should use
> u16 or u32.
__u32 and __u16 must be used for structures like this. Also it's
unaligned and has a hole in it, and will cause problems with compilers.
You didn't try this on a 32/64bit system either :(
thanks,
greg k-h
Powered by blists - more mailing lists