diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2014-04-03 17:47:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 19:20:56 -0400 |
commit | 6fdb702d6262b18b1b41a35f1f81903b0a2bc2c9 (patch) | |
tree | fd2dad0ad0c3706f7e511ffd1b47a5af144a0981 /fs/ocfs2/suballoc.c | |
parent | f81c20158f8d5f7938d5eb86ecc42ecc09273ce6 (diff) |
ocfs2: call ocfs2_update_inode_fsync_trans when updating any inode
Ensure that ocfs2_update_inode_fsync_trans() is called any time we touch
an inode in a given transaction. This is a follow-on to the previous
patch to reduce lock contention and deadlocking during an fsync
operation.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Wengang <wen.gang.wang@oracle.com>
Cc: Greg Marsden <greg.marsden@oracle.com>
Cc: Srinivas Eeda <srinivas.eeda@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/suballoc.c')
-rw-r--r-- | fs/ocfs2/suballoc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 47ae2663a6f5..482d6c2a3ea1 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -771,6 +771,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb, | |||
771 | spin_unlock(&OCFS2_I(alloc_inode)->ip_lock); | 771 | spin_unlock(&OCFS2_I(alloc_inode)->ip_lock); |
772 | i_size_write(alloc_inode, le64_to_cpu(fe->i_size)); | 772 | i_size_write(alloc_inode, le64_to_cpu(fe->i_size)); |
773 | alloc_inode->i_blocks = ocfs2_inode_sector_count(alloc_inode); | 773 | alloc_inode->i_blocks = ocfs2_inode_sector_count(alloc_inode); |
774 | ocfs2_update_inode_fsync_trans(handle, alloc_inode, 0); | ||
774 | 775 | ||
775 | status = 0; | 776 | status = 0; |
776 | 777 | ||
@@ -2091,7 +2092,7 @@ int ocfs2_find_new_inode_loc(struct inode *dir, | |||
2091 | 2092 | ||
2092 | ac->ac_find_loc_priv = res; | 2093 | ac->ac_find_loc_priv = res; |
2093 | *fe_blkno = res->sr_blkno; | 2094 | *fe_blkno = res->sr_blkno; |
2094 | 2095 | ocfs2_update_inode_fsync_trans(handle, dir, 0); | |
2095 | out: | 2096 | out: |
2096 | if (handle) | 2097 | if (handle) |
2097 | ocfs2_commit_trans(OCFS2_SB(dir->i_sb), handle); | 2098 | ocfs2_commit_trans(OCFS2_SB(dir->i_sb), handle); |