From 94ff83fee835f6d6c43d1907daee7c0e1567ff52 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Mon, 4 Jan 2010 19:37:40 -0500 Subject: [PATCH] Linux: don't oops on writeback if vcache has no stashed credentials When doing writeback, use current credentials if we can't find stashed credentials in the vcache entry. This is normally stashed in afs_open, so it's not clear how we get to that point, but that's not a reason to trigger an oops. Change-Id: I60937e3f9e360e68ea84205570c05cabb47ef08e Reviewed-on: http://gerrit.openafs.org/1063 Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/LINUX/osi_vnodeops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 83a5ab0e66..9f35ca7fca 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -2171,7 +2171,10 @@ afs_linux_writepage(struct page *pp) /* Grab the creds structure currently held in the vnode, and * get a reference to it, in case it goes away ... */ credp = vcp->cred; - crhold(credp); + if (credp) + crhold(credp); + else + credp = crref(); ReleaseWriteLock(&vcp->lock); AFS_GUNLOCK();