On Wed, Aug 26, 2015 at 03:11:40PM -0700, Andrew Morton wrote:
> From: WeiWei Wang <wangww...@huawei.com>
> Subject: ocfs2: add ip_alloc_sem in direct IO to protect allocation changes
> 
> In ocfs2, ip_alloc_sem is used to protect allocation changes on the node. 
> In direct IO, we add ip_alloc_sem to protect date consistent between
> direct-io and ocfs2_truncate_file race (buffer io use ip_alloc_sem
> already).  Although inode->i_mutex lock is used to avoid concurrency of
> above situation, i think ip_alloc_sem is still needed because protect
> allocation changes is significant.
> 
> Other filesystem like ext4 also uses rw_semaphore to protect data
> consistent between get_block-vs-truncate race by other means, So
> ip_alloc_sem in ocfs2 direct io is needed.
> 
> Signed-off-by: Weiwei Wang <wangww...@huawei.com>
> Cc: Mark Fasheh <mfas...@suse.com>
> Cc: Joel Becker <jl...@evilplan.org>
> Signed-off-by: Andrew Morton <a...@linux-foundation.org>

Signed-off-by: Mark Fasheh <mfas...@suse.de>

--
Mark Fasheh

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

Reply via email to