xref: /original-bsd/sys/ufs/lfs/TODO (revision 5b995484)
1*5b995484Sbostic#	@(#)TODO	8.1 (Berkeley) 06/11/93
235c1176cSbostic
335c1176cSbosticNOTE: Changed the lookup on a page of inodes to search from the back
435c1176cSbosticin case the same inode gets written twice on the same page.
535c1176cSbostic
635c1176cSbosticMake sure that if you are writing a file, but not all the blocks
735c1176cSbosticmake it into a single segment, that you do not write the inode in
835c1176cSbosticthat segment.
935c1176cSbostic
1038aaa36dSbosticKeith:
1159051aa2Sbostic	Why not delete the lfs_bmapv call, just mark everything dirty
1259051aa2Sbostic		that isn't deleted/truncated?  Get some numbers about
1359051aa2Sbostic		what percentage of the stuff that the cleaner thinks
1459051aa2Sbostic		might be live is live.  If it's high, get rid of lfs_bmapv.
15f69fae42Sbostic
16f69fae42Sbostic	There is a nasty problem in that it may take *more* room to write
17f69fae42Sbostic	the data to clean a segment than is returned by the new segment
18f69fae42Sbostic	because of indirect blocks in segment 2 being dirtied by the data
19f69fae42Sbostic	being copied into the log from segment 1.  The suggested solution
20f69fae42Sbostic	at this point is to detect it when we have no space left on the
21f69fae42Sbostic	filesystem, write the extra data into the last segment (leaving
22f69fae42Sbostic	no clean ones), make it a checkpoint and shut down the file system
23f69fae42Sbostic	for fixing by a utility reading the raw partition.  Argument is
24f69fae42Sbostic	that this should never happen and is practically impossible to fix
25f69fae42Sbostic	since the cleaner would have to theoretically build a model of the
26f69fae42Sbostic	entire filesystem in memory to detect the condition occurring.
27f69fae42Sbostic	A file coalescing cleaner will help avoid the problem, and one
28f69fae42Sbostic	that reads/writes from the raw disk could fix it.
29f69fae42Sbostic
301666c792SbosticDONE	Currently, inodes are being flushed to disk synchronously upon
3159051aa2Sbostic		creation -- see ufs_makeinode.  However, only the inode
3259051aa2Sbostic		is flushed, the directory "name" is written using VOP_BWRITE,
3359051aa2Sbostic		so it's not synchronous.  Possible solutions: 1: get some
3459051aa2Sbostic		ordering in the writes so that inode/directory entries get
3559051aa2Sbostic		stuffed into the same segment.  2: do both synchronously
3659051aa2Sbostic		3: add Mendel's information into the stream so we log
3759051aa2Sbostic		creation/deletion of inodes.  4: do some form of partial
3859051aa2Sbostic		segment when changing the inode (creation/deletion/rename).
391666c792SbosticDONE	Fix i_block increment for indirect blocks.
4054a53d58Sbostic	If the file system is tar'd, extracted on top of another LFS, the
4154a53d58Sbostic		IFILE ain't worth diddly.  Is the cleaner writing the IFILE?
4254a53d58Sbostic		If not, let's make it read-only.
431666c792SbosticDONE	Delete unnecessary source from utils in main-line source tree.
441666c792SbosticDONE	Make sure that we're counting meta blocks in the inode i_block count.
4554a53d58Sbostic	Overlap the version and nextfree fields in the IFILE
461666c792SbosticDONE	Vinvalbuf (Kirk):
4754a53d58Sbostic		Why writing blocks that are no longer useful?
4854a53d58Sbostic		Are the semantics of close such that blocks have to be flushed?
4954a53d58Sbostic		How specify in the buf chain the blocks that don't need
5054a53d58Sbostic		to be written?  (Different numbering of indirect blocks.)
5138aaa36dSbostic
5238aaa36dSbosticMargo:
53c0d3060eSbostic	Change so that only search one sector of inode block file for the
54c0d3060eSbostic		inode by using sector addresses in the ifile instead of
55c0d3060eSbostic		logical disk addresses.
56c0d3060eSbostic	Fix the use of the ifile version field to use the generation
57c0d3060eSbostic		number instead.
581666c792SbosticDONE	Unmount; not doing a bgetvp (VHOLD) in lfs_newbuf call.
591666c792SbosticDONE	Document in the README file where the checkpoint information is
6037a202d6Sbostic		on disk.
6138aaa36dSbostic	Variable block sizes (Margo/Keith).
6238aaa36dSbostic	Switch the byte accounting to sector accounting.
631666c792SbosticDONE	Check lfs.h and make sure that the #defines/structures are all
6438aaa36dSbostic		actually needed.
651666c792SbosticDONE	Add a check in lfs_segment.c so that if the segment is empty,
661666c792Sbostic		we don't write it.
6738aaa36dSbostic	Need to keep vnode v_numoutput up to date for pending writes?
681666c792SbosticDONE	USENIX paper (Carl/Margo).
6938aaa36dSbostic
701666c792Sbostic
711666c792SbosticEvelyn:
7238aaa36dSbostic	lfsck:	If delete a file that's being executed, the version number
7338aaa36dSbostic		isn't updated, and lfsck has to figure this out; case is			the same as if have an inode that no directory references,
7438aaa36dSbostic		so the file should be reattached into lost+found.
751666c792Sbostic	Recovery/fsck.
761666c792Sbostic
771666c792SbosticCarl:
7838aaa36dSbostic	Investigate: clustering of reads (if blocks in the segment are ordered,
7938aaa36dSbostic		should read them all) and writes (McVoy paper).
8038aaa36dSbostic	Investigate: should the access time be part of the IFILE:
8138aaa36dSbostic		pro: theoretically, saves disk writes
8238aaa36dSbostic		con: cacheing inodes should obviate this advantage
8338aaa36dSbostic		     the IFILE is already humongous
8438aaa36dSbostic	Cleaner.
8538aaa36dSbostic	Port to OSF/1 (Carl/Keith).
8638aaa36dSbostic	Currently there's no notion of write error checking.
8738aaa36dSbostic		+ Failed data/inode writes should be rescheduled (kernel level
8838aaa36dSbostic		  bad blocking).
8938aaa36dSbostic		+ Failed superblock writes should cause selection of new
9038aaa36dSbostic		  superblock for checkpointing.
9138aaa36dSbostic
9238aaa36dSbosticFUTURE FANTASIES: ============
9338aaa36dSbostic
941666c792Sbostic+ unrm, versioning
9538aaa36dSbostic+ transactions
961666c792Sbostic+ extended cleaner policies (hot/cold data, data placement)
9738aaa36dSbostic
9838aaa36dSbostic==============================
9938aaa36dSbosticProblem with the concept of multiple buffer headers referencing the segment:
10038aaa36dSbosticPositives:
10138aaa36dSbostic	Don't lock down 1 segment per file system of physical memory.
10238aaa36dSbostic	Don't copy from buffers to segment memory.
10338aaa36dSbostic	Don't tie down the bus to transfer 1M.
10438aaa36dSbostic	Works on controllers supporting less than large transfers.
10538aaa36dSbostic	Disk can start writing immediately instead of waiting 1/2 rotation
10638aaa36dSbostic	    and the full transfer.
10738aaa36dSbosticNegatives:
10838aaa36dSbostic	Have to do segment write then segment summary write, since the latter
10938aaa36dSbostic	is what verifies that the segment is okay.  (Is there another way
11038aaa36dSbostic	to do this?)
11138aaa36dSbostic==============================
11238aaa36dSbostic
11338aaa36dSbosticThe algorithm for selecting the disk addresses of the super-blocks
11438aaa36dSbostichas to be available to the user program which checks the file system.
11538aaa36dSbostic
11638aaa36dSbostic(Currently in newfs, becomes a common subroutine.)
117