Commit be9e986b authored by Mark Fasheh's avatar Mark Fasheh

ocfs2: Local mounts should skip inode updates

We don't want the extent map and uptodate cache destruction in
ocfs2_meta_lock_update() on a local mount, so skip that.

This fixes several bugs with uptodate being cleared on buffers and extent
maps being corrupted.
Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent 0d01af6e
...@@ -1479,12 +1479,15 @@ static int ocfs2_meta_lock_update(struct inode *inode, ...@@ -1479,12 +1479,15 @@ static int ocfs2_meta_lock_update(struct inode *inode,
{ {
int status = 0; int status = 0;
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_lock_res *lockres = NULL; struct ocfs2_lock_res *lockres = &oi->ip_meta_lockres;
struct ocfs2_dinode *fe; struct ocfs2_dinode *fe;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
mlog_entry_void(); mlog_entry_void();
if (ocfs2_mount_local(osb))
goto bail;
spin_lock(&oi->ip_lock); spin_lock(&oi->ip_lock);
if (oi->ip_flags & OCFS2_INODE_DELETED) { if (oi->ip_flags & OCFS2_INODE_DELETED) {
mlog(0, "Orphaned inode %llu was deleted while we " mlog(0, "Orphaned inode %llu was deleted while we "
...@@ -1496,22 +1499,18 @@ static int ocfs2_meta_lock_update(struct inode *inode, ...@@ -1496,22 +1499,18 @@ static int ocfs2_meta_lock_update(struct inode *inode,
} }
spin_unlock(&oi->ip_lock); spin_unlock(&oi->ip_lock);
if (!ocfs2_mount_local(osb)) { if (!ocfs2_should_refresh_lock_res(lockres))
lockres = &oi->ip_meta_lockres; goto bail;
if (!ocfs2_should_refresh_lock_res(lockres))
goto bail;
}
/* This will discard any caching information we might have had /* This will discard any caching information we might have had
* for the inode metadata. */ * for the inode metadata. */
ocfs2_metadata_cache_purge(inode); ocfs2_metadata_cache_purge(inode);
/* will do nothing for inode types that don't use the extent /* will do nothing for inode types that don't use the extent
* map (directories, bitmap files, etc) */ * map (bitmap files, etc) */
ocfs2_extent_map_trunc(inode, 0); ocfs2_extent_map_trunc(inode, 0);
if (lockres && ocfs2_meta_lvb_is_trustable(inode, lockres)) { if (ocfs2_meta_lvb_is_trustable(inode, lockres)) {
mlog(0, "Trusting LVB on inode %llu\n", mlog(0, "Trusting LVB on inode %llu\n",
(unsigned long long)oi->ip_blkno); (unsigned long long)oi->ip_blkno);
ocfs2_refresh_inode_from_lvb(inode); ocfs2_refresh_inode_from_lvb(inode);
...@@ -1558,8 +1557,7 @@ static int ocfs2_meta_lock_update(struct inode *inode, ...@@ -1558,8 +1557,7 @@ static int ocfs2_meta_lock_update(struct inode *inode,
status = 0; status = 0;
bail_refresh: bail_refresh:
if (lockres) ocfs2_complete_lock_res_refresh(lockres, status);
ocfs2_complete_lock_res_refresh(lockres, status);
bail: bail:
mlog_exit(status); mlog_exit(status);
return status; return status;
...@@ -1630,7 +1628,6 @@ int ocfs2_meta_lock_full(struct inode *inode, ...@@ -1630,7 +1628,6 @@ int ocfs2_meta_lock_full(struct inode *inode,
wait_event(osb->recovery_event, wait_event(osb->recovery_event,
ocfs2_node_map_is_empty(osb, &osb->recovery_map)); ocfs2_node_map_is_empty(osb, &osb->recovery_map));
acquired = 0;
lockres = &OCFS2_I(inode)->ip_meta_lockres; lockres = &OCFS2_I(inode)->ip_meta_lockres;
level = ex ? LKM_EXMODE : LKM_PRMODE; level = ex ? LKM_EXMODE : LKM_PRMODE;
dlm_flags = 0; dlm_flags = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment