]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.32.9/nfs-fix-a-bug-in-nfs_fscache_release_page.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.9 / nfs-fix-a-bug-in-nfs_fscache_release_page.patch
1 From 2c1740098c708b465e87637b237feb2fd98f129a Mon Sep 17 00:00:00 2001
2 From: Trond Myklebust <Trond.Myklebust@netapp.com>
3 Date: Mon, 8 Feb 2010 09:32:27 -0500
4 Subject: NFS: Fix a bug in nfs_fscache_release_page()
5
6 From: Trond Myklebust <Trond.Myklebust@netapp.com>
7
8 commit 2c1740098c708b465e87637b237feb2fd98f129a upstream.
9
10 Not having an fscache cookie is perfectly valid if the user didn't mount
11 with the fscache option.
12
13 This patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=15234
14
15 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 Acked-by: David Howells <dhowells@redhat.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18
19 ---
20 fs/nfs/fscache.c | 9 ++++-----
21 1 file changed, 4 insertions(+), 5 deletions(-)
22
23 --- a/fs/nfs/fscache.c
24 +++ b/fs/nfs/fscache.c
25 @@ -354,12 +354,11 @@ void nfs_fscache_reset_inode_cookie(stru
26 */
27 int nfs_fscache_release_page(struct page *page, gfp_t gfp)
28 {
29 - struct nfs_inode *nfsi = NFS_I(page->mapping->host);
30 - struct fscache_cookie *cookie = nfsi->fscache;
31 -
32 - BUG_ON(!cookie);
33 -
34 if (PageFsCache(page)) {
35 + struct nfs_inode *nfsi = NFS_I(page->mapping->host);
36 + struct fscache_cookie *cookie = nfsi->fscache;
37 +
38 + BUG_ON(!cookie);
39 dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n",
40 cookie, page, nfsi);
41