discard request doesn't have data attached, so it's meaningless to
allocate memory and copy from original bio for behind IO. And the copy
is bogus because bio_copy_data_partial can't handle discard request.
We don't support writesame/writezeros request so far.
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Shaohua Li <shli@fb.com>
        if (!behind_bio)
                goto fail;
 
+       /* discard op, we don't support writezero/writesame yet */
+       if (!bio_has_data(bio))
+               goto skip_copy;
+
        while (i < vcnt && size) {
                struct page *page;
                int len = min_t(int, PAGE_SIZE, size);
 
        bio_copy_data_partial(behind_bio, bio, offset,
                              behind_bio->bi_iter.bi_size);
-
+skip_copy:
        r1_bio->behind_master_bio = behind_bio;;
        set_bit(R1BIO_BehindIO, &r1_bio->state);