On Tue, 2008-08-26 at 15:54 +0900, 심재훈 wrote: > Thank you for your reply. I'm afraid that there is no reply, because > nobody understand my words. :)
I understand you now. > Ok well, I see. I'm confused. What I intended to ask is about sets of > data consists of a record, not a record itself. > > I drew a layout of the log buffer below. > ______________________________________________________ > | data #1| log vector | data #2 | log vector | lrd | > |(header)| descriptor | (xtpage entry) | descriptor | | > ------------------------------------------------------ > |<-- data set ------>|<---- data set ---------->| > > If a journal has to write log about whole xtpage block(4K page size), > it has one record descriptor(lrd) which has two data sets. And that > time, what is the record length? Does it's length(lrd->length) can be > larger than 4K bytes? (more precisely 4096 - LOGPHDRSIZE - > LOGPTLRSIZE, because log page has both header and trailer). Yes. > > If it's length is larger than 4080, it may be laid across three log > pages. But fsck code (moveWords() function in log_read.c) seems not to > be able to deal with log records like that. Namely it seems to just > consider a record laid across two log pages. If then, lrd->length has > to be always smaller than 4k - (LOGPHDRSIZE + LOGPTLRSIZE) over all > jfs log records. is it right? It looks like jfs_fsck makes this assumption, but it shouldn't. > > Then, In my modified code, there are some cases that all offsets of > xtpage's entries is modified. So all block(4k) area has to be logged. > it will consist of two data sets. xtpage header area needs 32 + > 4bytes(header + log vector size). the other area of xtpage entry needs > 4064 + 4bytes(xtpage entry area + log vector size). Therefore a total > log record length is 36 + 4068 = 4104. but it may be laid across three > log pages unfortunately. If then, fsck seem not to operate well. I see. > > _______________________________________________________ > | data #1| log vector | data #2 | log vector | lrd | > |(header)| descriptor | (xtpage entry) | descriptor | | > ------------------------------------------------------ > ---->|<-------- a log page ---------------->|<------ > > > I attached the result of jfs_logdump and the code of moveWords > function. > and what do you think about it? is it right what I told above? How > about, If I modify the fsck code so that it can deal with log record > laid across several log pages? I think you're right. If you'd like to fix the code, that would be great. Otherwise, I can fix it, now that you've pointed out the problem. > > I'll wait for your advice~. and can I get some document about jfs log? > I can't find nothing about that. so it is difficult to analyze it :-( I don't know of anything that describes it in detail. The only thing I know besides the source code is: http://jfs.sourceforge.net/project/pub/jfslog/jfslog.pdf I'd never noticed this before, but looking in jfs_logmgr.h: * a log record consists of a data area of variable length followed by * a descriptor of fixed size LOGRDSIZE bytes. * the data area is rounded up to an integral number of 4-bytes and * must be no longer than LOGPSIZE. * the descriptor is of size of multiple of 4-bytes and aligned on a * 4-byte boundary. * records are packed one after the other in the data area of log pages. * (sometimes a DUMMY record is inserted so that at least one record ends * on every page or the longest record is placed on at most two pages). * the field eor in page header/trailer points to the byte following * the last record on a page. Nothing in the code enforces either the LOGPSIZE limit or the DUMMY record that the header file talks about. In practice, it is rare that every entry in an xtree page will be modified in a single transaction, so the likelihood of seeing this problem is pretty small. I would like to fix it though and clean up the incorrect comments. > *offset = LOGPSIZE - LOGPTLRSIZE; > /* index last word of data area */ > j = LOGPSIZE / 4 - 4 - 1; > printf("buf %d offset %d j %d\n", *buf, *offset, j); > /* move rest of nwords if any. this will never > exhaust the page. */ This comment seems to be incorrect, although it's consistent with the comments in jfs_logmgr.h > for (n = 0; n < nwords - words; n++) { > *ptr = logp[*buf].data[j]; > j = j - 1; > ptr = ptr - 1; > } > *offset = *offset - 4 * (nwords - words); > printf("offset %d\n", *offset); > } > > return (0); > } -- David Kleikamp IBM Linux Technology Center ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Jfs-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jfs-discussion
