]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afs: Include FID in DoLockWarning
authorAndrew Deason <adeason@sinenomine.net>
Fri, 31 Jan 2014 22:40:35 +0000 (16:40 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 14 Mar 2014 12:45:28 +0000 (05:45 -0700)
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.

Reviewed-on: http://gerrit.openafs.org/10795
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 4f253106dc5d1a5280b0a5be393df0e87e00a661)

Change-Id: I369e9505583c1b6b820b5bc54b8e4908ab8bf3e5
Reviewed-on: http://gerrit.openafs.org/10838
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/VNOPS/afs_vnop_flock.c

index 5b0df76de092384c64c2950a2aa0a3ce7c772b6f..4d03dc1de4b99ef0753b2fb1e65799250a4b90a0 100644 (file)
@@ -517,7 +517,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;
@@ -554,8 +554,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);
 }
@@ -621,7 +624,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;
     }