diff options
author | Denys Séguret <cano.petrole@gmail.com> | 2022-12-09 19:43:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-09 19:43:32 +0100 |
commit | 4d619e685308e1e7147b76a4a362a069b51bba20 (patch) | |
tree | 108b1345081d0dc9e3a64095833ee1de09d15e02 | |
parent | 96c1945fd2853cdc5841bd3cf840d9affbb31ded (diff) | |
parent | c3aef5bb71c99d16dc2cace72b64480d66d056d2 (diff) |
Merge pull request #638 from Canop/issue-637
Fix issue 637
-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 { |