diff --git a/psmisc-22.6-nfs4fuser.patch b/psmisc-22.6-nfs4fuser.patch index 00343f1..0d8e367 100644 --- a/psmisc-22.6-nfs4fuser.patch +++ b/psmisc-22.6-nfs4fuser.patch @@ -33,7 +33,7 @@ cannot report on any processes that it doesn't have permission to look at the file descriptor table for. The most common time this problem occurs --- src/fuser.c -+++ src/fuser.c 2008-09-23 16:00:18.038188677 +0200 ++++ src/fuser.c 2008-10-01 16:37:41.410576528 +0200 @@ -32,9 +32,11 @@ #include #include @@ -484,7 +484,24 @@ } } fclose(fp); -@@ -1144,17 +1314,53 @@ void scan_mount_devices(const opt_type o +@@ -1135,6 +1305,16 @@ void fill_unix_cache(struct unixsocket_l + + } + ++static inline int isnetfs(const char * type) ++{ ++ static const char* netfs[] = {"nfs", "nfs4", "smbfs", "cifs", "afs", "ncpfs", (char*)0}; ++ int n; ++ for (n = 0; netfs[n]; n++) ++ if (!strcasecmp(netfs[n], type)) ++ return 1; ++ return 0; ++} ++ + /* + * scan_mount_devices : Create a list of mount points and devices + * This list is used later for matching purposes +@@ -1144,17 +1324,53 @@ void scan_mount_devices(const opt_type o FILE *mntfp; struct mntent *mnt_ptr; struct stat st; @@ -502,7 +519,7 @@ return; } while ( (mnt_ptr = getmntent(mntfp)) != NULL) { -+ if (!strcasecmp(MNTTYPE_NFS, mnt_ptr->mnt_type)) { ++ if (isnetfs(mnt_ptr->mnt_type)) { + /* + * Remember all NFS typed partitions, required to make check4nfs() work. + */ @@ -542,7 +559,7 @@ } #ifdef DEBUG -@@ -1280,3 +1486,56 @@ static void scan_knfsd(struct names *nam +@@ -1280,3 +1496,56 @@ static void scan_knfsd(struct names *nam } } #endif /* NFSCHECKS */ diff --git a/psmisc-22.6.dif b/psmisc-22.6.dif index 0e8b1c5..de5a9f5 100644 --- a/psmisc-22.6.dif +++ b/psmisc-22.6.dif @@ -32,3 +32,25 @@ dnl Checks for library functions. AC_FUNC_CLOSEDIR_VOID +--- src/fuser.c ++++ src/fuser.c 2008-10-01 18:02:08.469114183 +0200 +@@ -147,7 +147,6 @@ static void scan_procs(const opt_type op + { + DIR *topproc_dir; + struct dirent *topproc_dent; +- char *fd_dirpath, *fd_pathname; + struct inode_list *ino_tmp; + struct device_list *dev_tmp; + pid_t pid, my_pid; +@@ -157,11 +156,6 @@ static void scan_procs(const opt_type op + char cwd_real[PATH_MAX+1]; + char exe_real[PATH_MAX+1]; + +- if ( (fd_dirpath = malloc(MAX_PATHNAME)) == NULL) +- return; +- if ( (fd_pathname = malloc(MAX_PATHNAME)) == NULL) +- return; +- + if ( (topproc_dir = opendir("/proc")) == NULL) { + fprintf(stderr, _("Cannot open /proc directory: %s\n"), strerror(errno)); + exit(1); diff --git a/psmisc.changes b/psmisc.changes index fa05247..5eba21e 100644 --- a/psmisc.changes +++ b/psmisc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Oct 1 16:39:27 CEST 2008 - werner@suse.de + +- Avoid stat(2) for all network based file systems (bnc#409011) + ------------------------------------------------------------------- Tue Sep 23 15:30:58 CEST 2008 - werner@suse.de diff --git a/psmisc.spec b/psmisc.spec index fcc87c6..ffc31a8 100644 --- a/psmisc.spec +++ b/psmisc.spec @@ -27,7 +27,7 @@ Group: System/Monitoring PreReq: %fillup_prereq %insserv_prereq AutoReqProv: on Version: 22.6 -Release: 59 +Release: 60 Provides: ps:/usr/bin/killall Summary: Utilities for managing processes on your system Source: http://switch.dl.sourceforge.net/sourceforge/psmisc/psmisc-%{version}.tar.bz2 @@ -103,6 +103,8 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/pstree.1* %changelog +* Wed Oct 01 2008 werner@suse.de +- Avoid stat(2) for all network based file systems (bnc#409011) * Tue Sep 23 2008 werner@suse.de - Enhance NFS patch for fuser (bug #409011) * Mon Sep 01 2008 werner@suse.de