mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
btrfs: fix page leaks after failure to lock page for delalloc
commit 5909ca110b29aa16b23b52b8de8d3bb1035fd738 upstream. When locking pages for delalloc, we check if it's dirty and mapping still matches. If it does not match, we need to return -EAGAIN and release all pages. Only the current page was put though, iterate over all the remaining pages too. CC: [email protected] # 4.14+ Reviewed-by: Filipe Manana <[email protected]> Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: Robbie Ko <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
b04805a7e8
commit
38a66f3cda
1 changed files with 2 additions and 1 deletions
|
|
@ -1923,7 +1923,8 @@ static int __process_pages_contig(struct address_space *mapping,
|
|||
if (!PageDirty(pages[i]) ||
|
||||
pages[i]->mapping != mapping) {
|
||||
unlock_page(pages[i]);
|
||||
put_page(pages[i]);
|
||||
for (; i < ret; i++)
|
||||
put_page(pages[i]);
|
||||
err = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue