aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlmglue.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/dlmglue.c')
-rw-r--r--fs/ocfs2/dlmglue.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index f80fb14ee815..6cd84dffbbf4 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -1427,6 +1427,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode)
1427 lvb->lvb_imtime_packed = 1427 lvb->lvb_imtime_packed =
1428 cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime)); 1428 cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime));
1429 lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); 1429 lvb->lvb_iattr = cpu_to_be32(oi->ip_attr);
1430 lvb->lvb_igeneration = cpu_to_be32(inode->i_generation);
1430 1431
1431 mlog_meta_lvb(0, lockres); 1432 mlog_meta_lvb(0, lockres);
1432 1433
@@ -1482,11 +1483,13 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode)
1482 mlog_exit_void(); 1483 mlog_exit_void();
1483} 1484}
1484 1485
1485static inline int ocfs2_meta_lvb_is_trustable(struct ocfs2_lock_res *lockres) 1486static inline int ocfs2_meta_lvb_is_trustable(struct inode *inode,
1487 struct ocfs2_lock_res *lockres)
1486{ 1488{
1487 struct ocfs2_meta_lvb *lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb; 1489 struct ocfs2_meta_lvb *lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb;
1488 1490
1489 if (lvb->lvb_version == OCFS2_LVB_VERSION) 1491 if (lvb->lvb_version == OCFS2_LVB_VERSION
1492 && be32_to_cpu(lvb->lvb_igeneration) == inode->i_generation)
1490 return 1; 1493 return 1;
1491 return 0; 1494 return 0;
1492} 1495}
@@ -1583,7 +1586,7 @@ static int ocfs2_meta_lock_update(struct inode *inode,
1583 * map (directories, bitmap files, etc) */ 1586 * map (directories, bitmap files, etc) */
1584 ocfs2_extent_map_trunc(inode, 0); 1587 ocfs2_extent_map_trunc(inode, 0);
1585 1588
1586 if (ocfs2_meta_lvb_is_trustable(lockres)) { 1589 if (ocfs2_meta_lvb_is_trustable(inode, lockres)) {
1587 mlog(0, "Trusting LVB on inode %llu\n", 1590 mlog(0, "Trusting LVB on inode %llu\n",
1588 (unsigned long long)oi->ip_blkno); 1591 (unsigned long long)oi->ip_blkno);
1589 ocfs2_refresh_inode_from_lvb(inode); 1592 ocfs2_refresh_inode_from_lvb(inode);
@@ -3166,8 +3169,9 @@ void ocfs2_dump_meta_lvb_info(u64 level,
3166 3169
3167 mlog(level, "LVB information for %s (called from %s:%u):\n", 3170 mlog(level, "LVB information for %s (called from %s:%u):\n",
3168 lockres->l_name, function, line); 3171 lockres->l_name, function, line);
3169 mlog(level, "version: %u, clusters: %u\n", 3172 mlog(level, "version: %u, clusters: %u, generation: 0x%x\n",
3170 lvb->lvb_version, be32_to_cpu(lvb->lvb_iclusters)); 3173 lvb->lvb_version, be32_to_cpu(lvb->lvb_iclusters),
3174 be32_to_cpu(lvb->lvb_igeneration));
3171 mlog(level, "size: %llu, uid %u, gid %u, mode 0x%x\n", 3175 mlog(level, "size: %llu, uid %u, gid %u, mode 0x%x\n",
3172 (unsigned long long)be64_to_cpu(lvb->lvb_isize), 3176 (unsigned long long)be64_to_cpu(lvb->lvb_isize),
3173 be32_to_cpu(lvb->lvb_iuid), be32_to_cpu(lvb->lvb_igid), 3177 be32_to_cpu(lvb->lvb_iuid), be32_to_cpu(lvb->lvb_igid),