The patch titled Subject: zram-remove-bd_cap_synchronous_io-with-writeback-feature-v2 has been added to the -mm tree. Its filename is zram-remove-bd_cap_synchronous_io-with-writeback-feature-v2.patch
This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/zram-remove-bd_cap_synchronous_io-w... and later at http://ozlabs.org/~akpm/mmotm/broken-out/zram-remove-bd_cap_synchronous_io-w...
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: Minchan Kim minchan@kernel.org Subject: zram-remove-bd_cap_synchronous_io-with-writeback-feature-v2
- description correction - Andrew - add comment about removing BDI_CAP_SYNCHRONOUS_IO
Link: https://lore.kernel.org/lkml/0516ae2d-b0fd-92c5-aa92-112ba7bd32fc@contabo.de... Link: http://lkml.kernel.org/r/20180802051112.86174-1-minchan@kernel.org Link: http://lkml.kernel.org/r/20180805233722.217347-1-minchan@kernel.org Signed-off-by: Minchan Kim minchan@kernel.org Reported-by: Tino Lehnig tino.lehnig@contabo.de Tested-by: Tino Lehnig tino.lehnig@contabo.de Cc: Sergey Senozhatsky sergey.senozhatsky.work@gmail.com Cc: Jens Axboe axboe@kernel.dk Cc: stable@vger.kernel.org [4.15+] Signed-off-by: Andrew Morton akpm@linux-foundation.org ---
diff -puN drivers/block/zram/zram_drv.c~zram-remove-bd_cap_synchronous_io-with-writeback-feature-v2 drivers/block/zram/zram_drv.c --- a/drivers/block/zram/zram_drv.c~zram-remove-bd_cap_synchronous_io-with-writeback-feature-v2 +++ a/drivers/block/zram/zram_drv.c @@ -401,6 +401,16 @@ static ssize_t backing_dev_store(struct zram->backing_dev = backing_dev; zram->bitmap = bitmap; zram->nr_pages = nr_pages; + /* + * With writeback feature, zram does asynchronous IO so it's no longer + * synchronous device so let's remove synchronous io flag. Othewise, + * upper layer(e.g., swap) could wait IO completion rather than + * (submit and return), which will cause system sluggish. + * Furthermore, when the IO function returns(e.g., swap_readpage), + * upper layer expects IO was done so it could deallocate the page + * freely but in fact, IO is going on so finally could cause + * use-after-free when the IO is really done. + */ zram->disk->queue->backing_dev_info->capabilities &= ~BDI_CAP_SYNCHRONOUS_IO; up_write(&zram->init_lock); _
Patches currently in -mm which might be from minchan@kernel.org are
zram-remove-bd_cap_synchronous_io-with-writeback-feature.patch zram-remove-bd_cap_synchronous_io-with-writeback-feature-v2.patch
linux-stable-mirror@lists.linaro.org