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

List:       fuse-devel
Subject:    [fuse-devel] Locking a filesystem for reorganization
From:       Stefan Westerfeld <stefan () space ! twc ! de>
Date:       2011-09-28 21:00:02
Message-ID: 20110928210002.GA4611 () space ! twc ! de
[Download RAW message or body]

   Hi!

I'm writing a filesystem with fuse that should store content hashes combined
with history as representation of the files. So normally you can write new
files and the contents are just stored. But once you run an external program,
like

$ bfsync2 commit

I need to transform the file contents into hashes and update the history. I
don't want the fuse filesystem to interfere with the reorganization.

My first approach was to let the external program (bfsync2) write a special
file called .bfsync/lock to the FUSE filesystem and write its own pid into the
lock file. Then I added code into every bfsync_open/bfsync_read/...  function
to simply wait for the pid to terminate and block.

However, I've seen that this often causes problems: for instance under KDE4 (if
I understood this correctly), the terminal emulator konsole tries to magically
tell the user the working directory of the running process. Since the FUSE
filesystem is locked during bfsync2 commit, konsole blocks (since all bfsync
filesystem operations block). Since konsole blocks, the terminal output of
bfsync2 commit isn't read anymore, so the commit also blocks. Deadlock. Only
killing the bfsync2 commit process helps.

Any suggestions of how to do this properly?

   Cu... Stefan
-- 
Stefan Westerfeld, Hamburg/Germany, http://space.twc.de/~stefan

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
fuse-devel mailing list
fuse-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuse-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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