Date: Tue, 19 Jul 2011 03:40:11 GMT From: dfilter@FreeBSD.ORG (dfilter service) To: freebsd-bugs@FreeBSD.org Subject: Re: bin/156258: commit references a PR Message-ID: <201107190340.p6J3eBp2062929@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/156258; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/156258: commit references a PR Date: Tue, 19 Jul 2011 03:30:52 +0000 (UTC) Author: avatar Date: Tue Jul 19 03:30:42 2011 New Revision: 224208 URL: http://svn.freebsd.org/changeset/base/224208 Log: MFC r223035: Using statfs.f_fstypename rather than statfs.f_type whilst performing fstype comparsion as nullfs will copy f_type from underlayer FS. PR: bin/156258 Submitted by: Marcin Wisnicki <mwisnicki+freebsd@gmail.com> Modified: stable/7/usr.bin/find/function.c Directory Properties: stable/7/usr.bin/find/ (props changed) Modified: stable/7/usr.bin/find/function.c ============================================================================== --- stable/7/usr.bin/find/function.c Tue Jul 19 00:37:24 2011 (r224207) +++ stable/7/usr.bin/find/function.c Tue Jul 19 03:30:42 2011 (r224208) @@ -841,7 +841,8 @@ f_fstype(PLAN *plan, FTSENT *entry) static dev_t curdev; /* need a guaranteed illegal dev value */ static int first = 1; struct statfs sb; - static int val_type, val_flags; + static int val_flags; + static char fstype[sizeof(sb.f_fstypename)]; char *p, save[2] = {0,0}; if ((plan->flags & F_MTMASK) == F_MTUNKNOWN) @@ -883,13 +884,13 @@ f_fstype(PLAN *plan, FTSENT *entry) * always copy both of them. */ val_flags = sb.f_flags; - val_type = sb.f_type; + strlcpy(fstype, sb.f_fstypename, sizeof(fstype)); } switch (plan->flags & F_MTMASK) { case F_MTFLAG: return val_flags & plan->mt_data; case F_MTTYPE: - return val_type == plan->mt_data; + return (strncmp(fstype, plan->c_data, sizeof(fstype)) == 0); default: abort(); } @@ -900,22 +901,11 @@ c_fstype(OPTION *option, char ***argvp) { char *fsname; PLAN *new; - struct xvfsconf vfc; fsname = nextarg(option, argvp); ftsoptions &= ~FTS_NOSTAT; new = palloc(option); - - /* - * Check first for a filesystem name. - */ - if (getvfsbyname(fsname, &vfc) == 0) { - new->flags |= F_MTTYPE; - new->mt_data = vfc.vfc_typenum; - return new; - } - switch (*fsname) { case 'l': if (!strcmp(fsname, "local")) { @@ -933,12 +923,8 @@ c_fstype(OPTION *option, char ***argvp) break; } - /* - * We need to make filesystem checks for filesystems - * that exists but aren't in the kernel work. - */ - fprintf(stderr, "Warning: Unknown filesystem type %s\n", fsname); - new->flags |= F_MTUNKNOWN; + new->flags |= F_MTTYPE; + new->c_data = fsname; return new; } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107190340.p6J3eBp2062929>