diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2011-11-22 13:30:36 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2011-11-22 13:30:36 +0000 |
commit | 54cf919857e984bab0377681ffe7daa014ff34b9 (patch) | |
tree | 42c5b64d65cf2ea81a191c90c8526c96283ea0c8 /sys/fs/msdosfs | |
parent | 3f850e6a25ca70969338c0fa1291cccba1bd41b4 (diff) | |
download | src-54cf919857e984bab0377681ffe7daa014ff34b9.tar.gz src-54cf919857e984bab0377681ffe7daa014ff34b9.zip |
Notes
Diffstat (limited to 'sys/fs/msdosfs')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_conv.c | 4 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_denode.c | 9 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_fat.c | 6 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_lookup.c | 2 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 4 |
5 files changed, 24 insertions, 1 deletions
diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c index fde6512f2644..f36381b74523 100644 --- a/sys/fs/msdosfs/msdosfs_conv.c +++ b/sys/fs/msdosfs/msdosfs_conv.c @@ -1036,8 +1036,10 @@ mbnambuf_write(struct mbnambuf *nbp, char *name, int id) size_t count, newlen; if (nbp->nb_len != 0 && id != nbp->nb_last_id - 1) { +#ifdef MSDOSFS_DEBUG printf("msdosfs: non-decreasing id: id %d, last id %d\n", id, nbp->nb_last_id); +#endif return; } @@ -1046,7 +1048,9 @@ mbnambuf_write(struct mbnambuf *nbp, char *name, int id) count = strlen(name); newlen = nbp->nb_len + count; if (newlen > WIN_MAXLEN || newlen > MAXNAMLEN) { +#ifdef MSDOSFS_DEBUG printf("msdosfs: file name length %zu too large\n", newlen); +#endif return; } diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 84b52ba8f2f2..1166be7cfc0a 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -263,8 +263,10 @@ deget(pmp, dirclust, diroffset, depp) * instead of what is written in directory entry. */ if (diroffset == 0 && ldep->de_StartCluster != dirclust) { +#ifdef MSDOSFS_DEBUG printf("deget(): \".\" entry at clust %lu != %lu\n", dirclust, ldep->de_StartCluster); +#endif ldep->de_StartCluster = dirclust; } @@ -274,8 +276,11 @@ deget(pmp, dirclust, diroffset, depp) if (error == E2BIG) { ldep->de_FileSize = de_cn2off(pmp, size); error = 0; - } else + } else { +#ifdef MSDOSFS_DEBUG printf("deget(): pcbmap returned %d\n", error); +#endif + } } } else nvp->v_type = VREG; @@ -351,8 +356,10 @@ detrunc(dep, length, flags, cred, td) * directory's life. */ if ((DETOV(dep)->v_vflag & VV_ROOT) && !FAT32(pmp)) { +#ifdef MSDOSFS_DEBUG printf("detrunc(): can't truncate root directory, clust %ld, offset %ld\n", dep->de_dirclust, dep->de_diroffset); +#endif return (EINVAL); } diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index c857b3426268..0b1899f41dd3 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -503,7 +503,9 @@ fatentry(function, pmp, cn, oldcontents, newcontents) * Be sure they asked us to do something. */ if ((function & (FAT_SET | FAT_GET)) == 0) { +#ifdef MSDOSFS_DEBUG printf("fatentry(): function code doesn't specify get or set\n"); +#endif return (EINVAL); } @@ -512,7 +514,9 @@ fatentry(function, pmp, cn, oldcontents, newcontents) * where to put it, give them an error. */ if ((function & FAT_GET) && oldcontents == NULL) { +#ifdef MSDOSFS_DEBUG printf("fatentry(): get function with no place to put result\n"); +#endif return (EINVAL); } #endif @@ -997,7 +1001,9 @@ extendfile(dep, count, bpp, ncp, flags) */ if (dep->de_StartCluster == MSDOSFSROOT && (dep->de_Attributes & ATTR_DIRECTORY)) { +#ifdef MSDOSFS_DEBUG printf("extendfile(): attempt to extend root directory\n"); +#endif return (ENOSPC); } diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 04957d5a2c0a..ceced730006d 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -902,8 +902,10 @@ doscheckpath(source, target) out:; if (bp) brelse(bp); +#ifdef MSDOSFS_DEBUG if (error == ENOTDIR) printf("doscheckpath(): .. not a directory?\n"); +#endif if (dep != NULL) vput(DETOV(dep)); return (error); diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index e347640bb5dc..5e93c2927b5b 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -555,7 +555,9 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp) || pmp->pm_FATsecs || getushort(b710->bpbFSVers)) { error = EINVAL; +#ifdef MSDOSFS_DEBUG printf("mountmsdosfs(): bad FAT32 filesystem\n"); +#endif goto error_exit; } pmp->pm_fatmask = FAT32_MASK; @@ -633,8 +635,10 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp) clusters = (pmp->pm_fatsize / pmp->pm_fatmult) * pmp->pm_fatdiv; if (pmp->pm_maxcluster >= clusters) { +#ifdef MSDOSFS_DEBUG printf("Warning: number of clusters (%ld) exceeds FAT " "capacity (%ld)\n", pmp->pm_maxcluster + 1, clusters); +#endif pmp->pm_maxcluster = clusters - 1; } |