The patch titled Subject: scatterlist: don't BUG when we can trivially return a proper error. has been added to the -mm tree. Its filename is scatterlist-dont-bug-when-we-can-trivially-return-a-proper-error.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/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Nick Bowler <nbowler@xxxxxxxxxxxxxxxx> Subject: scatterlist: don't BUG when we can trivially return a proper error. There is absolutely no reason to crash the kernel when we have a perfectly good return value already available to use for conveying failure status. Let's return an error code instead of crashing the kernel: that sounds like a much better plan. Signed-off-by: Nick Bowler <nbowler@xxxxxxxxxxxxxxxx> Cc: Maxim Levitsky <maximlevitsky@xxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Cc: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/scatterlist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN lib/scatterlist.c~scatterlist-dont-bug-when-we-can-trivially-return-a-proper-error lib/scatterlist.c --- a/lib/scatterlist.c~scatterlist-dont-bug-when-we-can-trivially-return-a-proper-error +++ a/lib/scatterlist.c @@ -248,7 +248,8 @@ int __sg_alloc_table(struct sg_table *ta unsigned int left; #ifndef ARCH_HAS_SG_CHAIN - BUG_ON(nents > max_ents); + if (WARN_ON_ONCE(nents > max_ents)) + return -E2BIG; #endif memset(table, 0, sizeof(*table)); _ Patches currently in -mm which might be from nbowler@xxxxxxxxxxxxxxxx are linux-next.patch scatterlist-dont-bug-when-we-can-trivially-return-a-proper-error.patch scatterlist-dont-bug-when-we-can-trivially-return-a-proper-error-fix.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