]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Fix page overput in afs_fill_page()
authorDavid Howells <dhowells@redhat.com>
Thu, 16 Mar 2017 16:27:43 +0000 (16:27 +0000)
committerDavid Howells <dhowells@redhat.com>
Thu, 16 Mar 2017 16:27:43 +0000 (16:27 +0000)
commit100f4493658ae431b6ece3f6dd14109b50d1f471
treee2d96d5511f419b64f2633d292426f4de75b8dbc
parent5b917c4245802de916d96cc42526b1ae361776cd
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: 9338a3ac1de9 ("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>
fs/afs/write.c