[prev in list] [next in list] [prev in thread] [next in thread] 

List:       evms-devel
Subject:    [Evms-devel] VFS Lock Patch Questions
From:       Kevin Corry <corryk () us ! ibm ! com>
Date:       2002-05-28 16:23:31
[Download RAW message or body]

Hi Chris,

I'm one of the developers on the EVMS project, and one of our users (Erik 
Tews) has hit a bug while EVMS is making calls to the VFS locking code.

The problem is pretty simple: EVMS calls the fsync_dev_lockfs() function (in 
fs/buffer.c), which in turn calls sync_supers_lockfs() (in fs/super.c). This 
function grabs the lockfs_sem lock, which seems to be a global lock around 
the kernel's list of super-blocks. This lock is not released until the call 
to unlockfs(). Thus, only one volume/filesystem can be locked at a time.

However, in EVMS, several snapshots can be "virtually" created, and all of 
them saved to disk and activated at the same time. EVMS does this by calling 
fsync_dev_lockfs() on each original that is being snapshotted. Then it 
rediscovers the originals with their new snapshots. Finally it calls 
unlockfs() on each of the originals. Obviously, with the current VFS locking 
code, the second call to fsync_dev_lockfs()/sync_supers_lockfs() deadlocks 
while trying to grab the lockfs_sem lock.

So our question is this: In sync_supers_lockfs(), why can't the lockfs_sem be 
released at the end of the function? This function grabs a superblock pointer 
from the list, calls write_super_lockfs(), and then drops the superblock 
pointer. If the purpose of that lock is to protect the list of superblocks, 
then it would seem that it wouldn't need to hold that lock once it gives up 
the reference to that superblock. The unlockfs() function would seem to work 
similarly.

If the above solution is not possible, my next thought was to add second 
versions of fsync_dev_lockfs() and unlockfs() that take an array of kdev_t's, 
and do the necessary processing on several filesystems, all while holding 
that global lock.

Let me know if this sounds reasonable to you, or if there is something else 
about the locks that I'm not understanding. Thanks for your time!

Kevin Corry
corryk@us.ibm.com
http://evms.sf.net/

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Evms-devel mailing list
Evms-devel@lists.sourceforge.net
To subscribe/unsubscribe, please visit:
https://lists.sourceforge.net/lists/listinfo/evms-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic