Re: [PATCH] block: move sanity checking ahead of bi_front/back_seg_size updating

2017-09-19 Thread jianchao.wang
On 09/19/2017 10:36 PM, Christoph Hellwig wrote: > On Tue, Sep 19, 2017 at 08:55:59AM +0800, jianchao.wang wrote: >>> But can you elaborate a little more on how this found and if there >>> is a way to easily reproduce it, say for a blktests test case? >>> >> It is found when I made the patch of

Re: [PATCH] block: move sanity checking ahead of bi_front/back_seg_size updating

2017-09-19 Thread Christoph Hellwig
On Tue, Sep 19, 2017 at 08:55:59AM +0800, jianchao.wang wrote: > > But can you elaborate a little more on how this found and if there > > is a way to easily reproduce it, say for a blktests test case? > > > It is found when I made the patch of > 'block: consider merge of segments when merge bio

Re: [PATCH] block: move sanity checking ahead of bi_front/back_seg_size updating

2017-09-18 Thread jianchao.wang
On 09/19/2017 07:51 AM, Christoph Hellwig wrote: > On Sat, Sep 16, 2017 at 07:10:30AM +0800, Jianchao Wang wrote: >> If the bio_integrity_merge_rq() return false or nr_phys_segments exceeds >> the max_segments, the merging fails, but the bi_front/back_seg_size may >> have been modified. To avoid

Re: [PATCH] block: move sanity checking ahead of bi_front/back_seg_size updating

2017-09-18 Thread Christoph Hellwig
On Sat, Sep 16, 2017 at 07:10:30AM +0800, Jianchao Wang wrote: > If the bio_integrity_merge_rq() return false or nr_phys_segments exceeds > the max_segments, the merging fails, but the bi_front/back_seg_size may > have been modified. To avoid it, move the sanity checking ahead. > > Signed-off-by:

[PATCH] block: move sanity checking ahead of bi_front/back_seg_size updating

2017-09-15 Thread Jianchao Wang
If the bio_integrity_merge_rq() return false or nr_phys_segments exceeds the max_segments, the merging fails, but the bi_front/back_seg_size may have been modified. To avoid it, move the sanity checking ahead. Signed-off-by: Jianchao Wang --- block/blk-merge.c | 16