diff options
-rw-r--r-- | resources/default-conf/conf.hjson | 11 | ||||
-rw-r--r-- | src/file_sum/sum_computation.rs | 13 |
2 files changed, 17 insertions, 7 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 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::<NodeId>::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 { |