--------------------- PatchSet 1449 Date: 2001/01/31 04:17:18 Author: darius Branch: sfs Tag: (none) Log: Fix for file_close errors - sfs deals with whether a file's been closed when you try to write to it, doing that check again at higher levels causes more problems. squid now runs successfully with sfs in it - working on rebuild process, then back to whether we're actually storing things properly or not. Members: src/fs/sfs/sfs_llo.c:1.1.2.8->1.1.2.9 src/fs/sfs/store_io_sfs.c:1.1.2.5->1.1.2.6 Index: squid/src/fs/sfs/sfs_llo.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/sfs/Attic/sfs_llo.c,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -r1.1.2.8 -r1.1.2.9 --- squid/src/fs/sfs/sfs_llo.c 29 Jan 2001 14:09:30 -0000 1.1.2.8 +++ squid/src/fs/sfs/sfs_llo.c 31 Jan 2001 04:17:18 -0000 1.1.2.9 @@ -96,6 +96,10 @@ req->request_state = _SFS_IN_PROGRESS; mount_point->pending_requests--; switch (req->request_type) { + case _SFS_OP_OPEN_READ: + case _SFS_OP_OPEN_WRITE: + sfs_do_open(req); + break; case _SFS_OP_UNLINK: sfs_do_unlink(req); break; @@ -108,10 +112,6 @@ case _SFS_OP_WRITE: sfs_do_write(req); break; - case _SFS_OP_OPEN_READ: - case _SFS_OP_OPEN_WRITE: - sfs_do_open(req); - break; case _SFS_OP_CLOSE: sfs_do_close(req); break; @@ -389,6 +389,7 @@ /* Doesn't need to lock, as all allocation is within thread. */ if (!(fd->sfsinode = _sfs_allocate_block(req->sfsid, _SFS_INODE))) { xfree(fd); + printf("ERR: couldn't allocate sfsinode\n"); _sfs_done_request(req,-1); return; } Index: squid/src/fs/sfs/store_io_sfs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/sfs/Attic/store_io_sfs.c,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- squid/src/fs/sfs/store_io_sfs.c 30 Jan 2001 14:35:20 -0000 1.1.2.5 +++ squid/src/fs/sfs/store_io_sfs.c 31 Jan 2001 04:17:18 -0000 1.1.2.6 @@ -1,6 +1,6 @@ /* - * $Id: store_io_sfs.c,v 1.1.2.5 2001/01/30 14:35:20 darius Exp $ + * $Id: store_io_sfs.c,v 1.1.2.6 2001/01/31 04:17:18 darius Exp $ * * DEBUG: section 79 Storage Manager SFS Interface * AUTHOR: Duane Wessels @@ -256,8 +256,6 @@ return; } sio->offset += retval; - if (sfsstate->flags.close_request) - storeSfsIOCallback(sio, DISK_ERROR); } /* === STATIC =========================================================== */ @@ -270,7 +268,7 @@ debug(79, 3) ("storeSfsIOCallback: errflag=%d\n", errflag); if (sfsstate->fd > -1) { - retval = sfs_close(sfsstate->fd, _SFS_IO_ASYNC, sio); + retval = sfs_close(sfsstate->fd, _SFS_IO_SYNC, sio); if (retval < 0) { debug(79, 1) ("storeSfsIOCallback: Can't close %d/%08X!\n", sio->swap_dirn, sfsstate->fd);