ocfs2: Add a mount option "coherency=*" to handle cluster coherency for O_DIRECT...
authorTristan Ye <tristan.ye@oracle.com>
Mon, 11 Oct 2010 08:46:39 +0000 (16:46 +0800)
committerJoel Becker <joel.becker@oracle.com>
Mon, 11 Oct 2010 21:14:55 +0000 (14:14 -0700)
commit7bdb0d18bfd381cc5491eb95973ec5604b356c7e
tree1abe07df935a336eeac5c7705dc9b59341b47b0a
parent75d9bbc73804285020aa4d99bd2a9600edea8945
ocfs2: Add a mount option "coherency=*" to handle cluster coherency for O_DIRECT writes.

Currently, the default behavior of O_DIRECT writes was allowing
concurrent writing among nodes to the same file, with no cluster
coherency guaranteed (no EX lock held).  This can leave stale data in
the cache for buffered reads on other nodes.

The new mount option introduce a chance to choose two different
behaviors for O_DIRECT writes:

    * coherency=full, as the default value, will disallow
                      concurrent O_DIRECT writes by taking
                      EX locks.

    * coherency=buffered, allow concurrent O_DIRECT writes
                          without EX lock among nodes, which
                          gains high performance at risk of
                          getting stale data on other nodes.

Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Documentation/filesystems/ocfs2.txt
fs/ocfs2/file.c
fs/ocfs2/ocfs2.h
fs/ocfs2/super.c