Re: [PATCH v2 7/7] blk-zoned: implement ioctls

2016-09-27 Thread Christoph Hellwig
On Mon, Sep 26, 2016 at 06:12:24PM -0500, Shaun Tancheff wrote: > Except our source locations are disjoint (stack and kcalloc'd). Indeed. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH v2 7/7] blk-zoned: implement ioctls

2016-09-26 Thread Shaun Tancheff
No objection here. On Mon, Sep 26, 2016 at 6:30 PM, Damien Le Moal wrote: > > Christoph, > > On 9/27/16 01:37, Christoph Hellwig wrote: >>> -/* >>> - * Zone type. >>> - */ >>> -enum blk_zone_type { >>> -BLK_ZONE_TYPE_UNKNOWN, >>> -BLK_ZONE_TYPE_CONVENTIONAL, >>> -

Re: [PATCH v2 7/7] blk-zoned: implement ioctls

2016-09-26 Thread Damien Le Moal
Christoph, On 9/27/16 01:37, Christoph Hellwig wrote: >> -/* >> - * Zone type. >> - */ >> -enum blk_zone_type { >> -BLK_ZONE_TYPE_UNKNOWN, >> -BLK_ZONE_TYPE_CONVENTIONAL, >> -BLK_ZONE_TYPE_SEQWRITE_REQ, >> -BLK_ZONE_TYPE_SEQWRITE_PREF, >> -}; > > Please don't move this code

Re: [PATCH v2 7/7] blk-zoned: implement ioctls

2016-09-26 Thread Shaun Tancheff
On Mon, Sep 26, 2016 at 11:37 AM, Christoph Hellwig wrote: >> + zones = kzalloc(sizeof(struct blk_zone) * rep.nr_zones, >> + GFP_KERNEL); >> + if (!zones) >> + return -ENOMEM; > > This should use kcalloc to get us underflow checking for

Re: [PATCH v2 7/7] blk-zoned: implement ioctls

2016-09-26 Thread Christoph Hellwig
> + zones = kzalloc(sizeof(struct blk_zone) * rep.nr_zones, > + GFP_KERNEL); > + if (!zones) > + return -ENOMEM; This should use kcalloc to get us underflow checking for the user controlled allocation size. > + if (copy_to_user(argp, , sizeof(struct

[PATCH v2 7/7] blk-zoned: implement ioctls

2016-09-26 Thread Damien Le Moal
From: Shaun Tancheff Adds the new BLKREPORTZONE and BLKRESETZONE ioctls for respectively obtaining the zone configuration of a zoned block device and resetting the write pointer of sequential zones of a zoned block device. The BLKREPORTZONE ioctl maps directly to a