if ($path =~ m/\.dpkg-/ || $path =~ m/\(deleted\)/ || $path =~ /path inode=/ || $path =~ m#/\.nfs# || $fd eq 'DEL') {
my $deleted_in_path = ($path =~ m/\(deleted\)/);
next if ($deleted_in_path && $fd =~ /^[0-9]*$/); # Ignore deleted files that are open via normal file handles.
+ next if ($deleted_in_path && $fd eq 'cwd'); # Ignore deleted directories that we happen to be in.
$path =~ s/^\(deleted\)//; # in some cases "(deleted)" is at the beginning of the string
for my $i (@{$config->{'ignorelist'}}) {