locate.updatedb breaks on inaccessible smbfs mounts

Matthew Dillon dillon at apollo.backplane.com
Sat Mar 12 22:17:51 PST 2005


:Because you wouldn't scratch a part of your body when you know it might be
:wounded :) Probably a patch like this against find(1) solves your problem
:(not tested, because I don't have smbfs share at hand)? This patch changes
:the behavior of -fstype to report false whenever statfs() on a mountpoint
:fails, instead of terminating the process. I can't think of a bad side-effect
:with this patch, other than, hmm,
:
:# find /tmp \! -fstype ufs -exec 'shutdown -p now' \;

    Hmm.  I agree.  -fstype should not terminate the find if it can't
    type a filesystem, that clearly leads to for more abnormal behavior then
    if it just gave a warning.

    Please go ahead and commit your patch!

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>

:Index: usr.bin/find/function.c
:===================================================================
:RCS file: /home/source/dragonfly/cvs/src/usr.bin/find/function.c,v
:retrieving revision 1.6
:diff -u -r1.6 function.c
:--- usr.bin/find/function.c	14 Feb 2005 00:39:04 -0000	1.6
:+++ usr.bin/find/function.c	13 Mar 2005 03:50:49 -0000
:@@ -789,9 +789,10 @@
: 		} else
: 			p = NULL;
: 
:-		if (statfs(entry->fts_accpath, &sb))
:-			err(1, "%s", entry->fts_accpath);
:-
:+		if (statfs(entry->fts_accpath, &sb)) {
:+			warn("%s", entry->fts_accpath);
:+			return 0;
:+		}
: 		if (p) {
: 			p[0] = save[0];
: 			p[1] = save[1];
:






More information about the Bugs mailing list