source:
trunk/server/common/patches/openafs-afs_lookup-return.patch
@
2658
Last change on this file since 2658 was 2637, checked in by andersk, 9 years ago | |
---|---|
File size: 2.4 KB |
-
src/afs/LINUX/osi_vnodeops.c
From 100e35ed19e2c255986cb330b0f56f706acc6e7b Mon Sep 17 00:00:00 2001 From: Andrew Deason <adeason@sinenomine.net> Date: Thu, 24 Jul 2014 11:07:45 -0500 Subject: [PATCH] LINUX: Check afs_lookup return code explicitly Checking if the returned vcache is NULL or not is a bit of an indirect way to check if an error occurred. Just check the return code itself, to make sure we notice if any kind of error is reported. Suggested by Chas Williams. Reviewed-on: http://gerrit.openafs.org/11321 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: D Brashear <shadow@your-file-system.com> (cherry picked from commit 2edf5c0382385f898a017fd8e0e2429f8b2b3520) Change-Id: I7e123ab1cf88570a6b18e438e01409ed7804e014 --- src/afs/LINUX/osi_vnodeops.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 7e5cdd1..9ed6f01 100644
a b check_bad_parent(struct dentry *dp) 943 943 cred_t *credp; 944 944 struct dentry *parent; 945 945 struct vcache *vcp, *pvc, *avc = NULL; 946 int code; 946 947 947 948 vcp = VTOAFS(dp->d_inode); 948 949 parent = dget_parent(dp); … … check_bad_parent(struct dentry *dp) 952 953 credp = crref(); 953 954 954 955 /* force a lookup, so vcp->mvid is fixed up */ 955 afs_lookup(pvc, (char *)dp->d_name.name, &avc, credp);956 if ( !avc|| vcp != avc) { /* bad, very bad.. */956 code = afs_lookup(pvc, (char *)dp->d_name.name, &avc, credp); 957 if (code || vcp != avc) { /* bad, very bad.. */ 957 958 afs_Trace4(afs_iclSetp, CM_TRACE_TMP_1S3L, ICL_TYPE_STRING, 958 959 "check_bad_parent: bad pointer returned from afs_lookup origvc newvc dentry", 959 960 ICL_TYPE_POINTER, vcp, ICL_TYPE_POINTER, avc, … … afs_linux_dentry_revalidate(struct dentry *dp, int flags) 1233 1234 1234 1235 credp = crref(); 1235 1236 code = afs_lookup(pvcp, (char *)dp->d_name.name, &tvc, credp); 1236 if ( !tvc|| tvc != vcp) {1237 if (code || tvc != vcp) { 1237 1238 dput(parent); 1238 1239 /* Force unhash; the name doesn't point to this file 1239 1240 * anymore. */ … … afs_linux_lookup(struct inode *dip, struct dentry *dp) 1478 1479 AFS_GLOCK(); 1479 1480 code = afs_lookup(VTOAFS(dip), (char *)comp, &vcp, credp); 1480 1481 1481 if ( vcp) {1482 if (!code) { 1482 1483 struct vattr *vattr = NULL; 1483 1484 struct vcache *parent_vc = VTOAFS(dip); 1484 1485
Note: See TracBrowser
for help on using the repository browser.