The patch titled Subject: ocfs2/o2hb: check len for bio_add_page() to avoid getting incorrect bio has been added to the -mm tree. Its filename is ocfs2-o2hb-check-len-for-bio_add_page-to-avoid-getting-incorrect-bio.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-o2hb-check-len-for-bio_add_page-to-avoid-getting-incorrect-bio.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-o2hb-check-len-for-bio_add_page-to-avoid-getting-incorrect-bio.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: piaojun <piaojun@xxxxxxxxxx> Subject: ocfs2/o2hb: check len for bio_add_page() to avoid getting incorrect bio We need to check len for bio_add_page() to make sure the bio has been set up correctly, otherwise we may submit incorrect data to device. Link: http://lkml.kernel.org/r/5ABC3EBE.5020807@xxxxxxxxxx Signed-off-by: Jun Piao <piaojun@xxxxxxxxxx> Reviewed-by: Yiwen Jiang <jiangyiwen@xxxxxxxxxx> Reviewed-by: Changwei Ge <ge.changwei@xxxxxxx> Acked-by: Joseph Qi <jiangqi903@xxxxxxxxx> Cc: Mark Fasheh <mark@xxxxxxxxxx> Cc: Joel Becker <jlbec@xxxxxxxxxxxx> Cc: Junxiao Bi <junxiao.bi@xxxxxxxxxx> Cc: Changwei Ge <ge.changwei@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ocfs2/cluster/heartbeat.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff -puN fs/ocfs2/cluster/heartbeat.c~ocfs2-o2hb-check-len-for-bio_add_page-to-avoid-getting-incorrect-bio fs/ocfs2/cluster/heartbeat.c --- a/fs/ocfs2/cluster/heartbeat.c~ocfs2-o2hb-check-len-for-bio_add_page-to-avoid-getting-incorrect-bio +++ a/fs/ocfs2/cluster/heartbeat.c @@ -570,7 +570,16 @@ static struct bio *o2hb_setup_one_bio(st current_page, vec_len, vec_start); len = bio_add_page(bio, page, vec_len, vec_start); - if (len != vec_len) break; + if (len != vec_len) { + mlog(ML_ERROR, "Adding page[%d] to bio failed, " + "page %p, len %d, vec_len %u, vec_start %u, " + "bi_sector %llu\n", current_page, page, len, + vec_len, vec_start, + (unsigned long long)bio->bi_iter.bi_sector); + bio_put(bio); + bio = ERR_PTR(-EIO); + return bio; + } cs += vec_len / (PAGE_SIZE/spp); vec_start = 0; _ Patches currently in -mm which might be from piaojun@xxxxxxxxxx are ocfs2-use-osb-instead-of-ocfs2_sb.patch ocfs2-use-oi-instead-of-ocfs2_i.patch ocfs2-clean-up-some-unused-function-declaration.patch ocfs2-dlm-dont-handle-migrate-lockres-if-already-in-shutdown.patch ocfs2-dlm-dont-handle-migrate-lockres-if-already-in-shutdown-v3.patch ocfs2-remove-unnecessary-null-pointer-check-before-kmem_cache_destroy.patch ocfs2-dlm-wait-for-dlm-recovery-done-when-migrating-all-lock-resources.patch ocfs2-o2hb-check-len-for-bio_add_page-to-avoid-getting-incorrect-bio.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html