Skip to content

Commit 1cce4df

Browse files
goldwynrtorvalds
authored andcommitted
ocfs2: do not lock/unlock() inode DLM lock
DLM does not cache locks. So, blocking lock and unlock will only make the performance worse where contention over the locks is high. Signed-off-by: Goldwyn Rodrigues <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Reviewed-by: Junxiao Bi <[email protected]> Cc: Joseph Qi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1247017 commit 1cce4df

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

fs/ocfs2/dlmglue.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,12 +2432,6 @@ int ocfs2_inode_lock_full_nested(struct inode *inode,
24322432
* done this we have to return AOP_TRUNCATED_PAGE so the aop method
24332433
* that called us can bubble that back up into the VFS who will then
24342434
* immediately retry the aop call.
2435-
*
2436-
* We do a blocking lock and immediate unlock before returning, though, so that
2437-
* the lock has a great chance of being cached on this node by the time the VFS
2438-
* calls back to retry the aop. This has a potential to livelock as nodes
2439-
* ping locks back and forth, but that's a risk we're willing to take to avoid
2440-
* the lock inversion simply.
24412435
*/
24422436
int ocfs2_inode_lock_with_page(struct inode *inode,
24432437
struct buffer_head **ret_bh,
@@ -2449,8 +2443,6 @@ int ocfs2_inode_lock_with_page(struct inode *inode,
24492443
ret = ocfs2_inode_lock_full(inode, ret_bh, ex, OCFS2_LOCK_NONBLOCK);
24502444
if (ret == -EAGAIN) {
24512445
unlock_page(page);
2452-
if (ocfs2_inode_lock(inode, ret_bh, ex) == 0)
2453-
ocfs2_inode_unlock(inode, ex);
24542446
ret = AOP_TRUNCATED_PAGE;
24552447
}
24562448

0 commit comments

Comments
 (0)