2019-08-26 14:05:42 +00:00
|
|
|
From 499dfe62817f46e2132dd265dbe3603e5929279e Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jan Rybar <jrybar@redhat.com>
|
|
|
|
Date: Tue, 19 Feb 2019 16:39:17 +0100
|
2019-09-06 12:44:27 +00:00
|
|
|
Subject: [PATCH 04/11] NULLptr sanity added in scan fns to avoid useless prep
|
|
|
|
work (stalls NFS)
|
2019-08-26 14:05:42 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
src/fuser.c | 14 ++++++++++++++
|
|
|
|
1 file changed, 14 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/src/fuser.c b/src/fuser.c
|
|
|
|
index c44cee8..b8662a3 100644
|
|
|
|
--- a/src/fuser.c
|
|
|
|
+++ b/src/fuser.c
|
|
|
|
@@ -188,6 +188,9 @@ scan_procs(struct names *names_head, struct inode_list *ino_head,
|
2019-02-19 15:44:32 +00:00
|
|
|
pid_t pid, my_pid;
|
|
|
|
uid_t uid;
|
|
|
|
|
|
|
|
+ if ( (ino_head == NULL) && (dev_head == NULL) )
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
if ((topproc_dir = opendir("/proc")) == NULL) {
|
|
|
|
fprintf(stderr, _("Cannot open /proc directory: %s\n"),
|
|
|
|
strerror(errno));
|
2019-08-26 14:05:42 +00:00
|
|
|
@@ -1873,6 +1876,10 @@ scan_knfsd(struct names *names_head, struct inode_list *ino_head,
|
2019-02-19 15:44:32 +00:00
|
|
|
char *find_space;
|
|
|
|
struct stat st;
|
|
|
|
|
|
|
|
+ if ( (ino_head == NULL) && (dev_head == NULL) )
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
if ((fp = fopen(KNFSD_EXPORTS, "r")) == NULL) {
|
|
|
|
#ifdef DEBUG
|
|
|
|
printf("Cannot open %s\n", KNFSD_EXPORTS);
|
2019-08-26 14:05:42 +00:00
|
|
|
@@ -1919,6 +1926,10 @@ scan_mounts(struct names *names_head, struct inode_list *ino_head,
|
2019-02-19 15:44:32 +00:00
|
|
|
char *find_space;
|
|
|
|
struct stat st;
|
|
|
|
|
|
|
|
+ if ( (ino_head == NULL) && (dev_head == NULL) )
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
if ((fp = fopen(PROC_MOUNTS, "r")) == NULL) {
|
|
|
|
fprintf(stderr, "Cannot open %s\n", PROC_MOUNTS);
|
|
|
|
return;
|
2019-08-26 14:05:42 +00:00
|
|
|
@@ -1962,6 +1973,9 @@ scan_swaps(struct names *names_head, struct inode_list *ino_head,
|
2019-02-19 15:44:32 +00:00
|
|
|
char *find_space;
|
|
|
|
struct stat st;
|
|
|
|
|
|
|
|
+ if ( (ino_head == NULL) && (dev_head == NULL) )
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
if ((fp = fopen(PROC_SWAPS, "r")) == NULL) {
|
|
|
|
/*fprintf(stderr, "Cannot open %s\n", PROC_SWAPS); */
|
|
|
|
return;
|
2019-08-26 14:05:42 +00:00
|
|
|
--
|
|
|
|
2.20.1
|
|
|
|
|