diff options
author | msmith <msmith@FreeBSD.org> | 1998-02-26 06:45:46 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-02-26 06:45:46 +0000 |
commit | 4abe3410e6b7490667772d899fd8b5f41416c487 (patch) | |
tree | e46a6730f5f210b692d0353ccc3fda2be11d7531 /sys/msdosfs/msdosfs_vnops.c | |
parent | 15e6194107ac825d2decda9954710a2fbbbe591d (diff) | |
download | FreeBSD-src-4abe3410e6b7490667772d899fd8b5f41416c487.zip FreeBSD-src-4abe3410e6b7490667772d899fd8b5f41416c487.tar.gz |
Fixes for some bugs in the VFAT/FAT32 support:
- 'mv longnamedfile1 longnamedfile2' would cause longnamedfile2 to lose its
long name.
- Long names have trailing spaces/dots stripped for lookup as well as
assignment.
- A lockup when the mdsosfs was accessed from within the Linux emulator is fixed.
- A bug whereby long filenames were recognised by Microsoft operating systems but
not FreeBSD is fixed.
Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
Diffstat (limited to 'sys/msdosfs/msdosfs_vnops.c')
-rw-r--r-- | sys/msdosfs/msdosfs_vnops.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 0226db3..8823d0d 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.60 1998/02/23 16:44:36 ache Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.61 1998/02/24 14:13:16 ache Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -1539,8 +1539,6 @@ msdosfs_readdir(ap) long n; int blsize; long on; - long lost; - long count; u_long cn; u_long fileno; u_long dirsperblk; @@ -1581,13 +1579,10 @@ msdosfs_readdir(ap) * entry or the file offset is not a multiple of the size of a * directory entry, then we fail the read. */ - count = uio->uio_resid & ~(sizeof(struct direntry) - 1); - offset = uio->uio_offset; - if (count < sizeof(struct direntry) || + off = offset = uio->uio_offset; + if (uio->uio_resid < sizeof(struct direntry) || (offset & (sizeof(struct direntry) - 1))) return (EINVAL); - lost = uio->uio_resid - count; - uio->uio_resid = count; if (ap->a_ncookies) { ncookies = uio->uio_resid / 16; @@ -1640,12 +1635,13 @@ msdosfs_readdir(ap) dirbuf.d_reclen, uio); if (error) goto out; + offset += sizeof(struct direntry); + off = offset; if (cookies) { *cookies++ = offset; if (--ncookies <= 0) goto out; } - offset += sizeof(struct direntry); } } } @@ -1763,13 +1759,13 @@ msdosfs_readdir(ap) goto out; } if (cookies) { - *cookies++ = off; - off = offset + sizeof(struct direntry); + *cookies++ = offset + sizeof(struct direntry); if (--ncookies <= 0) { brelse(bp); goto out; } } + off = offset + sizeof(struct direntry); } brelse(bp); } @@ -1778,8 +1774,7 @@ out: if (ap->a_ncookies) *ap->a_ncookies -= ncookies; - uio->uio_offset = offset; - uio->uio_resid += lost; + uio->uio_offset = off; /* * Set the eofflag (NFS uses it) |