On 07/29/2014 07:56 PM, Matthew Wilcox wrote:
> On Tue, Jul 29, 2014 at 07:37:49PM +0300, Boaz Harrosh wrote:
>> But before we are running to fix this bug. Could we please do better and 
>> just remove the support for partitions
>> all together.
>>      Since it *never* worked anyway, so probably no one needs it! Surly no 
>> one used it
> 
> I fixed this in patch 4/22 of the v8 series.  The correct place to
> handle partitioning is in the block layer, not the individual drivers
> (nor the filesystems).
> 
Sir Mathew hi

> @@ -378,10 +378,12 @@ static int brd_direct_access(struct block_device *bdev, 
> sector_t sector,
>  
>       if (!brd)
>               return -ENODEV;
> +     sector += get_start_sect(bdev);
>       if (sector & (PAGE_SECTORS-1))
>               return -EINVAL;
> +/* Check is wrong here we need to check against bdev->bd_part->nr_sects */
>       if (sector + PAGE_SECTORS > get_capacity(bdev->bd_disk))
>               return -ERANGE;
>       page = brd_insert_page(brd, sector);
>       if (!page)
>               return -ENOSPC;

you mean you fixed the brd_direct_access() hunk by pointing all users to a 
wrapper
that does the proper offsetting, sure.

But that is not the main bug I was talking about, the main BUG is that 
partitions are
not supported at all because of the clubber of *part in brd_probe()

> @@ -558,7 +564,8 @@ static struct kobject *brd_probe(dev_t dev, int *part, 
> void *data)
>       kobj = brd ? get_disk(brd->brd_disk) : NULL;
>       mutex_unlock(&brd_devices_mutex);
>  
> -     *part = 0;
> +//   Fix the partition BUG *part comes in correctly must not need to touch it
> +//   *part = 0;
>       return kobj;
>  }

And my point is that: No one uses partitions with brd, why should we not remove 
it
all together, why fix it and keep it?

Cheers
Boaz

--
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  http://vger.kernel.org/majordomo-info.html

Reply via email to