aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-02-08 09:32:27 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-02-09 14:29:10 -0500
commit2c1740098c708b465e87637b237feb2fd98f129a (patch)
tree7794f7a904913effa4c08bf4bb1b840aba52becb /fs/nfs
parentdeb0c98c7f6035d47a247e548384517a955314a5 (diff)
downloadkernel_samsung_smdk4412-2c1740098c708b465e87637b237feb2fd98f129a.zip
kernel_samsung_smdk4412-2c1740098c708b465e87637b237feb2fd98f129a.tar.gz
kernel_samsung_smdk4412-2c1740098c708b465e87637b237feb2fd98f129a.tar.bz2
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/nfs')
-rw-r--r--fs/nfs/fscache.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index fa58800..237874f 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -354,12 +354,11 @@ void nfs_fscache_reset_inode_cookie(struct inode *inode)
*/
int nfs_fscache_release_page(struct page *page, gfp_t gfp)
{
- struct nfs_inode *nfsi = NFS_I(page->mapping->host);
- struct fscache_cookie *cookie = nfsi->fscache;
-
- BUG_ON(!cookie);
-
if (PageFsCache(page)) {
+ struct nfs_inode *nfsi = NFS_I(page->mapping->host);
+ struct fscache_cookie *cookie = nfsi->fscache;
+
+ BUG_ON(!cookie);
dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n",
cookie, page, nfsi);