]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - fs/btrfs/extent_io.c
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)
commit2e3c25136adfb293d517e17f761d3b8a43a8fc22
treebf3ed82cb016395c829c008ca107063061459390
parent02c6db4f7308e4f5adf4df2ef623160bfdb18636
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