Ocfs2: Teach 'coherency=full' O_DIRECT writes to correctly up_read i_alloc_sem.
authorTristan Ye <tristan.ye@oracle.com>
Tue, 7 Dec 2010 06:35:07 +0000 (14:35 +0800)
committerJoel Becker <joel.becker@oracle.com>
Thu, 9 Dec 2010 23:36:48 +0000 (15:36 -0800)
commit39c99f12f15c8bf8257985d9b2a2548a03d18c00
tree38f09ce41f6cbfd3a73b1dc66098ba3bf05e2d6a
parent388c4bcb4e63e88fb1f312a2f5f9eb2623afcf5b
Ocfs2: Teach 'coherency=full' O_DIRECT writes to correctly up_read i_alloc_sem.

Due to newly-introduced 'coherency=full' O_DIRECT writes also takes the EX
rw_lock like buffered writes did(rw_level == 1), it turns out messing the
usage of 'level' in ocfs2_dio_end_io() up, which caused i_alloc_sem being
failed to get up_read'd correctly.

This patch tries to teach ocfs2_dio_end_io to understand well on all locking
stuffs by explicitly introducing a new bit for i_alloc_sem in iocb's private
data, just like what we did for rw_lock.

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