Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1596343 > unrolled thread
| Started by | David Howells <dhowells@redhat.com> |
|---|---|
| First post | 2017-03-09 20:10 +0100 |
| Last post | 2017-03-09 20:10 +0100 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 01/27] afs: Fix missing put_page() David Howells <dhowells@redhat.com> - 2017-03-09 20:10 +0100
[PATCH 02/27] afs: Fix page overput in afs_fill_page() David Howells <dhowells@redhat.com> - 2017-03-09 20:10 +0100
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Date | 2017-03-09 20:10 +0100 |
| Subject | [PATCH 01/27] afs: Fix missing put_page() |
| Message-ID | <tjbs6-I0-7@gated-at.bofh.it> |
In afs_writepages_region(), inside the loop where we find dirty pages to
deal with, one of the if-statements is missing a put_page().
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/afs/write.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/afs/write.c b/fs/afs/write.c
index c83c1a0e851f..e919e64cd4e0 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -513,6 +513,7 @@ static int afs_writepages_region(struct address_space *mapping,
if (PageWriteback(page) || !PageDirty(page)) {
unlock_page(page);
+ put_page(page);
continue;
}
[toc] | [next] | [standalone]
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Date | 2017-03-09 20:10 +0100 |
| Subject | [PATCH 02/27] afs: Fix page overput in afs_fill_page() |
| Message-ID | <tjbBM-10C-31@gated-at.bofh.it> |
| In reply to | #1596343 |
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>
---
fs/afs/write.c | 1 +
1 file changed, 1 insertion(+)
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)
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web