[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 12 Dec 2019 18:34:22 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Christoph Hellwig <hch@...radead.org>
Cc: Jens Axboe <axboe@...nel.dk>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Douglas Gilbert <dgilbert@...erlog.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
y2038 Mailman List <y2038@...ts.linaro.org>,
Steffen Maier <maier@...ux.ibm.com>,
linux-scsi <linux-scsi@...r.kernel.org>,
Chaitanya Kulkarni <chaitanya.kulkarni@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-block <linux-block@...r.kernel.org>
Subject: Re: [PATCH 02/24] compat: scsi: sg: fix v3 compat read/write interface
On Thu, Dec 12, 2019 at 5:25 PM Christoph Hellwig <hch@...radead.org> wrote:
> On Wed, Dec 11, 2019 at 09:42:36PM +0100, Arnd Bergmann wrote:
> > --- a/drivers/scsi/sg.c
> > +++ b/drivers/scsi/sg.c
> > @@ -198,6 +198,7 @@ static void sg_device_destroy(struct kref *kref);
> >
> > #define SZ_SG_HEADER sizeof(struct sg_header)
> > #define SZ_SG_IO_HDR sizeof(sg_io_hdr_t)
> > +#define SZ_COMPAT_SG_IO_HDR sizeof(struct compat_sg_io_hdr)
>
> I'd rather not add more defines like this. The raw sizeof is
> much more readable and obvious.
Done. I actually had it that way in the previous submission and then changed
it for consistency. I considered removing SZ_SG_IO_HDR as well,
but decided not to make Doug's life harder than necessary -- he has nother
50 or so patches on top of this that he needs to rebase.
> I find the structure here a little confusing, as it doesn't follow
> the normal flow. What do you think of:
>
> if (count >= SZ_SG_HEADER) {
> if (get_user(reply_len, &old_hdr->reply_len))
> return -EFAULT;
I don't see much benefit either way. Changed it now it as you suggested.
Thanks for the review!
Arnd
Powered by blists - more mailing lists