Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 106475 Details for
Bug 138788
[PATCH] pidof bug renders machine unbootable when NFS is stuck
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
use readlink instead of stat to solve blcking on NFS
nfs_block.patch (text/plain), 1.84 KB, created by
Constantine Gavrilov
on 2004-11-11 06:12:20 UTC
(
hide
)
Description:
use readlink instead of stat to solve blcking on NFS
Filename:
MIME Type:
Creator:
Constantine Gavrilov
Created:
2004-11-11 06:12:20 UTC
Size:
1.84 KB
patch
obsolete
>--- src/killall5.c Tue Jul 31 10:06:27 2001 >+++ src/killall5.c Thu Nov 11 00:27:47 2004 >@@ -48,8 +48,7 @@ > char *fullname; /* Name as found out from argv[0] */ > char *basename; /* Only the part after the last / */ > char *statname; /* the statname without braces */ >- ino_t ino; /* Inode number */ >- dev_t dev; /* Device it is on */ >+ char *exename; /* exename from /proc/pid/exe */ > pid_t pid; /* Process ID. */ > int sid; /* Session ID. */ > struct _proc_ *next; /* Pointer to next struct. */ >@@ -151,7 +150,6 @@ > FILE *fp; > int pid, f; > PROC *p, *n; >- struct stat st; > int c; > > /* Open the /proc directory. */ >@@ -165,6 +163,7 @@ > for (p = plist; n; p = n) { > n = p->next; > if (p->fullname) free(p->fullname); >+ if (p->exename) free(p->exename); > free(p); > } > plist = NULL; >@@ -217,6 +216,7 @@ > p->sid = 0; > nsyslog(LOG_ERR, "can't read sid from %s\n", > path); >+ free(p->statname); > free(p); > continue; > } >@@ -247,17 +247,22 @@ > p->basename = p->fullname; > } else { > /* Process disappeared.. */ >+ free(p->statname); > free(p); > continue; > } > > /* Try to stat the executable. */ > snprintf(path, sizeof(path), "/proc/%s/exe", d->d_name); >- if (stat(path, &st) == 0) { >- p->dev = st.st_dev; >- p->ino = st.st_ino; >+ p->exename = (char *)xmalloc(PATH_MAX); >+ /* readlink never blocks, even on NFS */ >+ if(readlink(path, p->exename, PATH_MAX) < 0) { >+ free(p->statname); >+ free(p->exename); >+ free(p); >+ continue; > } >- >+ > /* Link it into the list. */ > p->next = plist; > plist = p; >@@ -341,7 +346,7 @@ > /* First try to find a match based on dev/ino pair. */ > if (dostat) { > for (p = plist; p; p = p->next) { >- if (p->dev == st.st_dev && p->ino == st.st_ino) { >+ if (strcmp(prog, p->exename) == 0) { > add_pid_to_q(q, p); > foundone++; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 138788
:
106475
|
106478
|
108533
|
108534
|
108535
|
113650