From: Andrew Deason Date: Fri, 31 Jan 2014 22:40:35 +0000 (-0600) Subject: afs: Include FID in DoLockWarning X-Git-Tag: openafs-stable-1_8_0pre1~799 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=4f253106dc5d1a5280b0a5be393df0e87e00a661;hp=c73883e7846fa0421cfac29830c27c9b6aacf5ed afs: Include FID in DoLockWarning Provide the FID that is being locked when we warn about byte-range locks, so the user can find what file the process is trying to lock. Change-Id: I56a185c200ac73045ee29b79410e27222c2637f2 Reviewed-on: http://gerrit.openafs.org/10795 Reviewed-by: D Brashear Tested-by: D Brashear --- diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index 0e810b4..fed0bcc 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -507,7 +507,7 @@ HandleFlock(struct vcache *avc, int acom, struct vrequest *areq, /* warn a user that a lock has been ignored */ static void -DoLockWarning(afs_ucred_t * acred) +DoLockWarning(struct vcache *avc, afs_ucred_t * acred) { static afs_uint32 lastWarnTime; static pid_t lastWarnPid; @@ -544,8 +544,11 @@ DoLockWarning(afs_ucred_t * acred) message = "byte-range lock/unlock ignored; make sure no one else is running this program"; #endif - afs_warnuser("afs: %s (pid %d (%s), user %ld).\n", - message, pid, procname, (long)afs_cr_uid(acred)); + afs_warnuser("afs: %s (pid %d (%s), user %ld, fid %lu.%lu.%lu).\n", + message, pid, procname, (long)afs_cr_uid(acred), + (unsigned long)avc->f.fid.Fid.Volume, + (unsigned long)avc->f.fid.Fid.Vnode, + (unsigned long)avc->f.fid.Fid.Unique); afs_osi_Free(procname, 256); } @@ -611,7 +614,7 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, /* next line makes byte range locks always succeed, * even when they should block */ if (af->l_whence != 0 || af->l_start != 0 || af->l_len != 0) { - DoLockWarning(acred); + DoLockWarning(avc, acred); code = 0; goto done; }