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>
This commit is contained in:
@ -87,3 +87,10 @@ dir_resv_level= (*) By default, directory reservations will scale with file
|
||||
reservations - users should rarely need to change this
|
||||
value. If allocation reservations are turned off, this
|
||||
option will have no effect.
|
||||
coherency=full (*) Disallow concurrent O_DIRECT writes, cluster inode
|
||||
lock will be taken to force other nodes drop cache,
|
||||
therefore full cluster coherency is guaranteed even
|
||||
for O_DIRECT writes.
|
||||
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.
|
||||
|
Reference in New Issue
Block a user