LINUX: Close cacheFp if no ->readpage in fastpath 52/14252/5
authorAndrew Deason <adeason@sinenomine.net>
Fri, 19 Jun 2020 02:16:09 +0000 (21:16 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 3 Jul 2020 22:16:46 +0000 (18:16 -0400)
In afs_linux_readpage_fastpath, if we discover that our disk cache fs
has no ->readpage function, we'll 'goto out', but we never close our
cacheFp. To make sure we close it, add a filp_close() call to the
'goto out' cleanup code.

Change-Id: I371c1d7ec51b03447fbcbe58fb89be7be0235022
Reviewed-on: https://gerrit.openafs.org/14252
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/afs/LINUX/osi_vnodeops.c

index cab5fcc..1a29ed7 100644 (file)
@@ -2361,6 +2361,9 @@ afs_linux_readpage_fastpath(struct file *fp, struct page *pp, int *codep)
     return 1;
 
 out:
+    if (cacheFp != NULL) {
+       filp_close(cacheFp, NULL);
+    }
     ReleaseWriteLock(&avc->lock);
     ReleaseReadLock(&tdc->lock);
     afs_PutDCache(tdc);