aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/dlmglue.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index e335541727f9..31d519a6dbd2 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -1479,12 +1479,15 @@ static int ocfs2_meta_lock_update(struct inode *inode,
1479{ 1479{
1480 int status = 0; 1480 int status = 0;
1481 struct ocfs2_inode_info *oi = OCFS2_I(inode); 1481 struct ocfs2_inode_info *oi = OCFS2_I(inode);
1482 struct ocfs2_lock_res *lockres = NULL; 1482 struct ocfs2_lock_res *lockres = &oi->ip_meta_lockres;
1483 struct ocfs2_dinode *fe; 1483 struct ocfs2_dinode *fe;
1484 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1484 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1485 1485
1486 mlog_entry_void(); 1486 mlog_entry_void();
1487 1487
1488 if (ocfs2_mount_local(osb))
1489 goto bail;
1490
1488 spin_lock(&oi->ip_lock); 1491 spin_lock(&oi->ip_lock);
1489 if (oi->ip_flags & OCFS2_INODE_DELETED) { 1492 if (oi->ip_flags & OCFS2_INODE_DELETED) {
1490 mlog(0, "Orphaned inode %llu was deleted while we " 1493 mlog(0, "Orphaned inode %llu was deleted while we "
@@ -1496,22 +1499,18 @@ static int ocfs2_meta_lock_update(struct inode *inode,
1496 } 1499 }
1497 spin_unlock(&oi->ip_lock); 1500 spin_unlock(&oi->ip_lock);
1498 1501
1499 if (!ocfs2_mount_local(osb)) { 1502 if (!ocfs2_should_refresh_lock_res(lockres))
1500 lockres = &oi->ip_meta_lockres; 1503 goto bail;
1501
1502 if (!ocfs2_should_refresh_lock_res(lockres))
1503 goto bail;
1504 }
1505 1504
1506 /* This will discard any caching information we might have had 1505 /* This will discard any caching information we might have had
1507 * for the inode metadata. */ 1506 * for the inode metadata. */
1508 ocfs2_metadata_cache_purge(inode); 1507 ocfs2_metadata_cache_purge(inode);
1509 1508
1510 /* will do nothing for inode types that don't use the extent 1509 /* will do nothing for inode types that don't use the extent
1511 * map (directories, bitmap files, etc) */ 1510 * map (bitmap files, etc) */
1512 ocfs2_extent_map_trunc(inode, 0); 1511 ocfs2_extent_map_trunc(inode, 0);
1513 1512
1514 if (lockres && ocfs2_meta_lvb_is_trustable(inode, lockres)) { 1513 if (ocfs2_meta_lvb_is_trustable(inode, lockres)) {
1515 mlog(0, "Trusting LVB on inode %llu\n", 1514 mlog(0, "Trusting LVB on inode %llu\n",
1516 (unsigned long long)oi->ip_blkno); 1515 (unsigned long long)oi->ip_blkno);
1517 ocfs2_refresh_inode_from_lvb(inode); 1516 ocfs2_refresh_inode_from_lvb(inode);
@@ -1558,8 +1557,7 @@ static int ocfs2_meta_lock_update(struct inode *inode,
1558 1557
1559 status = 0; 1558 status = 0;
1560bail_refresh: 1559bail_refresh:
1561 if (lockres) 1560 ocfs2_complete_lock_res_refresh(lockres, status);
1562 ocfs2_complete_lock_res_refresh(lockres, status);
1563bail: 1561bail:
1564 mlog_exit(status); 1562 mlog_exit(status);
1565 return status; 1563 return status;
@@ -1630,7 +1628,6 @@ int ocfs2_meta_lock_full(struct inode *inode,
1630 wait_event(osb->recovery_event, 1628 wait_event(osb->recovery_event,
1631 ocfs2_node_map_is_empty(osb, &osb->recovery_map)); 1629 ocfs2_node_map_is_empty(osb, &osb->recovery_map));
1632 1630
1633 acquired = 0;
1634 lockres = &OCFS2_I(inode)->ip_meta_lockres; 1631 lockres = &OCFS2_I(inode)->ip_meta_lockres;
1635 level = ex ? LKM_EXMODE : LKM_PRMODE; 1632 level = ex ? LKM_EXMODE : LKM_PRMODE;
1636 dlm_flags = 0; 1633 dlm_flags = 0;