On Mon, 17 Feb 2014 12:00:00 +0900 (JST), Ryusuke Konishi wrote:
> Hi Andreas,
> On Sat, 15 Feb 2014 14:34:25 +0100, Andreas Rohner wrote:
>> +        segnum >= nilfs->ns_nsegments ||
> 
> This is bad too, because userland programs usually don't know the
> segment structure of NILFS.  When we specify the partition size to
> range->len, FITRIM can fail due to this check.
> 
> The upper limit of (range->start + range->len) should be
> the block device size.

I mistook for this.  segnum was the start segment number, so what
we should do was:

 - Return -EINVAL in ioctl side if range->start is larger than the
   block device size.
 - Escape this function without an error setting range->len to zero if
   segnum >= nilfs->ns_nsegments.

And, range->len should not be limited by the device size because it is
set to ULLONG_MAX by default.  We have to accept larger range->len
values.

Regards,
Ryusuke Konishi
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to