[Libsysio-commit] HEAD: libsysio/drivers/native fs_native.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-02-14 19:49:38
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16325/drivers/native Modified Files: fs_native.c Log Message: + Merged in changes from namespace_assembly branch (see .../misc/init-env.sh) This provoked a bunch of bugs. See below. + Fixed a bug in _sysio_enumerate_extents(). If the IO operation was short, it would go round the loop again, mistakenly trying to fill more of the extent. + In rw.c, fixed bugs in [p]{read,write}[vx] (all the synchronous routines) that improperly propagated error returns. They were returning -errno instead of setting errno and returning -1. + In fs_native.c:doiov, fixed a bug where a zero-length IO was improperly thought to be an error. + In lseek.c:_sysio_lseek, fixed final position check to properly determine {under,over}flow. + In link.c:link, fixed the existence check. No error is returned for nonexistent files when ND_NEGOK is specified. We're supposed to check whether it's a negative entry or not. + A new macro, I_GONE, was added to inode.h. This will *try* to kill an inode but if it can't, it becomes a zombie instead. + In unlink.c:unlink, link.c:link, rename.c:rename, the driver ops were being called but the actual operation in the internal path tree was not reflected. Also, for unlink and rename, use the new I_GONE macro on the destroyed inode. + In fs_native.c:native_inop_gone, close() was always called, even when the fildes was -1. + In fs_native.c:native_inop_gone, close() was called. We really meant to call syscal(SYS_close, ...); + In namei.c:_sysio_path_walk, fixed broken symlink handling. It wasn't following symlinks anywhere if ND_NOFOLLOW was set. That flag only means that the *last* component should not be followed. + In namei.c:_sysio_path_walk, fixed buffer overrun problem for very long symlinks. + In fs_incore.c, fixed dirop_{link,rename,unlink,rmdir} because they were manipulating the system path cache and shouldn't. + In mount.c:_sysio_unmount_all we were mistakenly releasing an FS root after a failed unmount attempt. + Fixes in test_regions.c free allocated memory at the end so valgrind doesn't show a leak. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -w -b -B -p -r1.31 -r1.32 --- fs_native.c 8 Feb 2004 23:48:51 -0000 1.31 +++ fs_native.c 14 Feb 2004 19:42:58 -0000 1.32 @@ -608,8 +608,7 @@ native_iget(struct filesys *fs, * Cached inode has stale attrs * make way for the new one */ - I_RELE(ino); - _sysio_i_undead(ino); + I_GONE(ino); ino = NULL; } else /* @@ -1263,10 +1262,10 @@ doiov(const struct iovec *iov, _SYSIO_OFF_T, void *))dopio, nio); - if (cc > 0) - nio->nio_nino->ni_fpos += cc; - else + if (cc < 0) cc = -errno; + else + nio->nio_nino->ni_fpos += cc; return cc; #if !(defined(REDSTORM) || defined(MAX_IOVEC)) @@ -1567,8 +1566,8 @@ native_inop_gone(struct inode *ino) { struct native_inode *nino = I2NI(ino); - if (nino->ni_fd) - (void )close(nino->ni_fd); + if (nino->ni_fd >= 0) + (void )syscall(SYS_close, nino->ni_fd); free(ino->i_private); } |