From aecfe73ba9947e2a1c04f70526cab87e49f4baef Mon Sep 17 00:00:00 2001 From: Canop Date: Fri, 9 Dec 2022 19:34:35 +0100 Subject: don't sum in /proc and /run Fix #637 --- src/file_sum/sum_computation.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/file_sum/sum_computation.rs b/src/file_sum/sum_computation.rs index d6a05a8..c997375 100644 --- a/src/file_sum/sum_computation.rs +++ b/src/file_sum/sum_computation.rs @@ -28,7 +28,6 @@ use { }, }; - struct DirSummer { thread_count: usize, thread_pool: ThreadPool, @@ -80,6 +79,16 @@ impl DirSummer { return Some(FileSum::zero()); } + // there are problems in /proc - See issue #637 + if path.starts_with("/proc") { + debug!("not summing in /proc"); + return Some(FileSum::zero()); + } + if path.starts_with("/run") { + debug!("not summing in /run"); + return Some(FileSum::zero()); + } + // to avoid counting twice a node, we store their id in a set #[cfg(unix)] let nodes = Arc::new(Mutex::new(FnvHashSet::::default())); @@ -118,6 +127,7 @@ impl DirSummer { sum += *entry_sum; continue; } + // we add the directory to the channel of dirs needing // processing busy += 1; @@ -153,7 +163,6 @@ impl DirSummer { // at end of computation let (thread_sum_sender, thread_sum_receiver) = channel::bounded(threads_count); - // Each thread does a summation without merge and the data are merged // at the end (this avoids waiting for a mutex during computation) for _ in 0..threads_count { -- cgit v1.2.3 From c3aef5bb71c99d16dc2cace72b64480d66d056d2 Mon Sep 17 00:00:00 2001 From: Canop Date: Fri, 9 Dec 2022 19:37:40 +0100 Subject: add /media to special not entered default paths --- resources/default-conf/conf.hjson | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/default-conf/conf.hjson b/resources/default-conf/conf.hjson index e912084..e4b0f7f 100644 --- a/resources/default-conf/conf.hjson +++ b/resources/default-conf/conf.hjson @@ -87,11 +87,12 @@ # If some paths must be handled specially, uncomment (and change # this section as per the examples) # - # special_paths: { - # "/media/slow-backup-disk" : no-enter - # "/home/dys/useless" : hide - # "/home/dys/my-link-I-want-to-explore" : enter - # } + special_paths: { + "/media" : "no-enter" // comment it if desired + # "/media/slow-backup-disk" : no-enter + # "/home/dys/useless" : hide + # "/home/dys/my-link-I-want-to-explore" : enter + } ############################################################### # Quit on last cancel -- cgit v1.2.3