Subject: + zram-correct-offset-usage-in-zram_bio_discard.patch added to -mm tree To: weijie.yang@xxxxxxxxxxx,bob.liu@xxxxxxxxxx,iamjoonsoo.kim@xxxxxxx,minchan@xxxxxxxxxx,ngupta@xxxxxxxxxx,sergey.senozhatsky@xxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 22 Apr 2014 12:57:02 -0700 The patch titled Subject: zram: correct offset usage in zram_bio_discard has been added to the -mm tree. Its filename is zram-correct-offset-usage-in-zram_bio_discard.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/zram-correct-offset-usage-in-zram_bio_discard.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/zram-correct-offset-usage-in-zram_bio_discard.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: Weijie Yang <weijie.yang@xxxxxxxxxxx> Subject: zram: correct offset usage in zram_bio_discard We want to skip the logical block which is partially covered by the discard bio, so check the remaining size and subtract it if there is a need to goto the next logical block. This patch corrects the offset usage in zram_bio_discard. Signed-off-by: Weijie Yang <weijie.yang@xxxxxxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: Nitin Gupta <ngupta@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx> Cc: Bob Liu <bob.liu@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/block/zram/zram_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/block/zram/zram_drv.c~zram-correct-offset-usage-in-zram_bio_discard drivers/block/zram/zram_drv.c --- a/drivers/block/zram/zram_drv.c~zram-correct-offset-usage-in-zram_bio_discard +++ a/drivers/block/zram/zram_drv.c @@ -572,10 +572,10 @@ static void zram_bio_discard(struct zram * skipping this logical block is appropriate here. */ if (offset) { - if (n < offset) + if (n <= (PAGE_SIZE - offset)) return; - n -= offset; + n -= (PAGE_SIZE - offset); index++; } _ Patches currently in -mm which might be from weijie.yang@xxxxxxxxxxx are zram-correct-offset-usage-in-zram_bio_discard.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