Re: [PATCH RFC] nilfs2: continuous snapshotting file system

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jörn
Date: Wednesday, August 27, 2008 - 11:13 am

On Wed, 27 August 2008 01:54:30 +0900, Ryusuke Konishi wrote:

Well, I was looking more for something like a list of problems and
solutions.  Partially because I am plain curious and partially because I
know those are the problem areas of any log-structured filesystem and
they deserve special attention in a review.

In logfs, garbage collection may read (and write) any inode and any
block from any file.  And since garbage collection may be called from
writepage() and write_inode(), the fun included:

P: iget() on the inode being currently written back and locked.
S: Split I_LOCK into I_LOCK and I_SYNC.  Has been merged upstream.

P: iget() on an inode in I_FREEING or I_WILL_FREE state.
S: Add inodes to a list in drop_inode() and remove them again in
   destroy_inode().  iget() in GC context is wrapped in a method that
   checks said list first and return an inode from the list when
   applicable.  Used to hold inode_lock to prevent races, but a
   logfs-local lock is actually sufficient.

If either of the two problems above is solved by calling
ilookup5_nowait() I bet you a fiver that a race with data corruption is
lurking somewhere in the area.

P: find_get_page() or some variant on a page handed to
   logfs_writepage().
S: Use the one available page flag, PG_owner_priv_1 to mark pages that
   are waiting for the single-threaded logfs write path.  If any page GC
   needs is locked, check for PG_owner_priv_1 and if it is set, just use
   the page anyway.  Whoever has set the flag cannot clear it until GC
   has finished.
   If the flag is not set, the page might still be somewhere in the
   logfs write path - before setting the page.  So simply do the check
   in a loop, call schedule() each time, knock on wood and keep your
   fingers crossed that the page will either become unlocked and set
   PG_owner_priv_1 sometime soon.  I'm not proud of this solution but
   know no better one.

So something like the above for nilfs would be useful.  And maybe, just
to be on the safe side, try the following testcase overnight:
- Create tiny filesystem (32M or so).
- Fill filesystem 100% with a single file.
- Rewrite random parts of the file in an endless loop.

Or even better, combine this testcase with some automated system crashes
and do an fsck every time the system comes back up. ;)

Jörn

-- 
Geld macht nicht glücklich.
Glück macht nicht satt.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH RFC] nilfs2: continuous snapshotting file system, Ryusuke Konishi, (Tue Aug 19, 7:45 pm)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, Ryusuke Konishi, (Wed Aug 20, 9:13 am)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, Ryusuke Konishi, (Wed Aug 20, 11:47 am)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, Szabolcs Szakacsits, (Wed Aug 20, 2:25 pm)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, Szabolcs Szakacsits, (Wed Aug 20, 2:48 pm)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, Szabolcs Szakacsits, (Wed Aug 20, 7:46 pm)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, Ryusuke Konishi, (Wed Aug 20, 9:57 pm)
Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuo ..., Martin Steigerwald, (Thu Aug 21, 4:02 am)
Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuo ..., Martin Steigerwald, (Thu Aug 21, 8:00 am)
Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuo ..., Szabolcs Szakacsits, (Thu Aug 21, 10:10 am)
Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuo ..., Szabolcs Szakacsits, (Thu Aug 21, 10:33 am)
Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuo ..., Martin Steigerwald, (Thu Aug 21, 11:49 pm)
Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuo ..., Szabolcs Szakacsits, (Fri Aug 22, 5:44 am)
Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuo ..., Szabolcs Szakacsits, (Sat Aug 23, 5:52 am)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, Ryusuke Konishi, (Tue Aug 26, 9:54 am)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, Jörn, (Wed Aug 27, 11:13 am)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, Ryusuke Konishi, (Thu Aug 28, 11:29 pm)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, konishi.ryusuke, (Fri Aug 29, 3:51 am)
Re: [PATCH RFC] nilfs2: continuous snapshotting file system, Ryusuke Konishi, (Fri Aug 29, 9:37 am)