mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
Record the file, line, and pid of the last successful shared lock holder. This
is useful as a last effort in debugging file system deadlocks. This is enabled via 'options DEBUG_LOCKS'
This commit is contained in:
parent
12b32eafa8
commit
7181624aaa
2 changed files with 11 additions and 0 deletions
|
|
@ -259,6 +259,12 @@ debuglockmgr(lkp, flags, interlkp, td, name, file, line)
|
|||
if (error)
|
||||
break;
|
||||
sharelock(lkp, 1);
|
||||
#if defined(DEBUG_LOCKS)
|
||||
lkp->lk_slockholder = pid;
|
||||
lkp->lk_sfilename = file;
|
||||
lkp->lk_slineno = line;
|
||||
lkp->lk_slockername = name;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -62,6 +62,11 @@ struct lock {
|
|||
const char *lk_filename;
|
||||
const char *lk_lockername;
|
||||
int lk_lineno;
|
||||
|
||||
pid_t lk_slockholder;
|
||||
const char *lk_sfilename;
|
||||
const char *lk_slockername;
|
||||
int lk_slineno;
|
||||
#endif
|
||||
};
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue