mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
afs: Fix page overput in afs_fill_page()
afs_fill_page() loads the page it wants to fill into the afs_read request
without incrementing its refcount - but then calls afs_put_read() to clean
up afterwards, which then releases a ref on the page.
Fix this by getting a ref on the page before calling
afs_vnode_fetch_data().
This causes sync after a write to hang in afs_writepages_region() because
find_get_pages_tag() gets confused and doesn't return.
Fixes: 196ee9cd2d ("afs: Make afs_fs_fetch_data() take a list of pages")
Reported-by: Marc Dionne <[email protected]>
Signed-off-by: David Howells <[email protected]>
Tested-by: Marc Dionne <[email protected]>
This commit is contained in:
parent
29c8bbbd6e
commit
5611ef280d
1 changed files with 1 additions and 0 deletions
|
|
@ -101,6 +101,7 @@ static int afs_fill_page(struct afs_vnode *vnode, struct key *key,
|
|||
req->pos = pos;
|
||||
req->nr_pages = 1;
|
||||
req->pages[0] = page;
|
||||
get_page(page);
|
||||
|
||||
i_size = i_size_read(&vnode->vfs_inode);
|
||||
if (pos + PAGE_SIZE > i_size)
|
||||
|
|
|
|||
Loading…
Reference in a new issue