Skip to content

Commit 2c17400

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
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
1 parent deb0c98 commit 2c17400

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

fs/nfs/fscache.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,11 @@ void nfs_fscache_reset_inode_cookie(struct inode *inode)
354354
*/
355355
int nfs_fscache_release_page(struct page *page, gfp_t gfp)
356356
{
357-
struct nfs_inode *nfsi = NFS_I(page->mapping->host);
358-
struct fscache_cookie *cookie = nfsi->fscache;
359-
360-
BUG_ON(!cookie);
361-
362357
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);
363362
dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n",
364363
cookie, page, nfsi);
365364

0 commit comments

Comments
 (0)