]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix handling for BIO_NO_PAGE_REF
authorMing Lei <ming.lei@redhat.com>
Fri, 26 Apr 2019 10:45:20 +0000 (18:45 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 May 2019 14:38:47 +0000 (08:38 -0600)
commitf8e7564c09491a5359458d97e7dfe2c6b371c5bc
treec8b9d074ea3eb1a600c131e16601ea2d7cda9c5c
parentc003f7e18e20b2e8a99ebb0cd12bc2fd0ab346c7
block: fix handling for BIO_NO_PAGE_REF

Commit 36212d9cb703c66 ("block: add BIO_NO_PAGE_REF flag") introduces
BIO_NO_PAGE_REF, and once this flag is set for one bio, all pages
in the bio won't be get/put during IO.

However, if one bio is submitted via __blkdev_direct_IO_simple(),
even though BIO_NO_PAGE_REF is set, pages still may be put.

Fixes this issue by avoiding to put pages if BIO_NO_PAGE_REF is
set.

Fixes: 36212d9cb703c66 ("block: add BIO_NO_PAGE_REF flag")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/block_dev.c