GJournal status.

July 6, 2006 by · 11 Comments 

After publishing patches I implemented few suggestions from Robert Watson.

I also implemented better handling of journal overflow. Now one can define at which point journal switch is forced. This can be defined in percents via kern.geom.journal.force_switch. Not ideal, but much better than panicing.

BIO_FLUSH support was added to da(4) disks.

I’m in the process of reimplementing how removed, but still open objects (files, directories) are handled in case of a power failure or system crash.

Currently there is a magic .deleted/ directory where such objects are moved. On boot mount(8) can simply ‘rm -rf .deleted/*’.

The solution I’m implementing currently is to increase a counter in cylinder group (CG) when such situation takes place (objects is removed, but still open). When it is closed, I simply decrease the counter. On boot, a much faster fsck version checks the counter in every CG and if it is greater than 0, it scans all inodes in the CG. If it finds allocated inode, but with linkcnt=0, it cleans the inode, ie. remove all allocated blocks, marks as unallocated, etc.

Because of the complexity of UFS on-disk layout it is not a trivial task. To remove an inode completely I need to:

1. Go through the list of direct blocks pointers and mark the blocks in freeblock bitmaps as free.

2. The same as in 1, but for indirect blocks (single, double and triple).

3. Watch out for fragments. Fragments are only used for small files (which use only direct pointed blocks) and a fragment can be only at the end of the file.

4. Update blocks and fragements counters in three places.

5. Update clusters bitmap.

6. Update pointer of the last used block and fragment if needed.

7. Zero-fill the entire inode.

8. Mark an inode as free in inode’s bitmap.

9. Update inodes related counters in three places.

10. Update pointer of the last used inode.

11. Pray for success.

Most of the things I already implemented, but this is not the code I’d like to show. I’m thinking about extending libufs(3), because now its usefullness is very limited.

About pjd

Comments

11 Responses to “GJournal status.”
  1. Eric Anholt says:

    This is very cool. I love that you’re tackling journaling, and look forward to using it on my systems when it’s stable (as in RELENG_6).

    I was wondering, what sort of setup you using for testing of gjournal? Lots of powering off the machine while writing and seeing what happens?

  2. pjd says:

    Yes. Good one knows how many times test machine was powered off:)
    The crash test was: put some heavy load on the file system, power off the machine, reboot, fsck_ffs -n /dev/.journal.

  3. satan4nsv says:

    Descriptions of poker pubs their atmospheresnsv

  4. zxevil161 says:

    zNbh4Z U from Russia?

  5. rickh says:

    Seems different from your previous posts. Did YOU write this post, or someone else did? Anyway, I think your readers really enjoyed reading it.

  6. Darren Rowse says:

    Lovely post. I like your pencraft and that

  7. Melissik says:

    One afternoon, I was in the backyard hanging the laundry when an old, tired-looking dog wandered into the yard. I could tell from his collar and well-fed belly that he had a home. But when I walked into the house, he followed me, sauntered down the hall and fell asleep in a corner. An hour later, he went to the door, and I let him out. The next day he was back. He resumed his position in the hallway and slept for an hour.
    This continued for several weeks. Curious, I pinned a note to his collar: “Every afternoon your dog comes to my house for a nap. ”
    The next day he arrived with a different note pinned to his collar: “He lives in a home with ten children – he’s trying to catch up on his sleep.”

    I cried from laughter
    Sorry, if not left a message on Rules.

  8. Thank you for sharing. Very happy to see your article, I very much to like and agree with your point of view. Have a good time.

Trackbacks

Check out what others are saying about this post...
  1. Jeroldssportsfarm5431$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbo…

    Jeroldssportsfarm5431$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook…

  2. $anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,…

    $anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,nc…

  3. Princetonsportsfield4621$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sport…

    Princetonsportsfield4621$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsb…



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!