diff options
author | David Howells <dhowells@redhat.com> | 2017-03-16 16:27:43 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-03-16 16:27:43 +0000 |
commit | 5611ef280d814042825ee17688f5751266fc538b (patch) | |
tree | e2d96d5511f419b64f2633d292426f4de75b8dbc /fs | |
parent | 29c8bbbd6e21daa0997d1c3ee886b897ee7ad652 (diff) | |
download | linux-exynos-5611ef280d814042825ee17688f5751266fc538b.tar.gz linux-exynos-5611ef280d814042825ee17688f5751266fc538b.tar.bz2 linux-exynos-5611ef280d814042825ee17688f5751266fc538b.zip |
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: 196ee9cd2d04 ("afs: Make afs_fs_fetch_data() take a list of pages")
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Marc Dionne <marc.dionne@auristor.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/afs/write.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/afs/write.c b/fs/afs/write.c index e919e64cd4e0..3ac52f6a96ff 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -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) |