diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-02-08 09:32:27 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-02-09 14:29:10 -0500 |
| commit | 2c1740098c708b465e87637b237feb2fd98f129a (patch) | |
| tree | 7794f7a904913effa4c08bf4bb1b840aba52becb /fs | |
| parent | deb0c98c7f6035d47a247e548384517a955314a5 (diff) | |
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
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/nfs/fscache.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c index fa588006588d..237874f1af23 100644 --- a/fs/nfs/fscache.c +++ b/fs/nfs/fscache.c | |||
| @@ -354,12 +354,11 @@ void nfs_fscache_reset_inode_cookie(struct inode *inode) | |||
| 354 | */ | 354 | */ |
| 355 | int nfs_fscache_release_page(struct page *page, gfp_t gfp) | 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 | if (PageFsCache(page)) { | 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 | dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n", | 362 | dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n", |
| 364 | cookie, page, nfsi); | 363 | cookie, page, nfsi); |
| 365 | 364 | ||
