summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/suballoc.h
diff options
context:
space:
mode:
authorWeiWei Wang <wangww631@huawei.com>2015-09-04 15:44:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-04 16:54:41 -0700
commit6ab855a99b735c227ad1e0deda636833f41c5b87 (patch)
tree236c00bd664c7557378b2a03f1a55de4e9e0498c /fs/ocfs2/suballoc.h
parent34237681e02ad1617138926f437d0a147249ec13 (diff)
downloadop-kernel-dev-6ab855a99b735c227ad1e0deda636833f41c5b87.zip
op-kernel-dev-6ab855a99b735c227ad1e0deda636833f41c5b87.tar.gz
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 <wangww631@huawei.com> Signed-off-by: Mark Fasheh <mfasheh@suse.de> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/suballoc.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud