From: Trond Myklebust Date: Mon, 8 Feb 2010 14:32:27 +0000 (-0500) Subject: NFS: Fix a bug in nfs_fscache_release_page() X-Git-Tag: v2.6.33-rc8~10^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c1740098c708b465e87637b237feb2fd98f129a;p=profile%2Fcommon%2Fkernel-common.git 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 Acked-by: David Howells Cc: stable@kernel.org --- 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);