kernel: deget(): pcbmap returned 6

Jeremy Chadwick freebsd at jdc.parodius.com
Mon Nov 21 07:16:42 UTC 2011


On Mon, Nov 21, 2011 at 07:24:38AM +0100, Roy Stuivenberg wrote:
> Hello,
> 
> I'm running FreeBSD 8.2 stable amd64
> 
> uname -a :
> FreeBSD shadenet.roycs.nl 8.2-STABLE FreeBSD 8.2-STABLE #0: Thu Nov 17
> 16:54:43 CET 2011
> dhondub at shadenet.roycs.nl:/usr/obj/usr/src/sys/GENERIC-ROYCS  amd64
> 
> I found this error msg in tail -f /var/log/messages
> 
> kernel: deget(): pcbmap returned 6

This is an error that comes from the MSDOS filesystem driver.

$ grep -rn "pcbmap returned" /usr/src/sys
/usr/src/sys/fs/msdosfs/msdosfs_denode.c:278:			printf("deget(): pcbmap returned %d\n", error);

Relevant code bits:

272                 if (ldep->de_StartCluster != MSDOSFSROOT) {
273                         error = pcbmap(ldep, 0xffff, 0, &size, 0);
274                         if (error == E2BIG) {
275                                 ldep->de_FileSize = de_cn2off(pmp, size);
276                                 error = 0;
277                         } else
278                                 printf("deget(): pcbmap returned %d\n", error);
279                 }

Maybe someone forgot to add #ifdef MSDOSFS_DEBUG/#endif around the else
bits.  A comparison (same source file, just further down):

377         } else {
378                 error = pcbmap(dep, de_clcount(pmp, length) - 1, 0,
379                                &eofentry, 0);
380                 if (error) {
381 #ifdef MSDOSFS_DEBUG
382                         printf("detrunc(): pcbmap fails %d\n", error);
383 #endif
384                         return (error);
385                 }
386         }

Annotation for RELENG_8:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/fs/msdosfs/msdosfs_denode.c?annotate=1.102.2.6.2.1

The relevant error handler bit was committed 17 years ago, while jkh@
last touched the surrounding bits 13 years ago.

pcbmap() is a function in src/sys/fs/msdosfs/msdosfs_fat.c.  There are
"specific" error values which can get returned within it (such as E2BIG
and EIO), otherwise it appears to rely upon bread() function bits.  If
the error number actually correlates with errno.h, then error 6 is
ENXIO, or "Device not configured".

Your dmesg, which I have snipped for brevity, contains a *lot* of
messing about with different removable media, etc..  You conveniently
removed the timestamps from your tail -f on /var/log/messages, so if I
had to take a guess, it was that you stuck a device that had a FAT or
FAT32 filesystem on it which tickled said message.  You would be able to
determine when it started/stopped based on timestamps in
/var/log/messages vs. what you were doing at the time.  If it happened
when you weren't at the computer, possibly a cron job or periodic job
iterated over the filesystem and tickled the error message in question.

I do not know who is responsible for msdosfs at this time.

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                   Mountain View, CA, US |
| Making life hard for others since 1977.               PGP 4BD6C0CB |



More information about the freebsd-stable mailing list