]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: extent_io: add proper error handling to lock_extent_buffer_for_io()
authorQu Wenruo <wqu@suse.com>
Wed, 20 Mar 2019 06:27:46 +0000 (14:27 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:24 +0000 (19:02 +0200)
commit86d059b49a42e7163cc66df51eca496f625b49be
treebf3ed82cb016395c829c008ca107063061459390
parenta64cb9d82e9e075013437343c9db6afb866e3e9e
btrfs: extent_io: add proper error handling to lock_extent_buffer_for_io()

This function needs some extra checks on locked pages and eb.  For error
handling we need to unlock locked pages and the eb.

There is a rare >0 return value branch, where all pages get locked
while write bio is not flushed.

Thankfully it's handled by the only caller, btree_write_cache_pages(),
as later write_one_eb() call will trigger submit_one_bio().  So there
shouldn't be any problem.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c