On Wed, Jan 27, 2021 at 12:13:27PM -0500, Josef Bacik wrote:
> On 1/26/21 3:34 AM, Qu Wenruo wrote:
> > @@ -3263,6 +3277,7 @@ int btrfs_do_readpage(struct page *page, struct
> > extent_map **em_cached,
> > unsigned int read_flags, u64 *prev_em_start)
> > {
> > struct inode *inode = page->mapping->host;
> > + struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
> > u64 start = page_offset(page);
> > const u64 end = start + PAGE_SIZE - 1;
> > u64 cur = start;
> > @@ -3306,6 +3321,7 @@ int btrfs_do_readpage(struct page *page, struct
> > extent_map **em_cached,
> > kunmap_atomic(userpage);
> > }
> > }
>
> You have two error cases above this
>
> ret = set_page_extent_mapped(page);
> if (ret < 0) {
> unlock_extent(tree, start, end);
> SetPageError(page);
> goto out;
> }
>
> and
>
> if (!PageUptodate(page)) {
> if (cleancache_get_page(page) == 0) {
> BUG_ON(blocksize != PAGE_SIZE);
> unlock_extent(tree, start, end);
> goto out;
> }
> }
>
> which will now leave the page locked when it errors out. Not to mention I'm
> pretty sure you want to use btrfs_page_set_error() instead of SetPageError()
> in
> that first case.
Qu, please send a fixed version, just this patch, thanks.