]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
btrfs: do away with non-whole_page extent I/O
authorAlexandre Oliva <oliva@gnu.org>
Wed, 15 May 2013 15:38:55 +0000 (11:38 -0400)
committerJosef Bacik <jbacik@fusionio.com>
Sat, 18 May 2013 01:40:35 +0000 (21:40 -0400)
commit17a5adccf3fd01added91f3bf9aa7ee9aa28843b
tree88db46d064c88cfee010cd870ca3a8ff262a4505
parentb216cbfb52c08300c203abf06ea9519d15d10045
btrfs: do away with non-whole_page extent I/O

end_bio_extent_readpage computes whole_page based on bv_offset and
bv_len, without taking into account that blk_update_request may modify
them when some of the blocks to be read into a page produce a read
error.  This would cause the read to unlock only part of the file
range associated with the page, which would in turn leave the entire
page locked, which would not only keep the process blocked instead of
returning -EIO to it, but also prevent any further access to the file.

It turns out that btrfs always issues whole-page reads and writes.
The special handling of non-whole_page appears to be a mistake or a
left-over from a time when this wasn't the case.  Indeed,
end_bio_extent_writepage distinguished between whole_page and
non-whole_page writes but behaved identically in both cases!

I've replaced the whole_page computations with warnings, just to be
sure that we're not issuing partial page reads or writes.  The
warnings should probably just go away some time.

Signed-off-by: Alexandre Oliva <oliva@gnu.org>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/extent_io.c