Commit 2c1740098c708b465e87637b237feb2fd98f129a
1 parent
deb0c98c7f
Exists in
master
and in
7 other branches
NFS: Fix a bug in nfs_fscache_release_page()
Not having an fscache cookie is perfectly valid if the user didn't mount with the fscache option. This patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=15234 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: David Howells <dhowells@redhat.com> Cc: stable@kernel.org
Showing 1 changed file with 4 additions and 5 deletions Side-by-side Diff
fs/nfs/fscache.c
... | ... | @@ -354,12 +354,11 @@ |
354 | 354 | */ |
355 | 355 | int nfs_fscache_release_page(struct page *page, gfp_t gfp) |
356 | 356 | { |
357 | - struct nfs_inode *nfsi = NFS_I(page->mapping->host); | |
358 | - struct fscache_cookie *cookie = nfsi->fscache; | |
359 | - | |
360 | - BUG_ON(!cookie); | |
361 | - | |
362 | 357 | if (PageFsCache(page)) { |
358 | + struct nfs_inode *nfsi = NFS_I(page->mapping->host); | |
359 | + struct fscache_cookie *cookie = nfsi->fscache; | |
360 | + | |
361 | + BUG_ON(!cookie); | |
363 | 362 | dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n", |
364 | 363 | cookie, page, nfsi); |
365 | 364 |