block: ensure that bio_add_page() always accepts a page for an empty bio
authorJens Axboe <axboe@fb.com>
Tue, 10 Jun 2014 18:53:56 +0000 (12:53 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:52 +0000 (12:54 -0600)
commit8028511b9e6471b85f59744f989567e63c5edce4
treebbf3cf335a08085aef4ea14cf7dc89d4fcbe0c45
parent5186db079424c9fc3b7629410cfb838556069ad7
block: ensure that bio_add_page() always accepts a page for an empty bio

With commit 762380ad9322 added support for chunk sizes and no merging
across them, it broke the rule of always allowing adding of a single
page to an empty bio. So relax the restriction a bit to allow for that,
similarly to what we have always done.

This fixes a crash with mkfs.xfs and 512b sector sizes on NVMe.

Reported-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-settings.c
fs/bio.c